Page 1 of 1

random crashes on save load (&random poison damage)

Posted: Thu Sep 27, 2012 3:33 pm
by zeltak
I'm getting desperate. I get these random crashes on one of my dungeon levels when I load my game or sometimes when I enter that particular level. I don't do anything particular to cause the crash, it can happen on the first steps of the dungeon if I load a game or sometimes I can play quite a long in that level for the crash to occur. I get the following error message:
SpoilerShow
[string "TorchHolder.lua"]:0: attempt to compare number with nil stack traceback:
[string "TorchHolder.lua"]: in function 'update'
[string "Map.lua"]: in function 'updateEntities'
[string "Dungeon.lua"]: in function 'updateLevels'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk

OS Version 6.1
OEM ID: 0
Number of processors: 4
Page size: 4096
Processor type: 586
Total memory: 3949 MB
Free memory: 1929 MB

Display device 0:
Device name: \\.\DISPLAY1
Device string: NVIDIA GeForce GT 330M
State flags: 00000005

Display device 1:
Device name: \\.\DISPLAY2
Device string: NVIDIA GeForce GT 330M
State flags: 00000000

Display device 2:
Device name: \\.\DISPLAYV1
Device string: RDPDD Chained DD
State flags: 00000008

Display device 3:
Device name: \\.\DISPLAYV2
Device string: RDP Encoder Mirror Driver
State flags: 00200008

Display device 4:
Device name: \\.\DISPLAYV3
Device string: RDP Reflector Display Driver
State flags: 00200008
I don't even understand what that error message means. Something to do with torch holders I presume.. but is it some sort of bug or is the cause in my dungeon? There is nothing in that level that is related to torch holders, I mean script or mechanism wise, only torch holders placed to map normally in the editor. Only script that has something to do with torches is one level below it, but this crash occurs even if I remove the whole script, and the crash doesn't never occur anywhere else.

On unrelated other bugging matter: My characters on that dungeon take randomly poison damage here and there. I'm trying to pin point is there some elements that make it happen, but at the moment it seems completely random. Does anyone else had similar problems?

Re: random crashes on save load (&random poison damage)

Posted: Thu Sep 27, 2012 3:47 pm
by antti
zeltak wrote:On unrelated other bugging matter: My characters on that dungeon take randomly poison damage here and there. I'm trying to pin point is there some elements that make it happen, but at the moment it seems completely random. Does anyone else had similar problems?
There was at least one bug possibly related to this that we fixed today: if a poison cloud or a fireburst was triggered in the same X, Y position as the player party is but on a different level, the player would be hit with the effect regardless. Maybe you have some poison clouds triggering on a lower floor that, together with the bug, causes this behavior?

This bug will be fixed with the next beta version.

Re: random crashes on save load (&random poison damage)

Posted: Thu Sep 27, 2012 4:13 pm
by zeltak
Excellent news, as it propably is a cause for my problems. You don't have any insight on the nature of the other problem?

Re: random crashes on save load (&random poison damage)

Posted: Thu Sep 27, 2012 4:19 pm
by petri
We would need to be able to reproduce the torch holder problem on our end to see what's going on, so could you please send your dungeon source files to the feedback address, please?

Re: random crashes on save load (&random poison damage)

Posted: Thu Sep 27, 2012 4:43 pm
by zeltak
Source files send.

Re: random crashes on save load (&random poison damage)

Posted: Thu Sep 27, 2012 7:08 pm
by petri
Thanks!

Re: random crashes on save load (&random poison damage)

Posted: Fri Sep 28, 2012 4:08 pm
by zeltak
Thanks to Antti's helpful tips I managed to pinpoint the problem. I'm almost 100% positive that the following script is blame for my crashes.

Code: Select all

poisonf = 1
function pfactivate()
	if party.level == self.level then
		if poisonf == 1 then
			for i=1,12 do
    			local pfspawner = findEntity("poisonFumes_"..i)
        		if pfspawner then
        			pfspawner:activate()
				end
			end
			poisonf = 2
		elseif poisonf == 2 then
			for i=13,24 do
    			local pfspawner = findEntity("poisonFumes_"..i)
        		if pfspawner then
        			pfspawner:activate()
				end
			end
			poisonf =1
		end
    end
end
I deleted all other levels from my dungeon and tested this couple of times. First time when I accidentally had forgotten to change "if party.level ==" -part of the script, there were no crashes even when I saved and loaded the game on every other corner. Then I changed the script to refer to itself and there it was, the game crashed on the familiar error message after couple of minutes. So is there something wrong in my script or is the 24 spawners pumping poisonous gases into the room just too much for the game :roll: