Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Can if statements be added to a sheet?

So for example: If X = 0 than value = A else value = B Can something like that be done.
1460910502
Kryx
Pro
Sheet Author
API Scripter
Not directly, no. You should do it in sheetworkers now that we have those.
1460923177
Ada L.
Marketplace Creator
Sheet Author
API Scripter
If you're meaning to display certain parts of the sheet using an if statement-like mechanism, you can do some CSS wizardry with hidden radio inputs.  e.g. : HTML <!-- Display this section if the ifBranch1 attribute === 'value1'. --> <input type='radio' class='hidden-flag' name='attr_ifBranch1' value='value1'> <div class='flag-show'> ... </div> <!-- Display this section if the ifBranch1 attribute === 'value2'. --> <input type='radio' class='hidden-flag' name='attr_ifBranch1' value='value2'> <div class='flag-show'> ... </div> <!-- Display this section if the ifBranch1 attribute === 'value3'. --> <input type='radio' class='hidden-flag' name='attr_ifBranch1' value='value3'> <div class='flag-show'> ... </div> CSS .charsheet .sheet-hidden-flag { display: none; } .charsheet .sheet-hidden-flag:not(:checked) + .sheet-flag-show { display: none; } You might need to set the values of the radio inputs in your sheet workers based on other attributes on the sheet.
Kryx said: Not directly, no. You should do it in sheetworkers now that we have those. I'm not familiar with that. Stephen L. said: If you're meaning to display certain parts of the sheet using an if statement-like mechanism, you can do some CSS wizardry with hidden radio inputs.  e.g. : HTML <!-- Display this section if the ifBranch1 attribute === 'value1'. --> <input type='radio' class='hidden-flag' name='attr_ifBranch1' value='value1'> <div class='flag-show'> ... </div> <!-- Display this section if the ifBranch1 attribute === 'value2'. --> <input type='radio' class='hidden-flag' name='attr_ifBranch1' value='value2'> <div class='flag-show'> ... </div> <!-- Display this section if the ifBranch1 attribute === 'value3'. --> <input type='radio' class='hidden-flag' name='attr_ifBranch1' value='value3'> <div class='flag-show'> ... </div> CSS .charsheet .sheet-hidden-flag { display: none; } .charsheet .sheet-hidden-flag:not(:checked) + .sheet-flag-show { display: none; } You might need to set the values of the radio inputs in your sheet workers based on other attributes on the sheet. I don't think that's it. In the game, each class has one specific skill that is used in the calculation of a type of defense, it's kinda like this. Class 1 uses attribute A, thus adds to Defense A Class 2 uses attribute B, thus adds to Defense B Class 3 can use either attribute A or B, and depending on which attribute is used it could either contribute to Defense A or B
1460925798
Kryx
Pro
Sheet Author
API Scripter
It sounds like you'll need to use  Sheet Workers then.
Kryx said: It sounds like you'll need to use  Sheet Workers then. oh joy... more learning