New Spells >> show them off here

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New Spells >> show them off here

Post by Grimwold »

Merethif wrote:
Grimwold wrote: Push Monster
Amazing. I love your spells.

I'm not sure if above spell should work on Tentacles though?
Ha! I never thought about that. Will test it to see what happens and maybe adjust the monster list.
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: New Spells >> show them off here

Post by Xanathar »

My first spell & contribution to the modding community:

CREATE FOOD

Creates a random piece of food - requires Spellcraft 14 and 20 mana.

On a separate note - I'm still undecided if utility spells should be in the spellcraft school (as per light/darkness) or to enrich one of the elementals (to counterbalance invisibility).

Code: Select all

-- Create Food spell
defineSpell{
	name = "create_food_spell",
	uiName = "Create Food",
	skill = "spellcraft",
	level = 14,
	runes = "EF",
	manaCost = 20,
	onCast = function(caster, x, y, direction, skill)
		if getMouseItem() == nil then
			local rand = math.random(5)
			local obj
			
			if rand == 1 then obj = "ice_lizard_steak"
			elseif rand == 2 then obj = "baked_maggot"
			elseif rand == 3 then obj = "boiled_beetle"
			elseif rand == 4 then obj = "rat_shank"
			else obj = "pitroot_bread"
			end
			
			setMouseItem(spawn(obj))
		end
	end
}
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: New Spells >> show them off here

Post by Blichew »

@Xanathar

If I may, I'd change your spell a bit so it would be easier to add new types of food to be spawned with it. So here it goes:

I've also added your version of the spell to our wiki @ http://grimwiki.net (http://grimwiki.net/wiki/Create_Food_Spell)

Code: Select all

defineSpell{
	name = "create_food_spell",
	uiName = "Create Food",
	skill = "spellcraft",
	level = 14,
	runes = "EF",
	manaCost = 20,
	onCast = function(caster, x, y, direction, skill)
		local foodList = {"ice_lizard_steak", "baked_maggot", "boiled_beetle", "rat_shank", "pitroot_bread"}
		if getMouseItem() == nil then
			local obj = foodList[math.random(1,#foodList)]
			setMouseItem(spawn(obj))
		end
	end,
}
User avatar
Xanathar
Posts: 629
Joined: Sun Apr 15, 2012 10:19 am
Location: Torino, Italy
Contact:

Re: New Spells >> show them off here

Post by Xanathar »

Thanks!
Didn't know of the wiki (and neither that there were alread create food spells there :) ).
Waking Violet (Steam, PS4, PSVita, Switch) : http://www.wakingviolet.com

The Sunset Gate [MOD]: viewtopic.php?f=14&t=5563

My preciousss: http://www.moonsharp.org
User avatar
Merethif
Posts: 274
Joined: Tue Apr 24, 2012 1:58 pm
Location: Poland

Re: New Spells >> show them off here

Post by Merethif »

Xanathar wrote:Thanks!
Didn't know of the wiki (and neither that there were alread create food spells there :) ).
The spells that creates food in mage's hand, rather then on the floor, is a way more spiffy IMO :-D Especially since it is random food.

BTW,
Grimwold, when I'm trying to cast Push Monster in editor it quits. Any idea why? Anyone has similar problem?
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: New Spells >> show them off here

Post by Blichew »

I've created an "Enchant Arrow" spell (separate from original Enchant Fire Arrow Spell. It has to be cast while holding (mouseItem) arrow(s). What it does it randomly enchants arrow(s) by replacing them with fire, cold, etc. Feel free to change, I've decided to go with spellcraft level 5 and mana cost of 20.

Enchant Arrow

Code: Select all

defineSpell{
	name = "enchant_arrow",
	uiName = "Enchant Arrow",
	skill = "spellcraft",
	level = 5,
	runes = "AF",
	manaCost = 20,
	onCast = function(caster, x, y, direction, skill)
		local arrowList = {"cold", "fire", "poison", "shock"}
		local rnd = math.random(1,#arrowList)
		local arrowType = arrowList[rnd].."_arrow"
		if getMouseItem().name ~= "arrow" then
			hudPrint("You have to cast this spell while holding an arrow in your hand (cursor)")
		else
			local size = getMouseItem():getStackSize()
			setMouseItem(spawn(arrowType):setStackSize(size))
			playSound("generic_spell")
			if size > 1 then
				hudPrint(caster:getName().." enchanted "..size.." arrows into "..arrowList[rnd].." arrows")
			else
				hudPrint(caster:getName().." enchanted arrow into "..arrowList[rnd].." arrow")
			end
		end
	end,
}
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New Spells >> show them off here

Post by Grimwold »

Merethif wrote:Grimwold, when I'm trying to cast Push Monster in editor it quits. Any idea why? Anyone has similar problem?
Does the game crash out completely, or are you returned to the editor screen? If the second, are there any messages in the script?

Did you add the teleport_probe monster to your monsters.lua file?

I actually re-created the spell on my home PC using only what I posted here and got it to work ok. (Since I forgot to copy my original files from my office PC to my googleDrive!!)
User avatar
Merethif
Posts: 274
Joined: Tue Apr 24, 2012 1:58 pm
Location: Poland

Re: New Spells >> show them off here

Post by Merethif »

Grimwold wrote:
Merethif wrote:Grimwold, when I'm trying to cast Push Monster in editor it quits. Any idea why? Anyone has similar problem?
Does the game crash out completely, or are you returned to the editor screen? If the second, are there any messages in the script?

Did you add the teleport_probe monster to your monsters.lua file?

I actually re-created the spell on my home PC using only what I posted here and got it to work ok. (Since I forgot to copy my original files from my office PC to my googleDrive!!)
Ok, I know what I was doing wrong. I forgot to rename script entity from script_entity_3 to pushback_spell_script (facepalm).
Now it works like a charm.
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New Spells >> show them off here

Post by Grimwold »

Merethif wrote:
Grimwold wrote:
Merethif wrote:Grimwold, when I'm trying to cast Push Monster in editor it quits. Any idea why? Anyone has similar problem?
Does the game crash out completely, or are you returned to the editor screen? If the second, are there any messages in the script?

Did you add the teleport_probe monster to your monsters.lua file?

I actually re-created the spell on my home PC using only what I posted here and got it to work ok. (Since I forgot to copy my original files from my office PC to my googleDrive!!)
Ok, I know what I was doing wrong. I forgot to rename script entity from script_entity_3 to pushback_spell_script (facepalm).
Now it works like a charm.
Great. That was the other thing I was going to suggest.
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New Spells >> show them off here

Post by Grimwold »

I've added a sound effect to the Push Monster Spell above... there's now also an Optional Particle Effect, which requires some particle definition code to be added to the lua files (I use a particles.lua file and add an import line in init.lua)
Post Reply