Scripting Problem with custom Spells

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Resu
Posts: 141
Joined: Tue Nov 10, 2015 12:09 am

Scripting Problem with custom Spells

Post by Resu »

Hey Guys.

I imported a few Spells from Grimworld. They work great and are awesome. But however.. I am not able to make the following item script work because the program shuts down after trying.
SpoilerShow
defineObject{
name = "party",
class = "Party",
editorIcon = 32,
onAttack = function(champ, weapon)


if (weapon ~= nil) and (weapon.name == "sword_of_exmple") then

if party.facing == 0 then
spawn("fire_storm", party.level, party.x, party.y-1, party.facing)
end
if party.facing == 1 then
spawn("fire_storm", party.level, party.x+1, party.y, party.facing)
end
if party.facing == 2 then
spawn("fire_storm", party.level, party.x, party.y+1, party.facing)
end
if party.facing == 3 then
spawn("fire_storm", party.level, party.x-1, party.y, party.facing)
end
end
This works fine with non imported spells tho.
Does anyone know the reason of the cash and how i can solve it?

Cheers, Resu
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: Scripting Problem with custom Spells

Post by Isaac »

When it crashes, check the error log file.
User avatar
Resu
Posts: 141
Joined: Tue Nov 10, 2015 12:09 am

Re: Scripting Problem with custom Spells

Post by Resu »

Isaac wrote:When it crashes, check the error log file.
when i do it in the editor, there is no log. Should i try it ingame? Is that different?
User avatar
Isaac
Posts: 3172
Joined: Fri Mar 02, 2012 10:02 pm

Re: Scripting Problem with custom Spells

Post by Isaac »

It can be different, yes. Check the log file. It's in the game/editor folder, in your documents folder.
User avatar
Resu
Posts: 141
Joined: Tue Nov 10, 2015 12:09 am

Re: Scripting Problem with custom Spells

Post by Resu »

ok i found the file.
SpoilerShow
mod_assets/scripts/items.lua:1276: undefined object: fire_storm
stack traceback:
[C]: in function 'error'
[string "ScriptEntity.lua"]: in function 'spawn'
mod_assets/scripts/items.lua:1276: in function 'onAttack'
[string "Champion.lua"]: in main chunk
[string "Champion.lua"]: in function 'attack'
[string "AttackPanel.lua"]: in function 'select'
[string "AttackPanel.lua"]: in function 'drawItemSlot'
[string "AttackPanel.lua"]: in function 'update'
[string "AttackPanel.lua"]: in function 'update'
[string "Gui.lua"]: in function 'draw'
[string "GameMode.lua"]: in function 'update'
[string "DungeonEditor.lua"]: in main chunk
[C]: in function 'xpcall'
[string "DungeonEditor.lua"]: in function 'preview'
[string "DungeonEditor.lua"]: in function 'update'
[string "Grimrock.lua"]: in main chunk
stack traceback:
[C]: in function 'error'
[string "DungeonEditor.lua"]: in function 'handleError'
[string "DungeonEditor.lua"]: in function 'preview'
[string "DungeonEditor.lua"]: in function 'update'
[string "Grimrock.lua"]: in main chunk
so yeah.. sure fire_storm is an undefined object... but how can I define it? how can it be undefined when my champions can cast it?
User avatar
Resu
Posts: 141
Joined: Tue Nov 10, 2015 12:09 am

Re: Scripting Problem with custom Spells

Post by Resu »

still need Help with this :cry:

Does anyone know how to define custom spells properly?

Cheers
Post Reply