Then I changed a script (some lines of code).
Then I load the save and the changes I made aren't there. The save game still load the old script.
When I load the save it asks me if I want as the version number isn't the same. So I thought it was the new script that should have loaded.
It's really annoying because I saved just before a crash and if I can't test my changes then I have to replay all my dungeon from the beginning (hoping the changes I did wouldn't make the game crash again...)
What's strange is that it didn't crash in the dungeon editor.
Here is the crash log :
Code: Select all
#script_entity_50.script:4: attempt to index a nil value
stack traceback:
#script_entity_50.script:4: in function <#script_entity_50.script:1>
[string "Script.lua"]: in function 'sendMessage'
[string "Component.lua"]: in function 'triggerConnectors'
[string "Component.lua"]: in function 'callHook'
[string "Socket.lua"]: in function 'addItem'
[string "Socket.lua"]: in main chunk
[string "GameObject.lua"]: in function 'sendMessage'
[string "Clickable.lua"]: in function 'onClickComponent'
[string "GameMode.lua"]: in function 'mousePressed'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk
PS2: here is the faulty script :
Code: Select all
function checkSiFigurinesBienPlacees()
local pc = findEntity("pedestal_crowern")
local crowernOK = false
if pc.socket:count() == 1 then crowernOK = pc.socket:getItem().go.name == "figure_crowern" end
local po = findEntity("pedestal_ogre")
local ogreOK = false
if po.socket:count() == 1 then ogreOK = po.socket:getItem().go.name == "figure_ogre" end
local ps = findEntity("pedestal_skeleton")
local skeletonOK = false
if ps.socket:count() == 1 then skeletonOK = ps.socket:getItem().go.name == "figure_skeleton" end
local psn = findEntity("pedestal_snail")
local snailOK = false
if psn.socket:count() == 1 then snailOK = psn.socket:getItem().go.name == "figure_snail" end
local open = crowernOK and ogreOK and skeletonOK and snailOK
if open then
counter_37.counter:decrement()
end
end