Looping deaths (B18)

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
whimbrel
Low Yeek
Posts: 5
Joined: Tue Jan 11, 2011 10:53 pm

Looping deaths (B18)

#1 Post by whimbrel »

I've seen a couple of bug reports about death being broken in B18, particularly in the sandworm lair, and I don't think it's been correctly diagnosed yet.

This has happened to me twice, and here's what I think is going on:
1) Die.
2) Have a monster be standing on your respawn spot.
3) HP and Mana are not reset, probably because of a bug related to (2)
4) If it is not your turn, you're going to immediately die again if the monster hits you. This is probably the looping death that's been reported.
5) HOWEVER, sometimes it is your turn. In this case, you can phase door/teleport away, and on the next cycle, your HP will be reset to 1 and you'll survive.

I think this bug can happen anywhere, but because of confined rooms in the SWL, it seems more likely to happen there. It should also be easy to replicate, if you know the wizard commands to generate monsters...

Hope this helps.

whimbrel
Low Yeek
Posts: 5
Joined: Tue Jan 11, 2011 10:53 pm

Re: Looping deaths (B18)

#2 Post by whimbrel »

Sorry, that theory was wrong. I tested it with worms in the trollmires, and it seems like the "findfreegrid" utility function is working fine...

The problem seems to be this, though, from the log file immediately after death (frame stuff snipped):
[LOG] Black jelly hits Todd for #GREEN#26.00 acid damage#LAST#.
[LOG] Black jelly killed Todd!
[LOG] #LIGHT_RED#You resurrect!
findFreeGrid using 34 38
[MOVE] actor moved without a starting position Todd 34 38
[Identify] rough leather cap true
[LOG] You pickup 0.65 gold pieces.
[LOG] There is an item here: #FFFFFF#rough leather cap (0 def, 1 armor)#LAST#
Lua Error: /mod/dialogs/DeathDialog.lua:83: attempt to call method 'resetToFull' (a nil value)
At [C]:-1 resetToFull
At /mod/dialogs/DeathDialog.lua:83 restoreRessources
At /mod/dialogs/DeathDialog.lua:145 use
At /mod/dialogs/DeathDialog.lua:42 fct
At /engine/ui/List.lua:159 onUse
At /engine/ui/List.lua:126 ?
At /engine/KeyBind.lua:198 receiveKey
At /engine/ui/Dialog.lua:320 keyEvent
At /engine/ui/Dialog.lua:170

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Looping deaths (B18)

#3 Post by yufra »

It looks like the problem is that some of the game.level.entities are not actually Actor objects, and therefore don't have the resetToFull function. If you want to help debug this you can open game/modules/tome/dialogs/DeathDialog.lua, find the "easy_mode" section and change the for loop at the end to read like this:

Code: Select all

		for uid, e in pairs(game.level.entities) do
			print(e.name)
			self:restoreResources(e)
		end
This of course assumes that the entity has a name property, which isn't required but is likely.
<DarkGod> lets say it's intended

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Looping deaths (B18)

#4 Post by darkgod »

Ahh this is probably it yes
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

whimbrel
Low Yeek
Posts: 5
Joined: Tue Jan 11, 2011 10:53 pm

Re: Looping deaths (B18)

#5 Post by whimbrel »

Yeah, it's the "unstable sand tunnel" that it's trying to restore resources to before it crashes.

This (very hackish) change in DeathDialog.lua (line 144) fixes the death loop:

for uid, e in pairs(game.level.entities) do
print(e.name)
if e.name == "unstable sand tunnel" then
print("skipping sand tunnel restoration")
else
self:restoreRessources(e)
end
end

Marcotte
Wyrmic
Posts: 203
Joined: Sat Jan 26, 2008 1:12 am

Re: Looping deaths (B18)

#6 Post by Marcotte »

whimbrel wrote:Yeah, it's the "unstable sand tunnel" that it's trying to restore resources to before it crashes.

This (very hackish) change in DeathDialog.lua (line 144) fixes the death loop:

for uid, e in pairs(game.level.entities) do
print(e.name)
if e.name == "unstable sand tunnel" then
print("skipping sand tunnel restoration")
else
self:restoreRessources(e)
end
end
And a little less hackish version would be:

Code: Select all

for uid, e in pairs(game.level.entities) do
	print(e.name)
	if not e.restoreRessources then
		print("skipping sand tunnel restoration")
	else	
		self:restoreRessources(e)
	end			
end

whimbrel
Low Yeek
Posts: 5
Joined: Tue Jan 11, 2011 10:53 pm

Re: Looping deaths (B18)

#7 Post by whimbrel »

Thanks. I don't speak lua, so I didn't know if there was a try/catch construct or anything like that. I was just looking for a quick fix that would let me keep playing my archmage. :)

Post Reply