5E Product Walkthrough Playlist
  1. #1
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,872
    Blog Entries
    1

    Can Effects Expire at the End of a Turn Instead of the Beginning?

    Hey all,

    Quick question for the wizard conclave... Is there a way for an effect to expire at the end of a PC's turn instead of the beginning? I'm working on the DCC ruleset which is based closely on 5E. A DCC spell often gives you a bonus that lasts for 1 round, but the effect expires before it can be applied. For example, the PC casts a spell in round 1 that grants a +1 attack bonus for 1 round, meaning they get the bonus in round 2. If I apply the effect 'ATK: 1' with duration = 1, the effect expires at the beginning of the PC's turn in round 2 and is never applied.

    Maybe I'm missing something obvious. If not, is there a script I can modify to make effects expire at the end of the turn instead of the beginning? I have been setting duration to 2, but that's confusing to players when the spell description says it lasts 1 round. It's not a fatal issue, but just curious.

    Bonus question: I'm also trying to figure out where the 5E ruleset defines the modifiers that work with effect targeting. I have some custom modifiers in DCC that are not being recognized by IFT conditions, and I suspect this is the issue.

    Thanks!

  2. #2
    Zacchaeus's Avatar
    Join Date
    Dec 2014
    Location
    Scotland
    Posts
    21,110
    You need to change the ends on initiate box on the CT so that it comes just after the initiative it was cast on. So if it was cast at initiative 10 then change the number to 9.9 (or any number that comes next in the initiative order). It doesn’t work automatically without extensions.
    If there is something that you would like to see in Fantasy Grounds that isn't currently part of the software or if there is something you think would improve a ruleset then add your idea here https://www.fantasygrounds.com/featu...rerequests.php

  3. #3
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,872
    Blog Entries
    1
    Quote Originally Posted by Zacchaeus View Post
    You need to change the ends on initiate box on the CT so that it comes just after the initiative it was cast on. So if it was cast at initiative 10 then change the number to 9.9 (or any number that comes next in the initiative order). It doesn’t work automatically without extensions.
    Ok sounds good, thanks Z. If anyone else knows another way, let me know…

  4. #4
    Any other mechanism requires changes to the Effects processing. D&D 4E actually has coding for expiring at end of turn or end of next turn.

    Regards,
    JPG

  5. #5
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,872
    Blog Entries
    1
    Thank you, Moon - I will definitely be looking at that.

  6. #6
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,872
    Blog Entries
    1
    This is how I solved my issue. Effects now expire at the end of the turn instead of the beginning, which is as it should be for DCC. I added a few things to the EffectManagerDCC script, which is almost identical to EffectManager5E.

    I added these two lines to the onInit() function:
    Code:
    EffectManager.setCustomOnEffectStartTurn(onEffectStartTurn);
    EffectManager.setCustomOnEffectEndTurn(onEffectEndTurn);
    That registers the custom functions onEffectStartTurn and onEffectEndTurn, which look like this...
    Code:
    function onEffectStartTurn(nodeActor, nodeEffect, nCurrentInit, nNewInit)
        local nDuration = DB.getValue(nodeEffect, "duration", 0);
        if nDuration > 0 then
            nDuration = nDuration - 1;
            DB.setValue(nodeEffect, "duration", "number", nDuration);
            DB.setValue(nodeEffect, "expire", "string", "end");
        end
    end
    The "expire" value allows the ruleset to distinguish between an effect that never had a duration and one that is set to expire.
    Code:
    function onEffectEndTurn(nodeActor, nodeEffect, nCurrentInit, nNewInit)
        local nDuration = DB.getValue(nodeEffect, "duration", 0);
        local sExpire = DB.getValue(nodeEffect, "expire", "");
        if nDuration <= 0 and sExpire == "end" then
            EffectManager.expireEffect(nodeActor, nodeEffect, 0);
            return;
        end
    end
    Both functions are necessary to prevent effects from expiring at the beginning of the turn.

    Cheers,
    Leo

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
  •  
Dungeons & Dragons 2024 Core Rulebooks Pre-Order

Log in

Log in