Thank you. I'll try and contact Damned.
Printable View
Does anyone know if there is a way within the calc fields for rolls, or the Health, n1/n2 init fields to make it round up or down or round normal .5 rounding?
It has been a while, and I deleted my XCore campaign so I can't see what I did to make a calculation round. I don't think ROUNDUP or ROUNDDOWN work. I may have had to use the Array.
Being that the arrays are whole number indexed, I think what I would have to do is create an array that has an item for every possible number before the division and then have the array return the rounded result if the index value has been divided by the numbers I need.
And, seems it won't work. It's the Health calc field that I need to divide by 2, and I need to reference a roll.
So getdata|DivByTwo|[Strength|a] does not work.
I had to do the look up on the array from within a roll and then reference that roll to get the result into the health field
I gave up on what I was working on when I realized that if any field has a "0" entry and uses an array, it breaks the character sheet for that skill, stat, etc.
I bought the Ruleset Wizard thinking I would teach myself how to create a ruleset or extension. It feels like trying to create custom scenarios for Neverwinter Nights (1 & 2).
You might also want to talk to lamorric since he has a working (for him) SR 3e ruleset.
https://www.fantasygrounds.com/forum...l=1#post758791
So... I found a huge bug in xcore.
If you have a rule with a name of say, Perception, and if another rule or the same rule has the following in a roll or calc of [Perception|a]
This works fine in itself, but if you have another roll with Perception at the end of it's name it will cause a conflict between the two. Specifically the the roll Perception will interpose itself onto any calc or roll that includes Perception at the end.
The code does a gsub that replaces "Perception|a" with the value of the row a of the Perception roll. Matrix Perception|a and Perception|a are exactly the same when searching for Perception|a.
It searches the string of the roll text or the calc text for Perception|a and replaces it. so Matrix Perception|a gets the Perception|a replaced.
So I edited ManagerRolls.lua to replace how gsub was being used to include [ and ] before and after the original value it was replacing so that Perception|a looks for [Perception|a].
This means that the conflict is removed.
It also means that pretty every references requires [ and ] in them.
I hope I explained this, it's complicated and took me too long to figure out why some rolls worked and some didn't. Or why they worked fine sometimes but not all the time.
Attachment 66689
In order to use these changes you will need to unpack the xcore.pak ruleset file into a folder with the name xcore. Then replace the file in rulesets\XCore\campaign\scripts with the one above.
I also added a couple of items to it.
if you put roundup, rounddown, or round as flags that if places at the beginning of a calc will do that form of rounding on the entire line.