DICE PACKS BUNDLE
Page 2 of 2 First 12
  1. #11
    Quote Originally Posted by leozelig View Post
    Does anyone know where targetable effect modifiers are defined in the 5E ruleset code? I want to add a few custom modifiers for the DCC ruleset if that's possible.
    what precisely do you mean? Do you have an example? The effect manage of 5e is good script to look at, there the logic is defined. The strings of the effects like ATK are usually defined in the scripts where they get called, like attack manager for ATK

  2. #12
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    Here’s the effect I’m looking at…

    IFT:CUSTOM(Hunt’s quarry); DIEATK:1

    The effect DIEATK is unique to the DCC ruleset and in the example bumps your attack die from a d20 to a d24. That’s a common DCC mechanic. So, I looked at the EffectManagerDCC script but don’t see an obvious definition of what effects are targetable. The conditional is reading correctly, and it works for ATK but not DIEATK.

    I can look at the ActionAttack script, but I don’t recall that defining what’s targetable either. Could be wrong, I’ll check it out. Thanks for the response Kelrugem

  3. #13
    Quote Originally Posted by leozelig View Post
    Here’s the effect I’m looking at…

    IFT:CUSTOM(Hunt’s quarry); DIEATK:1

    The effect DIEATK is unique to the DCC ruleset and in the example bumps your attack die from a d20 to a d24. That’s a common DCC mechanic. So, I looked at the EffectManagerDCC script but don’t see an obvious definition of what effects are targetable. The conditional is reading correctly, and it works for ATK but not DIEATK.

    I can look at the ActionAttack script, but I don’t recall that defining what’s targetable either. Could be wrong, I’ll check it out. Thanks for the response Kelrugem
    ist DIEATK a targetable effect? If not, then this may be the reason Then IFT won't work; usually the IFT and CUSTOM codes are in the effect managers. If you look at IFT's code, then there is usually something like if not rTarget then return; (or something like this, to stop the for-clause there; rTarget the typical name of the target's node information). In other words, if there is no information about a target, then the effect will return false and anything after IFT won't get activated. This makes sense because IFT needs target information to do its stuff

    So, my "educated guess" would be that you look indeed into the attack manager for the call of DIEATK. If the code calling for DIEATK does not proceed the target information, then this effect would not work with IFT, thence, you would need to change the code in such a way that target information is proceeded (may be as simple as simply adding the rTarget information; but depends on the code, I have no idea about DCC )

  4. #14
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    That’s a good thought, I can look at the ActionAttack script.

    DIEATK is not a targetable effect modifier since it only exists in the DCC ruleset. I’m trying to figure out how to make it a targetable modifier, but maybe that just isn’t possible. I spent a lot of time looking at EffectManagerDCC yesterday, and there is a call to a function in the EffectManager script in CoreRPG that is maybe one line of code and returns true or false for targetable or not - but I can’t tell how it’s deciding that. I’ll post the code I’m talking about in case it helps.

    Thanks again for your suggestions!

  5. #15
    Quote Originally Posted by leozelig View Post
    That’s a good thought, I can look at the ActionAttack script.

    DIEATK is not a targetable effect modifier since it only exists in the DCC ruleset. I’m trying to figure out how to make it a targetable modifier, but maybe that just isn’t possible. I spent a lot of time looking at EffectManagerDCC yesterday, and there is a call to a function in the EffectManager script in CoreRPG that is maybe one line of code and returns true or false for targetable or not - but I can’t tell how it’s deciding that. I’ll post the code I’m talking about in case it helps.

    Thanks again for your suggestions!
    You're welcome

    Ah, I see; if it is rather based on CoreRPG, then IFT would have to be coded since IFT does not exist in CoreRPG code For example codes you can look into the effect manager of 5e or 3.5e for "IFT"; but if the effect manager of DCC has nothing in that direction, then there is certainly some work now needed for the code, I think

  6. #16
    Did you setle that stuff?
    How did you wrap the issue?
    Just interested.

  7. #17
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,361
    Quote Originally Posted by leozelig View Post
    That’s a good thought, I can look at the ActionAttack script.

    DIEATK is not a targetable effect modifier since it only exists in the DCC ruleset. I’m trying to figure out how to make it a targetable modifier, but maybe that just isn’t possible. I spent a lot of time looking at EffectManagerDCC yesterday, and there is a call to a function in the EffectManager script in CoreRPG that is maybe one line of code and returns true or false for targetable or not - but I can’t tell how it’s deciding that. I’ll post the code I’m talking about in case it helps.

    Thanks again for your suggestions!
    Exact functionality of an effect is coded in the various manager_action_<action name>.lua scripts in the ruleset where the effect could apply to that action. Exactly which effect handler is called within the action manager (in 5E these are usually called through the EffectManager5E global script package) with exact functionality being determined by the effect handler called and the arguments used.

    For example, we can see from the 5E effect page that INIT is not a targetable effect, whereas ATK is. Looking in the manager_action_init.lua and manager_action_atk.lua handlers we can see that both use the EffectManager5E.getEffectsBonus function, but use different arguments"
    • INIT uses EffectManager5E.getEffectsBonus(rActor, {"INIT"})
    • ATK uses EffectManager5E.getEffectsBonus(rSource, {"ATK"}, false, aAttackFilter, rTarget)


    As eluded to by @Kelrugem, the difference here is that a target record (rTarget) is passed to the ATK EffectManager5E.getEffectsBonus API call, thus allowing the code to include targetable operations.

    Note that in addition, for attacks, there are effects calculated on the defender in ActorManager5E.getDefenseValue - this is where effects relevant to the defender are applied. A good example of this is the Invisible condition - the 5E effects Wiki says it's targetable but the effect line in the manager_action_atk.lua attack action only has EffectManager5E.hasEffectCondition(rSource, "Invisible") - which doesn't include the target at all. However, if we look at the ActorManager5E.getDefenseValue function, we can see that there are two places where the Invisible condition is checked for:

    Code:
    		if EffectManager5E.hasEffect(rAttacker, "Invisible", rDefender, true) then
    			bADV = true;
    		end
    And:

    Code:
    		if EffectManager5E.hasEffect(rDefender, "Invisible", rAttacker) then
    			bDIS = true;
    		end
    The first checks if the attacker is invisible to the defender - in which case the attacker has advantage on the attack. The second checks if the defender is invisible to the attacker - in which case the attacker has disadvantage on the attack.

    Hope the above helps to point you in the right direction. As the DCC ruleset is in the vault I can't give direct examples for that ruleset.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  8. #18
    Quote Originally Posted by Cassandra Botil View Post
    Did you setle that stuff?
    How did you wrap the issue?
    Just interested.
    Leozelig asked Moon Wizard on the Discord to look at that, and Moon Wizard also suggested what I suggested above that leozelig could try to simply add the target information to the call of the DIEATK (in that case the target information is seemingly saved as rDefender, not as rTarget; so, a different label)

    But I do not know whether Leozelig already tried that code

  9. #19
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,850
    Blog Entries
    1
    Quote Originally Posted by leozelig View Post
    Does anyone know where targetable effect modifiers are defined in the 5E ruleset code? I want to add a few custom modifiers for the DCC ruleset if that's possible.
    Just a follow up to my question in case anyone runs into this. I ended up passing the target info to the EffectManagerDCC script, and that worked. It didn't work for damage because the targeting is set to "all" instead of "each" in the GameSystem script. Here is the code I changed in my ActionAttack script (added text in bold):
    Code:
    local nDiceChainMod, nDiceChainCount = EffectManagerDCC.getEffectsBonus(rSource, {"DIEATK"}, true, aAttackFilter, rTarget);
    Kelrugem, you were exactly right. I thought I tried this already, but apparently not.

    Cheers!
    Leo
    Last edited by leozelig; September 14th, 2021 at 16:35.

  10. #20
    Quote Originally Posted by leozelig View Post
    Just a follow up to my question in case anyone runs into this. I ended up passing the target info to the EffectManagerDCC script, and that worked. It didn't work for damage because the targeting is set to "all" instead of "each" in the GameSystem script. Here is the code I changed in my ActionAttack script (added text in bold):
    Code:
    local nDiceChainMod, nDiceChainCount = EffectManagerDCC.getEffectsBonus(rSource, {"DIEATK"}, true, aAttackFilter, rTarget);
    Kelrugem, you were exactly right. I thought I tried this already, but apparently not.

    Cheers!
    Leo
    Nice

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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
  •  
5E Product Walkthrough Playlist

Log in

Log in