The code below works great...but causes an exception that crashes Grimrock if you try to save the game with anything in any of the alcoves. Thoughts? Has anyone had this issue before?
function CheckAlcovesFull()
alcoveList = {"shieldAlcove1", "shieldAlcove2", "shieldAlcove3", "shieldAlcove4", "shieldAlcove5", "shieldAlcove6"}
for index = 1, #alcoveList do
foundAlcove = findEntity(alcoveList[index])
for alcoveItem in foundAlcove:containedItems() do
if alcoveItem.name == "shining_shield" then
shieldCounter:increment()
end
end
end
if shieldCounter:getValue() == 6 then
shieldsExitDoor:open()
else
shieldCounter:reset()
end
end
is storing an entity reference in a persistent variable, which cannot be serialized and will cause a crash if the player attempts to save.
You want to use the 'local' keyword:
is storing an entity reference in a persistent variable, which cannot be serialized and will cause a crash if the player attempts to save.
You want to use the 'local' keyword: