-
December 3rd, 2020, 18:39 #1
- Join Date
- Oct 2020
- Posts
- 6
FGU Effects default to rounds in extensions
Hi there.
A little while ago there was a glitch where the effects did not adhere to the time extent setting. Round, Minute, Hour and so on. It just defaulted to Round. That glitch has been fixed, unless you have an extension that affect the effects.
The following code is enough to recreate the bug:
function onEffectTextAddStart(rEffect)
end
function onInit()
EffectManager.setCustomOnEffectAddStart(onEffectTe xtAddStart);
end
-
December 3rd, 2020, 22:13 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
I'm not sure what the issue you're reporting is. If you have an extension that is affecting the base rulesets, you'll need to take that up with the extension developer.
Regards,
JPG
-
December 4th, 2020, 17:26 #3
- Join Date
- Oct 2020
- Posts
- 6
I am the extension developer.
The issue lies in the CoreRPG ruleset. Specifically in the file managing effects: CoreRPG/scripts/manager_effect.lua
In that file there's an available api setCustomOnEffectAddStart.
Normally it is possible to set a time unit when editing a spell/ability effect, round, minute, and so on. For some reason that data is stripped when using the above api.
Regards
-
December 4th, 2020, 17:27 #4
- Join Date
- Oct 2020
- Posts
- 6
Is this the wrong location for extension development issues?
-
December 4th, 2020, 17:42 #5
I'm sure one of the mods can move this thread into the Workshop for you, no need to re-post there.
Perhaps your extension has a copy of the old function? When FG pushes updates it is your responsibility as extension developer to check the new ruleset versions for changes (and merge those changes into your extensions wherever needed).
EDIT: I don't know what ruleset you are working with, but it looks from your example as though you have a function "onEffectTextAddStart" which should be a copy of an official function (with your changes).
What you need to do is recreate those same changes in the new copy of that function which is being distributed with that ruleset. For 3.5E/PF1e that would be:
Code:function onEffectAddStart(rEffect) rEffect.nDuration = rEffect.nDuration or 1; if rEffect.sUnits == "minute" then rEffect.nDuration = rEffect.nDuration * 10; elseif rEffect.sUnits == "hour" or rEffect.sUnits == "day" then rEffect.nDuration = 0; end rEffect.sUnits = ""; end
Using these instructions, you can protect your extension from future changes by running the original function and then running your function (essentially triggering your function off of the triggering of the original). This can be done as long as you don't need to stop part of the original from running (and even then there are sometimes workarounds).Last edited by bmos; December 4th, 2020 at 17:53.
bmos' extensions
he/them
-
December 4th, 2020, 17:44 #6
MOD: Moved to Workshop for development questions
Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
-
December 4th, 2020, 18:08 #7
- Join Date
- Oct 2020
- Posts
- 6
Oh! I see.
I did not consider that the ruleset I was using would use the same api to the coreset. That makes a lot of sense and I have been able to find and understand what is wrong
Thank you! It's appreciated!
-
December 4th, 2020, 18:09 #8
EDIT: I completely missed that @bmos had already basically said the same. It's been one of those days...
What ruleset are you writing the extension for?
CoreRPG doesn't know how long a round is - as it's generic, so if you only use CoreRPG code then it will set duration = the duration passed, which will be in rounds.
Rulesets that layer on top of CoreRPG use the function set with EffectManager.setCustomOnEffectAddStart to calculate the number of rounds if the duration isn't in rounds.
For example, the following is from the 5E ruleset:
Code:function onEffectAddStart(rEffect) rEffect.nDuration = rEffect.nDuration or 1; if rEffect.sUnits == "minute" then rEffect.nDuration = rEffect.nDuration * 10; elseif rEffect.sUnits == "hour" or rEffect.sUnits == "day" then rEffect.nDuration = 0; end rEffect.sUnits = ""; end
Last edited by Trenloe; December 4th, 2020 at 18:12.
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!
-
December 4th, 2020, 18:21 #9
- Join Date
- Oct 2020
- Posts
- 6
My extension is made for Pathfinder, which inherit the DnD 3.5 ruleset that has the same function.
Before now I didn't quite consider that the other rulesets are also using the core api... Which seems obvious on hindsight.
Now that I understand the issue, I'll figure something out
-
December 4th, 2020, 18:40 #10
- Join Date
- Oct 2020
- Posts
- 6
For prosperity, this is my solution.
function onEffectTextAddStart(rEffect)
EffectManager35E.onEffectAddStart(rEffect);
end
function onInit()
EffectManager.setCustomOnEffectAddStart(onEffectTe xtAddStart);
end
We'll see how safe this is long term, but this works well for now
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks