[git] Stun lua errors

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
greycat
Sher'Tul
Posts: 1396
Joined: Tue May 11, 2010 11:51 pm

[git] Stun lua errors

#1 Post by greycat »

Being attacked by a Dredge. "Dredge uses Stun", it says. I get an indeterminate number of error popups -- so many that I have to repeatedly press "Close All" because I can't even type a whole word in one of them before there's another one eating my keyboard input.

git 36263a0e6dbd43f948b4e4fa992783428bf2e3a9

Code: Select all

dredge  70088   dumb ai talents can use Attack  T_ATTACK
dredge  70088   dumb ai talents can use Speed Sap       T_SPEED_SAP
dredge  70088   dumb ai talents can use Stun    T_STUN
dumb ai uses    T_ATTACK
[ATTACK] attacking with innate combat
stack traceback:
        [C]: in function 'error'
        /engine/interface/ActorTalents.lua:152: in function </engine/interface/A
ctorTalents.lua:134>
Lua Error: /engine/interface/ActorTalents.lua:174: /engine/interface/ActorTalents.lua:152: /mod/class/interface/Combat.lua:1377: bad argument #1 to 'max' (number expected, got table)
stack traceback:
        [C]: in function 'max'
        /mod/class/interface/Combat.lua:1377: in function 'combatDamage'
        /mod/class/interface/Combat.lua:376: in function 'attackTargetWith'
        /mod/class/interface/Combat.lua:195: in function 'attackTarget'
        /data/talents/misc/misc.lua:71: in function </data/talents/misc/misc.lua:51>
        [C]: in function 'xpcall'
        /engine/interface/ActorTalents.lua:147: in function </engine/interface/ActorTalents.lua:134>
        At [C]:-1 
        At [C]:-1 error
        At /engine/interface/ActorTalents.lua:174 useTalent
        At /engine/ai//talented.lua:52 runAI
        At /engine/ai//talented.lua:61 doAI
        At /mod/class/NPC.lua:61 act
        At /engine/GameEnergyBased.lua:126 tickLevel
        At /engine/GameEnergyBased.lua:62 tick
        At /engine/GameTurnBased.lua:46 tick
        At /mod/class/Game.lua:1127 

Hachem_Muche
Uruivellas
Posts: 744
Joined: Thu Nov 18, 2010 6:42 pm

Re: [git] Stun lua errors

#2 Post by Hachem_Muche »

This appears to a problem with the way dredges self.combat is specified.

Code: Select all

combat = { dam=resolvers.levelup(resolvers.rngavg(25,150), 1, 1.2), atk=resolvers.rngavg(25,130), apr=1, dammod={str=1.1} }
Including unarmed talents (Clinch and Crushing Hold in the case of dredges) for NPCs is preventing self.combat from being resolved properly (requiring an extra resolve pass). This leaves self.combat.dam as a table rather than a number.

Strangely, dredglings, which have a similar combat table, but no unarmed talents, are resolving properly.
I'm not sure how to fix this other than a brute force (3rd) pass through the resolvers.
Author of the Infinite 500 and PlenumTooltip addons, and the joys of Scaling in ToME.

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

Re: [git] Stun lua errors

#3 Post by darkgod »

fixed
[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 ;)

Post Reply