PDA

View Full Version : parseNPCPowerBuildValue is no longer parsing spell powers for SAVEVS it used to do



SilentRuin
May 13th, 2026, 07:06
This power extracted from a spell nodes defined button save used to translate into [SAVEVS: constitution 11] but no longer does.

#3 = { s'type' = s'cast', s'savebase' = s'fixed', s'label' = s'Bite_Giant Centipede', s'order' = #1, s'save' = s'constitution', s'savemod' = #11, s'onmissdamage' = s'' }

Looking at the code it appears to expect only type of "powersave" so that this is not translated into anything. This used to translate type "cast" also before the major update.

This is in the rewritten EE extension that was ported to the new world of effects. Basically, it appears any spell used to override the default power definition will no longer work when its a CAST saving throw definition in the spell because its uses the type "cast" instead of "powersave". Looking at older checks I can see that all are supported in parseNPCPowerBuildValue except "cast" and "castsave".


The actual full data returned from parseNPCpower is

[5/13/2026 12:57:07 AM] { #1 = { s'bWeapon' = bTRUE, s'label' = s'Bite_Giant Centipede', s'range' = s'M', s'endpos' = #31, s'startpos' = #1, s'rangedist' = s'5', s'type' = s'attack', s'modifier' = #4 }, #2 = { s'label' = s'Bite_Giant Centipede', s'clauses' = { #1 = { s'dice' = { #1 = s'd4' }, s'dmgtype' = s'piercing', s'modifier' = #2 } }, s'startpos' = #65, s'type' = s'damage', s'range' = s'M', s'endpos' = #92 }, #3 = { s'type' = s'cast', s'savebase' = s'fixed', s'label' = s'Bite_Giant Centipede', s'order' = #1, s'save' = s'constitution', s'savemod' = #11, s'onmissdamage' = s'' }, #4 = { s'sInitSource' = s'', s'label' = s'Bite_Giant Centipede', s'order' = #1, s'sExpiration' = s'', s'sUnits' = s'', s'nDuration' = #0, s'sTargeting' = s'', s'sName' = s'Stable', s'type' = s'effect', s'sApply' = s'' }, #5 = { s'order' = #1, s'type' = s'damage', s'clauses' = { #1 = { s'dice' = { #1 = s'd6', #2 = s'd6', #3 = s'd6' }, s'modifier' = #0, s'statmult' = #1, s'stat' = s'', s'dmgtype' = s'poison' } }, s'label' = s'Bite_Giant Centipede' }, #6 = { s'sInitSource' = s'', s'label' = s'Bite_Giant Centipede', s'order' = #2, s'sExpiration' = s'', s'sUnits' = s'minute', s'nDuration' = #60, s'sTargeting' = s'', s'sName' = s'Poisoned; Paralyzed', s'type' = s'effect', s'sApply' = s'' } }

Which currently translates into

Bite [M] [ATK: +4] [DMG: 1d4+2 piercing] [EFF: Stable] [DMG: 3d6 poison] [EFF: Poisoned; Paralyzed (D:60 MIN)] [W]

But used to translate into

Bite [M] [ATK: +4] [DMG: 1d4+2 piercing] [SAVEVS: constitution 11] [EFF: Stable] [DMG: 3d6 poison] [EFF: Poisoned; Paralyzed (D:60 MIN)] [W]

SilentRuin
May 13th, 2026, 14:34
Looks like EE rewrite removed overridden code where I was handling the translation of things like this. Will have to investigate why it was replaced and where to put logic back in that it was doing.

Old EE code:


-- Copy of 5E\scripts\manager_power.lua:getPCPowerAction so that we can translate the rAction from spell actions without the requirement for resolveActor
function getPowerAction(nodeAction)
.. stuff we need to translate...

New EE call that replaced this for translating power actions with an rActor - which "looks" all good:


PowerManager.getPCPowerActionHelper

Which does not translate type cast (for one - not sure of other things I was doing in that old code) action into type powercast

Not sure if there is anything else missing. Looks like I had to do this myself for somethings in old code so will have to kludge those translations back in to get the powers to work with actions in NPC text translations

Missing EE translations in rewrite I'll have to work back into the code (why the syntax between actions and powers is slightly different has always baffled me)...


if rAction.type == "cast" then
...
if sAttackType ~= "" or sAttackBase ~= "" then
rAction.type = "attack"; -- We need to force this because their is no cast interpreted in NPC power ability logic
...
if sSaveType ~= "" then
rAction.type = "powersave"; -- We need to force this because their is no cast interpreted in NPC power ability logic

SilentRuin
May 13th, 2026, 15:06
Fixed by doing the following in the EE rewritten code:

where it was


local rAction = PowerManager.getPCPowerActionHelper(rActor, nodeAction);
if rAction then



it is now



local rAction = PowerManager.getPCPowerActionHelper(rActor, nodeAction);
if rAction then
if rAction.type == "cast" then
local sAttackType = DB.getValue(nodeAction, "atktype", "");
local sAttackBase = DB.getValue(nodeAction, "atkbase", "");
if sAttackType ~= "" or sAttackBase ~= "" then
rAction.type = "attack"; -- We need to force this because their is no cast interpreted in NPC power ability logic
end
local sSaveType = DB.getValue(nodeAction, "savetype", "");
if sSaveType ~= "" then
rAction.type = "powersave"; -- We need to force this because their is no cast interpreted in NPC power ability logic
end
end



Not sure this will affect anyone else not passing this action into the CT NPC actions text translators. There is a lot of inconsistency and confusing syntax differences between an action and a power in different areas of code. So while I used to override this lower level FG function to have this logic - I'm just doing it in this one part of EE now. Not sure ramifications of not having it done in lower level code. In old FG it did not seem to harm it in the override but really in the new world order I have no idea. For now it solves my problem in EE so "good enough".