DICE PACKS BUNDLE
  1. #1

    The Source of an effect, question why it's based on CT Actor and not the origin

    Is there a reason why the "sSource" of an effect is set to the object in the CombatTracker with current initiative instead of the actor first determined in manager_power.lua performAction()?

    I'm using EffectManager.setCustomOnEffectAddStart(adndOnEffe ctAddStart); to grab the effect and search for [$NAME] within the effect string and replace it with the name of the creature placing the effect. Only problem is it seems the default method is to use the source (rEffect.sSource) from CombatTracker current initiative and not the one where the effect is drag/dropped/used from.

    I'm pretty sure it's because of this code snippet:
    Code:
                if User.isHost() then
                    nodeTempCT = CombatManager.getActiveCT();
                else
    From CoreRPG, manager_action_effect.lua in function onEffect(rSource, rTarget, rRoll)
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  2. #2
    Not sure where the original logic was built; but probably evolved over time. Based on a little testing, it seems that if rSource exists, then that should be used as effect source (even if not PC).

    I'll queue it for a future patch.

    Basically, changing:
    Code:
    		if ActorManager.getType(rSource) == "pc" then
    			sSourceCT = ActorManager.getCTNodeName(rSource);
    		end
    to:
    Code:
    		if rSource then
    			sSourceCT = ActorManager.getCTNodeName(rSource);
    		end
    Cheers,
    JPG

  3. #3
    Okay, was just curious. I couldn't see a reason but was thinking there might be one I couldn't see.

    Thanks, I'll patch it locally for now.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in