Thread: 5E - Aura Effects
-
December 15th, 2022, 21:34 #881
- Join Date
- Dec 2016
- Location
- Las Vegas NV
- Posts
- 540
-
December 15th, 2022, 22:37 #882
Yep - was easy to do. I'd appreciate if whomever does the code now replaces this function with the changes I made so I can do the above - pretty much do any condition checking supported via extensions currently in use - I tested above with ONLY Aura and BCEG in a test campaign with only two tokens (this is 5E specific also if you need to put some guards around due to that). Also found bug in FGU that Moon says he will fix in some later release that has every single Token.onMove getting double tapped for any one single move (twice the work for everything right now). Here is the code let me know if you plan to stick it in or if I have run my own version of this extension... the comments can be uncommented to watch the internal magic if you wish for verification its doing what I say its doing... DO NOT CREDIT ME FOR THIS IN THE CODE/COMMENTARY - credit implies I'll support this going forward... got enough to do with my own stuff
manager_effect_aura.lua
Code:... local function getAurasForNode(nodeCT, searchString, targetNodeCT) local nodeEffects = DB.getChildren(nodeCT, 'effects') if not nodeEffects then return {} end local rActor = ActorManager.resolveActor(nodeCT) local rTarget = ActorManager.resolveActor(targetNodeCT) -- Debug.console(rActor.sName); local auraEffects = {} for _, nodeEffect in pairs(nodeEffects) do if DB.getValue(nodeEffect, aEffectVarMap['nActive']['sDBField'], 0) == 1 then local sLabelNodeEffect = getEffectString(nodeEffect) if sLabelNodeEffect:match(searchString) then -- make sure conditions allow for this to be processed. -- Debug.console(" ") local aEffectComps = EffectManager.parseEffect(sLabelNodeEffect); -- Debug.console(sLabelNodeEffect) local bSetAura = true for _,sEffectComp in ipairs(aEffectComps) do local rEffectComp = EffectManager5E.parseEffectComp(sEffectComp); -- Debug.console(rEffectComp.type) -- Check conditionals if rEffectComp.type == "IF" then -- Debug.console("Check IF conditions") -- Debug.console(rEffectComp.remainder) if not EffectManager5E.checkConditional(rActor, nodeEffect, rEffectComp.remainder) then bSetAura = false break end elseif rEffectComp.type == "IFT" then -- Debug.console("Check IFT conditions") -- Debug.console(rEffectComp.remainder) if rTarget and not EffectManager5E.checkConditional(rTarget, nodeEffect, rEffectComp.remainder, rActor) then bSetAura = false break end elseif rEffectComp.type == "AURA" then -- Debug.console("AURA - so done Checking conditions"); break end end if bSetAura then -- Debug.console("Conditions passed") table.insert(auraEffects, nodeEffect) else -- Debug.console("Conditions failed") end end end end return auraEffects end ... function updateAuras(sourceNode) ... -- Check if the moved token has auras to apply/remove for _, auraEffect in pairs(getAurasForNode(sourceNode, auraString, otherNode)) do checkAuraApplicationAndAddOrRemove(sourceNode, otherNode, auraEffect, nodeInfo) end -- Check if the moved token is subject to other's auras for _, auraEffect in pairs(getAurasForNode(otherNode, auraString, otherNode)) do checkAuraApplicationAndAddOrRemove(otherNode, sourceNode, auraEffect, nodeInfo) end ... end ...
Last edited by SilentRuin; December 16th, 2022 at 12:38.
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
December 16th, 2022, 14:37 #883
Thanks! I copied that into a new branch on the repo.
I've got it working in the other supported rulesets, but it's not yet removing aura updates when conditions are removed.
I'll get that sorted soon and then push the release.
EDIT: all set. released.Last edited by bmos; December 16th, 2022 at 15:21.
bmos' extensions
he/them
-
December 16th, 2022, 16:15 #884
I've got your live thing which was working fine - but when I started playing with multiple effects each named slightly differently and turning the effects I was not currently testing to "off" I got an infinite loop situation. I'm going to investigate it now. Not sure it was something always happening or just after this live bit.
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
December 16th, 2022, 17:18 #885
Ok I'm not sure what is going on but its hard to duplicate (as in it does not always happen). But when it does happen I'm testing with two aura effects and out of the blue it infinite loops placing FROMAURA's in the targets eventually getting a C overload error in chat. The following is your latest build with just the following change:
Code:... function updateAuras(sourceNode) printstack() ...
Fragmentation Mine2; IF: !WOUNDS(=,1); IFT: !WOUNDS(=,1); IFT: TYPE(Vehicle); AURA: 15 foe; Fragmentation Mine2; IF: FACTION(notself); SAVEE: 14 DEX (H); SAVEDMG: 2d10 kinetic
Fragmentation Mine; IF: !WOUNDS(=,1); IFT: !WOUNDS(=,1); AURA: 15 foe; Fragmentation Mine; IF: FACTION(notself); SAVEE: 14 DEX (H); SAVEDMG: 2d10 kinetic
I tend to turn them on and off or keep both active.
When it works the call stack looks like this...
WhenWorks.jpg
When it infinite loops the call stack looks like this...
WhenInfiniteHappens.png
Not really sure what is going on or if its something that has always happened and I'm just new to AURA testing.Last edited by SilentRuin; December 16th, 2022 at 19:32.
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
December 16th, 2022, 20:16 #886
No longer relevant.
Last edited by SilentRuin; December 17th, 2022 at 15:08.
Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
December 16th, 2022, 21:56 #887
I am getting errors using the Aura Effects EXT in a up to date campaign without any other extensions loaded. I applied Spirit Guardians to a PC and moved the PC to the NPC to trigger adding the effect to the NPC. I then moved the PC away to remove the Effect. When I try to trigger the Aura Effect a second time the FG console error window opens and the Effect is applied to the NPC multiple times, See the chat window and NPC in CT. I have attached a screenshot.
https://cdn.discordapp.com/attachmen...ts_applied.pngFGU Ultimate License
FG Discord - Lord_Ulric
Time Zone: US Eastern (GMT -5)
Playing - Starfinder, D&D, Savage Worlds, Call of Cthulhu, Hero System aka Champions, Traveller, and more!
My Forge Creations
-
December 16th, 2022, 22:45 #888
just posted a hotfix. if that doesn't solve it, i'll have to roll back one of the v1.18 changes
bmos' extensions
he/them
-
December 16th, 2022, 23:02 #889Free(Forums/Forge) Extension(FGU 5E):
Paid (Forge) Extension(FGU 5E):
-
December 16th, 2022, 23:06 #890bmos' extensions
he/them
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks