-
May 7th, 2022, 08:46 #1
Order of calculation for number_linked control
Hi there,
I encountered an issue when using a number_linked control using a multiplicator.
The template I build looks like this:
Code:<template name="number_charsprint"> <number_linked> <font>reference-b-large</font> <modifiersize>mini</modifiersize> <modifierfield>sprint.temporary</modifierfield> <description textres="char_tooltip_sprint" /> <source><name>speed.base</name><op>+</op></source> <source><name>speed.bonus</name><op>+</op></source> <source><name>speed.misc</name><op>+</op></source> <source><name>encumbrance.bulkhalved</name><op>-</op></source> <source><name>speed.sprintfactor</name><op>*</op></source> <source><name>encumbrance.bulk</name><op>-</op></source> <min>4</min> </number_linked> </template>
Number_Linked.png
Taking the above example, the correct calculation logic is "(Speed base + Sped Misc - Half Bulk) * Factor - Bulk" but what get calculated is "(Speed Base - Bulk - Half Bulk) * Factor + Speed Misc + Speed Bonus".
Any idea how I can influence the order of calculation without re-writing the CoreRPG function?
-
May 7th, 2022, 11:57 #2
You might want to try and just override the calculation instead. Here is an example:
capture.pngDominic 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
-
May 7th, 2022, 15:29 #3
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,566
Yeah, the way the number_linked control script was originally built (before my time) is as a very blunt instrument. Even though the code shows support multiplication/division, it doesn't really work without doing as @superteddy57 suggests.
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks