Syntax Help

Ok I haven never used conditionals before so I am obviously using it incorrectly, since I keep getting an error result.

Hun1 ? {-1} : {Hun2 ? {-1} : {Hun3 ? {0} : {Hun4 ? {0} : {Hun5 ? {+1} : {Hun6 ? {+1}}}}}}

Basically I have 6 check boxes and the above formula goes into a stat, which I am trying to get a +1, 0 or -1 result in the stat box depending on which box they tick.

The basic idea is that you have several conditions Hunger, thirst and fatigue, each with 6 tick boxes and lets assume they were all ticked at level 5 the overall result would be +1 in each of 3 separate stats or +3 in a single stat but i am not sure if i need to use three stats and then add them in a final 4th stat or can do the calculation all in one go?

Also is it possible to have a group of tick boxes that a linked so that only one of them can by ticked at any one time, so if you tick one box it removes the tick from any of the other boxes in the group?

Hi @Renegade

Don’t use braces unless this is in an Action. Even then, only use { and } on the outside of the test.
You can use ( and ) to separate your sections.

As for your last question, not yet. There is a Feature Request for a Radio Button style checkbox though.

Ok thanks, I have replaced the braces with standard brackets but it still comes up with an error?

Hun1 ? (-1) : (Hun2 ? (-1) : (Hun3 ? (-1) : (Hun4 ? (-1) : (Hun5 ? (+1) : (Hun6 ? (+1))))))

Is there a more in depth manual on this language? I have read the few pages that I could find that mainly deal with dice rolls but that didn’t cover everything.

Hello Renegade,

I’m actually building sheets for Alien RPG game.
Maybe it could help.

help1

Each checked boxes has a different name (Stress,Stress2,Stress3 etc.)

Here is the code for calculate the number “4” in my example.

0 + (Stress ? 1 : 0) + (Stress2 ? 1 : 0) + (Stress3 ? 1 : 0) + (Stress4 ? 1 : 0) + (Stress5 ? 1 : 0) + (Stress6 ? 1 : 0) + (Stress7 ? 1 : 0) + (Stress8 ? 1 : 0) + (Stress9 ? 1 : 0) + (Stress10 ? 1 : 0)

I assigned a name to my variable : DStress

Then I can calculate this variable with many others variables.

Example:
!({DStress}d6cs=cf)
!({DStress+Heal+AtFuEm}d6=6)

Try this :

0 + (Hun1 ? -1 : 0) + (Hun2 ? -1 : 0) + (Hun3 ? -1 : 0) + (Hun4 ? -1 : 0) + (Hun5 ? 1 : 0) + (Hun6 ? 1 : 0)

Thanks your suggestion worked fine :slight_smile:

You can simplify that by just doing: 0 - Hun1 - Hun2 - Hun3 - Hun4 - Hun5 - Hun6

1 Like