In case it might help in the debug:
the function "decodeDamageText" is only called (in manager_action_damage.lua from 3.5e ruleset) to fill the "rDamageOutput". "nDamage" - which is causing the error - receives its input from "nTotal", which is the last parameter of a function you are replacing (I don't know to code LUA, so I need to take a guess here).
Original:
Code:
1277: function applyDamage(rSource, rTarget, bSecret, sRollType, sDamage, nTotal)
In manager_effect_bceDnD.lua:
Code:
204: function customApplyDamage(rSource, rTarget, bSecret, sDamage, nTotal)
with a swap afterwards:
Code:
-- save off the originals so we play nice with others
applyDamage = ActionDamage.applyDamage
ActionDamage.applyDamage = customApplyDamage
It looks like the "sRollType" parameter is missing, so when "applyDamage" is called e.g. in 3.5E/ct/ct_host.xml, it gets a wrong value:
Code:
ActionDamage.applyDamage(nil, rActor, CombatManager.isCTHidden(node), "number", draginfo.getDescription(), draginfo.getNumberData());
Might also be directly in the ruleset (although I believe this is calling the original function) at 3.5E/scripts/manager_action_damage.lua:
Code:
applyDamage(rSource, rTarget, (tonumber(msgOOB.nSecret) == 1), msgOOB.sRollType, msgOOB.sDamage, nTotal);
---- Edited (2) ----
There is still an incompatibility with the "Extended automation and overlay" extension - it looks like IMMUNE is no longer working when both extensions are loaded. Still investigating - sorry.
---- Edited (1) ----
I believe I found the fix, but it caused an incompatibility with the "Extended automation and overlay" extension which needs to be fixed there (it does not gently catch calling a replaced function without the additional parameters).
Code:
*** BetterCombatEffects/scripts/manager_effect_bceDnD.lua.ORIG
--- BetterCombatEffects/scripts/manager_effect_bceDnD.lua
***************
*** 201,207 ****
return true
end
! function customApplyDamage(rSource, rTarget, bSecret, sDamage, nTotal)
local bDead = false
local nodeSource = nil
local nodeTarget = nil
--- 201,207 ----
return true
end
! function customApplyDamage(rSource, rTarget, bSecret, sRollType, sDamage, nTotal)
local bDead = false
local nodeSource = nil
local nodeTarget = nil
***************
*** 215,221 ****
local nTempHPPrev, nWoundsPrev = getTempHPAndWounds(rTarget)
-- Play nice with others
-- Do damage first then modify any effects
! applyDamage(rSource, rTarget, bSecret, sDamage, nTotal)
-- get temp hp and wounds after damage
local nTempHP, nWounds = getTempHPAndWounds(rTarget)
--- 215,221 ----
local nTempHPPrev, nWoundsPrev = getTempHPAndWounds(rTarget)
-- Play nice with others
-- Do damage first then modify any effects
! applyDamage(rSource, rTarget, bSecret, sRollType, sDamage, nTotal)
-- get temp hp and wounds after damage
local nTempHP, nWounds = getTempHPAndWounds(rTarget)
***************
*** 417,423 ****
end
local nTotal = tonumber(msgOOB.nTotal) or 0;
! customApplyDamage(rSource, rTarget, (tonumber(msgOOB.nSecret) == 1), msgOOB.sDamage, nTotal);
end
-- only for Advanced Effects
--- 417,423 ----
end
local nTotal = tonumber(msgOOB.nTotal) or 0;
! customApplyDamage(rSource, rTarget, (tonumber(msgOOB.nSecret) == 1), msgOOB.sRollType, msgOOB.sDamage, nTotal);
end
-- only for Advanced Effects
I have cross-posed to Kelrugem for the update required in his code:
https://www.fantasygrounds.com/forum...933#post640933
Code:
*** "Full OverlayPackage with alternative icons/scripts/manager_action_damage.lua.ORIG"
--- "Full OverlayPackage with alternative icons/scripts/manager_action_damage.lua"
***************
*** 1224,1229 ****
--- 1224,1236 ----
bApplyIncorporeal = true;
end
+ if not bImmune then
+ bImmune = {};
+ end
+ if not bFortif then
+ bFortif = {};
+ end
+
-- IF IMMUNE ALL, THEN JUST HANDLE IT NOW
-- KEL add new output
if bImmune["all"] then