[b35] crash with adventurer party (AI?)

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

[b35] crash with adventurer party (AI?)

#1 Post 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 ---------------
Ghoul never existed, this never happened!

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

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

#2 Post 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***
<DarkGod> lets say it's intended

jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

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

#3 Post 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)
Ghoul never existed, this never happened!

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

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

#4 Post 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.
<DarkGod> lets say it's intended

jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

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

#5 Post 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
Ghoul never existed, this never happened!

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

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

#6 Post 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!
Attachments
tactical_ai_nil_damweight.txt
(2.75 KiB) Downloaded 190 times
<DarkGod> lets say it's intended

jotwebe
Uruivellas
Posts: 725
Joined: Fri Apr 15, 2011 6:58 am
Location: GMT+1

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

#7 Post by jotwebe »

No prob. Thanks for debugging :)
Ghoul never existed, this never happened!

Lan
Low Yeek
Posts: 8
Joined: Sat Nov 19, 2011 4:32 pm

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

#8 Post 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.

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

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

#9 Post 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.
<DarkGod> lets say it's intended

Lan
Low Yeek
Posts: 8
Joined: Sat Nov 19, 2011 4:32 pm

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

#10 Post 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 =)

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

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

#11 Post 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!
<DarkGod> lets say it's intended

Post Reply