Combining dice rules

Be sure to read and follow the guidelines for our forums.

Sep 2, 2022 2:55 pm
So I upgraded an old Mothership sheet and wanted to set up dice rules for it as well. There are 3 different dice rules I am trying to combine, two are d100, and 1 is 2d10. What I want is something like this:

"diceRules": [
{"rolled": "1d100","reason": "(##)","total": ">=##","highlight": "fail invert bold"},
{"rolled": "1d100","reason": "(##)","total": "<##","highlight": "success invert bold"},
{"rolled": "d100double","reason": "(##)","total": ">=##","contentAppend": "❌","highlight": "fail invert bold"},
{"rolled": "d100double","reason": "(##)","total": "<##","contentAppend": "✅","highlight": "success invert bold"},
{"rolled": "2d10","reason": "(##)","total": "<=##","highlight": "fail invert bold"},
{"rolled": "2d10","reason": "(##)","total": ">##","highlight": "success invert bold"}
],

Rolling under your stat/skill is a success, rolling doubles is a crit success/fail, and rolling 2d10 over stress is a success. I've tried this but the doubles don't work, and neither do the 2d10 rules. Any help for combining these would be appreciated!
Sep 2, 2022 3:08 pm
Maybe try changing the order the rules are listed. Put the doubles above the plain 1d100?

Try the doulbes or 2d10 rule on their own to make sure they actually work and this is not a combination issue.

I can test them later if you need.
Sep 2, 2022 3:12 pm
Can you have multiple "diceRules":[ ], expressions? That might solve the problem...
Sep 2, 2022 3:23 pm
I don't believe you can have more than one block.

You seem to be missing some stuff from the d100 roll though, you need to tell it you are rolling d100s.


{"rolled":"d100", "d100double":"true","highlight": "success"}


works, adjust it to fit your more complex needs.
Sep 2, 2022 3:26 pm
I have the d100 rolls working, just none of the other rolls will work with it. Doubles show up as normal successes instead of the content append results. I tried multiple blocks and it doesn't work but it didn't break anything either.
Sep 2, 2022 3:27 pm
Do you doubles rules say {"rolled":"d100", "d100double":"true", ...?
Sep 2, 2022 3:28 pm
If you link to the game details page I can take a look at your code.
Sep 2, 2022 3:38 pm
https://gamersplane.com/games/3596
Sep 2, 2022 3:39 pm
Not the first d100, I thought d100double already made it clear it was d100... lol do I have to put it twice?
Sep 2, 2022 3:41 pm
The first one tells it which dice rolls to look at, the second matches the d100double pattern. If you skip the "rolled":"d100" then it does not look at you d100 rolls.
Sep 2, 2022 3:47 pm
"Rolled": "d100", "d100doubles" is invalid Json. I tried including them both in the same quotation marks and that was valid but didn't work.
Sep 2, 2022 3:49 pm
{"rolled":"d100", "d100double":"true", ...

You left out the :"true" part, and it is d100double not d100doubles
Sep 2, 2022 3:50 pm
You could copy paste this (assuming the "reason" stuff is correct, I have not used reasons).


"diceRules": [
{"rolled": "1d100","reason": "(##)","total": ">=##","highlight": "fail invert bold"},
{"rolled": "1d100","reason": "(##)","total": "<##","highlight": "success invert bold"},
{"rolled":"d100", "d100double":"true", "reason": "(##)","total": ">=##","contentAppend": "❌","highlight": "fail invert bold"},
{"rolled":"d100", "d100double":"true", "reason": "(##)","total": "<##","contentAppend": "✅","highlight": "success invert bold"},
{"rolled": "2d10","reason": "(##)","total": "<=##","highlight": "fail invert bold"},
{"rolled": "2d10","reason": "(##)","total": ">##","highlight": "success invert bold"}
],
Sep 2, 2022 4:17 pm
It mostly works. Because the d100double also uses d100 in front of it, it overwrites the originally d100 rules so all d100 rolls show up with the emoji instead of only doubles. But the 2d6 works now!
Sep 2, 2022 4:26 pm
How many d100s are they rolling at a time?
If it is one 1d100, try changing "total": to "natural": ....
If they are rolling a specific number you can use "1d100" or "2d100" instead of "d100" to only match when that many dice are rolled.
Sep 2, 2022 4:28 pm
It's only 1d100, just that doubles are critical so I wanted them to stand out. I'll try the "natural" type so see if that works!
Sep 2, 2022 4:31 pm
Then "natural" is the correct match rather than "total".

While you can technically total a single number, using "natural" fixed the 'all d100s match' problem for me.

You can also specify "rolled":"1d100" but that should not make a difference.
Sep 2, 2022 4:42 pm
Natural broke everything for me :(
Sep 2, 2022 5:35 pm
Indeed, "natural" does not seem to work with "reason".
Sep 2, 2022 5:39 pm
This looks like a bug.
{"rolled":"d100", "d100double":"true", "reason":"(##)", "total":">=##", "contentAppend":"❌", "highlight":"fail invert bold"}
Is triggering and appending content even when doubles were not rolled. Surely this should not an `or` condition? The order the clauses appear does not seem to change how it is interpreted.

Unless someone else can see what we are doing wrong we should report it as a bug.

(also "d100double":"false", does exactly the same thing as "d100double":"true", (or even "d100double":"",), so no way to ask for 'only when not doubles')
load next

You do not have permission to post in this thread.