Log in

View Full Version : ActorManager5E getAbilityScore() and getAbilityBonus() suddenly not correct



JustinFreitas
January 7th, 2022, 01:06
Hi.

One of my extension uses reported a bug with code that hasn't changed yet its behavior has broken in the past few days. I'm wondering if something in the update is affecting ActorManager5E.getAbilityScore() and ActorManager5E.getAbilityBonus() such that they no longer return the value in the NPC sheet for the CT node? Here's a screenshot:
50811

Here's the lines of code... the nodeCT in this case is an Air Elemental:
local nDexterity = ActorManager5E.getAbilityScore(nodeCT, "dexterity")
Debug.chat("ActorManager5E.getAbilityScore(nodeCT, 'dexterity')", nDexterity)
local nBonus = ActorManager5E.getAbilityBonus(nodeCT, "dexterity")
Debug.chat("ActorManager5E.getAbilityBonus(nodeCT, 'dexterity')", nBonus)

If something has changed that I need to take a different approach, please let me know.

Thanks,
Justin

superteddy57
January 7th, 2022, 01:56
I checked the code and it hasn't been changed for a very long time with the script you are referencing. It might be a deeper issue besides the ActorManager5E

JustinFreitas
January 7th, 2022, 02:02
I checked the code and it hasn't been changed for a very long time with the script you are referencing. It might be a deeper issue besides the ActorManager5E

Ok, thanks for looking. Yeah, some other issue then... I'll try to refactor to see if I can get around this a different way.

JustinFreitas
January 7th, 2022, 09:00
It's like the node isn't initialized before the onAdd handler is fired for DB.addHandler("combattracker.list.*", "onAdd", onCTAdd). My custom turn start handler does show the correct attribute and bonus values but not when the NPC is added to the CT. All my attempts to work around this change in behavior have been unsuccessful. I'll revert to only doing the lookups on custom turn start instead of when the NPC is added to the Combat Tracker until it is fixed.