Using a lot of checkboxes to derive a stat

I’m trying to automate the die roll bonus (aka Power) in a City of Mist sheet by making it so that for each checkbox checked, it would add an appropriate bonus or penalty to a single stat and for some reason, it would not work after the first checkbox.

Let me elaborate on that. Let’s say my code goes like this but way longer and with way more checkboxes:

{checkbox1 ? 1:0} + {checkbox2 ? 1:0} - {checkbox3 ? 1:0} - {checkbox4 ? 1:0}

I try to use that expression(s) as a stat’s value and it would not register any other +1’s or -1’s after the first checkbox. I checked it multiple ways. I then truncated it to the first 4 checkboxes and even to multiple stats and then troubleshooting from there to see if the length was the issue, it was not the case. I put the entire expression in only one curly brace. I tried it out on an action with a roll function with the same exact long code and IT WORKED FINE. Due to the fact that the code being added to the die roll worked out, I tried to add a 0 + at the beginning of the code and nothing changed.

Is there something I’m missing?

Just to make it clear, I’m doing this so players can modify the stat after the automated bonuses and penalties are calculated so I cannot just use the roll action solution.

Hi @eigentlichkeit

The only reason I can see for it not working is the braces { }. Rather use parenthesis ( ) inside a Stat.

If you only want to add or subtract 1 for each checked checkbox you don’t even need to do a test. You can use the following:

checkbox1 + checkbox2 - checkbox3 - checkbox4

Thank you very much! It’s working out fine now

1 Like

// Closing as resolved