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

Roll Template - Comma separated list from values of 1 or 0

1436640796
Kryx
Pro
Sheet Author
API Scripter
I have a list of three things: {{spell_components_verbal=1}} {{spell_components_somatic=1}} {{spell_components_material=1}} I'm trying to make "V, S, M" or "V, S" or "V, M" or "S, M". There is no if statement to test if a value is 0, only if it is a 1. I feel like this is impossible within the current restrictions, but maybe someone else has an idea. {{#spell_components_verbal}}V{{/spell_components_verbal}} {{#spell_components_somatic}}{{#spell_components_verbal}}, {{/spell_components_verbal}}S{{/spell_components_somatic}} {{#spell_components_material}}{{#spell_components_verbal}}, {{/spell_components_verbal}}{{#spell_components_somatic}}, {{/spell_components_somatic}}M{{/spell_components_material}} Is what I'm currently using. Obviously all 3 comes out as "V, S, , M". Any ideas?
1436646034
Finderski
Plus
Sheet Author
Compendium Curator
Since the values are only 1 or not 1 why couldn't you use: The Wiki Said: You can also do {{^<property>}} followed by {{/<property>}} to mean the opposite -- that is, only show the section if the given property does not exist. Just a thought.
1436646765
Kryx
Pro
Sheet Author
API Scripter
G V. said: Since the values are only 1 or not 1 why couldn't you use: The Wiki Said: You can also do {{^<property>}} followed by {{/<property>}} to mean the opposite -- that is, only show the section if the given property does not exist. Holy shit... my life just became so much easier. I was unaware of this being around. How long has it been there!?!? Omg thank you so much!
1436647239
Finderski
Plus
Sheet Author
Compendium Curator
LOL - Glad I could help. It's been around as long as Roll Templates have been. I have never used it, but I remember it, because I thought "How would that ever be useful?" and now I know. :)
1436647521
Kryx
Pro
Sheet Author
API Scripter
G V. said: LOL - Glad I could help. It's been around as long as Roll Templates have been. I have never used it, but I remember it, because I thought "How would that ever be useful?" and now I know. :) I've wanted this functionality for so many months. It would've helped me many times now... Thank you so much!