[b36] Lua Error at the Ambush

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
zmadian
Posts: 2
Joined: Sat Oct 08, 2011 8:32 pm

[b36] Lua Error at the Ambush

#1 Post by zmadian »

I have gotten this Lua Error twice in a row when "dying" at the Ambush. After the error i'm stuck in that area.
I have only passed the ambush once before but if i remember correctly one should be teleported out of the area.

Code: Select all

Lua Error: /data/quests/staff-absorption.lua:80: attempt to index global 'player' (a nil value)
	At [C]:-1 __index
	At /data/quests/staff-absorption.lua:80 die
	At /engine/interface/ActorLife.lua:72 takeHit
	At /data/damage_types.lua:227 projector
	At /mod/class/interface/Archery.lua:157 damtype
	At /engine/interface/ActorProject.lua:347 projectDoAct
	At /engine/interface/ActorProject.lua:412 projectDoStop
	At /engine/Projectile.lua:226 act
	At /engine/GameEnergyBased.lua:118 tickLevel
	At /engine/GameEnergyBased.lua:62 tick
	At /engine/GameTurnBased.lua:44 tick
	At /mod/class/Game.lua:955 
Any suggestions on how to get out of the area after the error occures would be greatly appreciated :)

Devorius
Cornac
Posts: 41
Joined: Fri Dec 09, 2011 4:19 pm

Re: [b36] Lua Error at the Ambush

#2 Post by Devorius »

Do you mean a world map mob encounter? i.e bandits, bears, wolves, etc.? There will be an exit somewhere at the edge of the map, usually on the opposite side of where you spawned.

thesmuel
Posts: 1
Joined: Sun Dec 11, 2011 7:13 pm

Re: [b36] Lua Error at the Ambush

#3 Post by thesmuel »

I have suffered a similar problem at the same point.

Code: Select all

Lua Error: /engine/interface/ActorTalents.lua:140: /data/quests/staff-absorption.lua:80: attempt to index global 'player' (a nil value)
	At [C]:-1 
	At [C]:-1 error
	At /engine/interface/ActorTalents.lua:140 bumpInto
	At /mod/class/Actor.lua:1921 attack
	At /engine/interface/ActorLife.lua:41 check
	At [string "return function(self, x, y, what, ...) local ..."]:1 checkAllEntities
	At /engine/Actor.lua:166 move
	At /mod/class/Actor.lua:641 doAI
	At /mod/class/NPC.lua:47 act
	At /engine/GameEnergyBased.lua:118 tickLevel
	At /engine/GameEnergyBased.lua:62 tick
	At /engine/GameTurnBased.lua:44 tick
	At /mod/class/Game.lua:955 
ps @Devorious This is at "Ambush! (1)", the cutscene-style mini level after recalling from Dreadfell with the rod of absorption

Marcas
Yeek
Posts: 12
Joined: Sun Dec 11, 2011 9:42 pm

Re: [b36] Lua Error at the Ambush

#4 Post by Marcas »

I´ve had this bug too, and my lua error looks like thesmuel´s. Would appreciate if anyone knows how to solve this..

Marcas
Yeek
Posts: 12
Joined: Sun Dec 11, 2011 9:42 pm

Re: [b36] Lua Error at the Ambush

#5 Post by Marcas »

I´ve had this bug too and my lua error looks like thesmuel´s. Would appreciate if anyone know how to solve this..

Devorius
Cornac
Posts: 41
Joined: Fri Dec 09, 2011 4:19 pm

Re: [b36] Lua Error at the Ambush

#6 Post by Devorius »

thesmuel wrote:ps @Devorious This is at "Ambush! (1)", the cutscene-style mini level after recalling from Dreadfell with the rod of absorption
Ah, haven't been to Dreadfell yet. :)

I found the offending code though, as per the error messages:

Code: Select all

		local o, item, inven_id = player:findInAllInventoriesBy("define_as", "STAFF_ABSORPTION")
		if o then
			self:removeObject(inven_id, item, true)
			o:removed()
		end
Which seems to fail because of:

Code: Select all

	who.die = function(self)
		self.dead = false
		self.die = nil
		self.life = 1
		for _, e in pairs(game.level.entities) do
			if e ~= self and self:reactionToward(e) < 0 then
				game.level:removeEntity(e)
				e.dead = true
			end
		end
I'm not familiar with the specifics of the T-Engine, however it seems like this is meant to prevent the player from dying, but for some reason it looks like the player is not getting excluded from the for loop logic as he should.

I don't know Lua, however I know C/C++/C# so apologies if I'm wrong. I'm assuming ~= is the inequality operator, so I get this logic:

If e is not the Player, and is not an ally of the Player, then ...

That looks sound, so unless there's an error in the comparative logic, my only other guess is the Player object is being destroyed prior to calling the quest code...

Marcas
Yeek
Posts: 12
Joined: Sun Dec 11, 2011 9:42 pm

Re: [b36] Lua Error at the Ambush

#7 Post by Marcas »

Ok, a very friendly player gave me the solution

1. go to http://te4.org/wiki/t4modules-debugging and read the instructions on how to enable debugging mode.

2. Keybind debugging to something.

3. press the bound key to bring up the debugging menu. Change the zone to last hope and then give yourself the quest named "Orc hunt"

4. Disable debugging mode by simply deleting the file or change "true" to "false"

5. ENJOY!

zmadian
Posts: 2
Joined: Sat Oct 08, 2011 8:32 pm

Re: [b36] Lua Error at the Ambush

#8 Post by zmadian »

Thanks for the tip Marcas!

I did some testing and substituting:

Code: Select all

player:findInAllInventoriesBy("define_as", "STAFF_ABSORPTION")
with

Code: Select all

self:findInAllInventoriesBy("define_as", "STAFF_ABSORPTION")
did the trick for me.

Looks like player:findInAllInventoriesBy is causing no answeres to appear at the Elder in Last Hope too.

Post Reply