Page 1 of 1

[b35] crash with adventurer party (AI?)

Posted: Mon Nov 28, 2011 4:47 pm
by jotwebe
Cast "Redux" and then "Turn Back The Clock" on a adventurer, got an infinite number of error popups. Actually, after killing t-engine and reloading, I get the exact same thing after using a staff of ruination instead.

This is the console output (repeated):

Code: Select all

Lua Error: /mod/ai//tactical.lua:139: attempt to perform arithmetic on local 'damweight' (a function value)
	At [C]:-1 __mul
	At /mod/ai//tactical.lua:139 runAI
	At /mod/ai//tactical.lua:399 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:926 
 ----------------  Stack Dump ----------------
2: table // f709fd98
1: table // f709fd98
--------------- Stack Dump Finished ---------------

Re: [b35] crash with adventurer party (AI?)

Posted: Mon Nov 28, 2011 9:41 pm
by yufra
Thanks for posting the error. The problem is not what you are doing, but what the adventurer is trying to do. If possible can you find what is going on right before the Lua errors? I am specifically hoping for a tactical AI report, which would look something like this (taken from http://forums.te4.org/viewtopic.php?f=42&t=25050):

Code: Select all

============================== TACTICAL AI   orc high cryomancer
orc high cryomancer   19730   tactical ai talents testing   Freeze   T_FREEZE
orc high cryomancer   19730   tactical ai talents can use   Freeze   T_FREEZE   attack   weight   2.4705616156643
orc high cryomancer   19730   tactical ai talents can use   Freeze   T_FREEZE   disable   weight   6.8076474006091
orc high cryomancer   19730   tactical ai talents testing   Ice Storm   T_ICE_STORM
[DEBUG] hit an ally!

*** AND NOW THE LUA ERRORS***

Re: [b35] crash with adventurer party (AI?)

Posted: Tue Nov 29, 2011 5:30 am
by jotwebe
All right, ran it with putting stdout into a file now so Icould get the good bit:

basically

Code: Select all

AI took for target      2709    Osassar the shalore     ::      2713    Cassandra       100     <       100
After that it runs in a loop...

Code: Select all

[PROJECTOR] after difficulty dam        101.82046048171
[PROJECTOR] res -20     1.2      on dam 101.82046048171
[PROJECTOR] after resists dam   122.18455257806
[PROJECTOR] final dam   122.18455257806
[LOG]   Cassandra hits Ryrusmu the halfling for #LIGHT_STEEL_BLUE#123 temporal#LAST# damage.
AI took for target      2709    Osassar the shalore     ::      2713    Cassandra       100     <       100
Lua Error: /mod/ai//tactical.lua:139: attempt to perform arithmetic on local 'damweight' (a function value)
        At [C]:-1 __mul
        At /mod/ai//tactical.lua:139 runAI
        At /mod/ai//tactical.lua:399 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:926
 ----------------  Stack Dump ----------------
2: table // f709fd98
1: table // f709fd98
--------------- Stack Dump Finished ---------------
L(f0f7b1c0) Particle updater error eff47f00 (17, 19): attempt to call a number value
Lua Error: /mod/ai//tactical.lua:139: attempt to perform arithmetic on local 'damweight' (a function value)

Re: [b35] crash with adventurer party (AI?)

Posted: Tue Nov 29, 2011 4:38 pm
by yufra
Oh, I forgot that DG suppressed the tactical AI stdout which is why you are not seeing the extended tactical report. Alright, at least we know that the problem is a specific talent that "Osassar the shalore" has. Would you mind inspecting that actor and giving me a list of the talents he has? Thanks.

Re: [b35] crash with adventurer party (AI?)

Posted: Tue Nov 29, 2011 5:28 pm
by jotwebe
Here we go:
Osassar the Shalore wrote: Blurred Mortality 3
Create Minions 3
Displacement Shield 2
Invoke Darkness 5
Magic of the Eternals 3
Necrotic Aura 2
Shatter 2
Teleport 2
Trap Detection 2

Re: [b35] crash with adventurer party (AI?)

Posted: Tue Nov 29, 2011 9:14 pm
by yufra
That helped a lot, I found the bug. The error was caused by the Shatter talent, although the actual bug was in not checking for nil values in the tactical AI code. I have attached the patch to fix it and will let DG know. Thanks again for all the debugging help!

Re: [b35] crash with adventurer party (AI?)

Posted: Wed Nov 30, 2011 4:11 am
by jotwebe
No prob. Thanks for debugging :)

Re: [b35] crash with adventurer party (AI?)

Posted: Thu Dec 01, 2011 11:43 pm
by Lan
Is there a way to incorporate this patch manualy into b35 (ie myself)? This bug happened a lot to me and my latest char is kinda stuck because of this.

He is in a Farportal dungeon and the final boss triggers this bug everytime.

Re: [b35] crash with adventurer party (AI?)

Posted: Thu Dec 01, 2011 11:56 pm
by yufra
Lan wrote:Is there a way to incorporate this patch manualy into b35 (ie myself)? This bug happened a lot to me and my latest char is kinda stuck because of this.

He is in a Farportal dungeon and the final boss triggers this bug everytime.
Hmmm, well just know that it would invalidate your "clean game" status so you wouldn't upload to the character vault anymore, and the unlocks wouldn't be available in the "clean" b36+. You can fix this by finding the tome-blablabla.team file and unpacking it (it is actually a GNU-zipped tar archive). Then apply the patch, re-tar/zip the team file and get going. Alternatively, enable cheat-mode and teleport yourself out of the Farportal dungeon. Those are the most obvious fixes.

Re: [b35] crash with adventurer party (AI?)

Posted: Fri Dec 02, 2011 5:31 am
by Lan
Thanks!

The patch worked. Haven't played extensively yet, only tried to kill the boss that was causing the problem. But no lua error =)

Re: [b35] crash with adventurer party (AI?)

Posted: Fri Dec 02, 2011 5:41 pm
by yufra
Lan wrote:Thanks!

The patch worked. Haven't played extensively yet, only tried to kill the boss that was causing the problem. But no lua error =)
Great!