a script to trigger when a rune is cast
a script to trigger when a rune is cast
Much like getting teleported when you cast the balance rune at the en d of the main game....( i dont know shit about scripting )
Basically i want a door to open when a specific rune is cast while stood on a specific tile. any idea how id go about that
Basically i want a door to open when a specific rune is cast while stood on a specific tile. any idea how id go about that
Re: a script to trigger when a rune is cast
Karinas23
Define the spell in your spells.lua
Then place a script entity in your dungeon called 'customSpellScript' and paste this into it...
Then place an object (forest_floor_01 for example) somewhere in your dungeon and name it 'karinaSpellSquare'
Lastly place a door (castle_door_wood for example) somewhere in your dungeon (probably close by) and name it 'karinaDoor' - DONE!
The spell uses the 3 runes on the left, top left to bottom left.
Define the spell in your spells.lua
SpoilerShow
Code: Select all
defineSpell{
name = "karinas_spell",
uiName = "Karinas Spell",
requirements = {"concentration", 1},
gesture = 147,
manaCost = 5,
icon = 0,
spellIcon = 0,
description = "door to open when a specific rune is cast while stood on a specific tile.",
onCast = function(champion, x, y, direction, elevation, skillLevel)
customSpellScript.script.karinaSpellCast(champion, x, y, direction, elevation, skillLevel)
end,
}
SpoilerShow
Code: Select all
function karinaSpellCast(champion, x, y, direction, elevation, skillLevel)
local square = findEntity("karinaSpellSquare")
if (party.level == square.level
and party.x == square.x
and party.y == square.y
and party.elevation == square.elevation) then
hudPrint("Success!!.... do stuff here.")
karinaDoor.door:open()
playSound("level_up")
else
hudPrint("You need to be standing on the grass...")
champion:playDamageSound()
end
end
Lastly place a door (castle_door_wood for example) somewhere in your dungeon (probably close by) and name it 'karinaDoor' - DONE!
The spell uses the 3 runes on the left, top left to bottom left.
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: a script to trigger when a rune is cast
ty i will try this....i assume gesture = 147 is the runes required ? as in
123
456
789 ?
123
456
789 ?
Re: a script to trigger when a rune is cast
Yup!
The spell uses the 3 runes on the left, top left to bottom left.
The spell uses the 3 runes on the left, top left to bottom left.
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: a script to trigger when a rune is cast
now i can create my doors sealed with rank 5 elemental spells ;p
Re: a script to trigger when a rune is cast
Spell just causes an error ;p
Re: a script to trigger when a rune is cast
What's the error ?
From the top of my head: is the spell actually "castable" ? I mean does it form a line on the casting grid ?
From the top of my head: is the spell actually "castable" ? I mean does it form a line on the casting grid ?
Re: a script to trigger when a rune is cast
its castable....the error happens when i cast it
Re: a script to trigger when a rune is cast
Looks like you don't have customSpellScript script_entity in the game.
Could you post spell definition here ? code from customSpellScript script_entity might come handy too...
Could you post spell definition here ? code from customSpellScript script_entity might come handy too...
Re: a script to trigger when a rune is cast
never mind i got it, the danger of having your own name in scripts....automatically capitalising it without realising