-
September 5th, 2021, 22:40 #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!
-
September 5th, 2021, 23:42 #2
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
-
September 6th, 2021, 01:57 #3
-
September 6th, 2021, 20:28 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,559
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
-
September 6th, 2021, 21:28 #5
Thank you, Moon - I will definitely be looking at that.
-
September 14th, 2021, 16:44 #6
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);
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
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
Cheers,
Leo
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks