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 .
×

Condition in template

Hello everyone ! I need some help to my custom Vampire system template. &{template:wod5} {{nb_dice=[[?modifier|0]]}} {{test1=[[1d10]]}} {{test2=[[1d10]]}} {{test3=[[1d10]]}} {{test4=[[1d10]]}} {{test5=[[1d10]]}} Is it possible to make something like this : if nb_dice=3  >> activate only {{test1}} {{test2}} {{test3}} Because with my current template, all dice are rolled regardless nb_dice.  Thanks for your attention.
1593379912
GiGs
Pro
Sheet Author
API Scripter
No, its not possible to do that with a macro.  Since you're a Pro user, it is possible to do it with an API script, but its complex. Look up the Power cards API, which has very arcane syntax but it can do it.
1593402532
Finderski
Pro
Sheet Author
Compendium Curator
Actually, it depends on what you mean...are you coding the roll template now? Because if you are developing it, then there are some options.  If you mean, if nb_dice = 3 then only show the results from test1, test2, and test3, then you absolutely can do that. tests 4 & 5 would still happen, they just wouldn't be shown. It can be a bit complex to implement, but you'd be looking at things like: <div> {{#rollTotal() nb_dice 1}} {{test1}} {{/rollTotal() nb_dice 1}} {{#rollTotal() nb_dice 2}} {{test1}}     {{test2}} {{/rollTotal() nb_dice 2}} {{#rollTotal() nb_dice 3}} {{test1}} {{test2}} {{test3}} {{/rollTotal() nb_dice 3}} {{#rollTotal() nb_dice 4}} {{test1}} {{test2}} {{test3}} {{test4}} {{/rollTotal() numrolls 4}} {{#rollTotal() numrolls 5}} {{test1}} {{test2}} {{test3}} {{test4}} {{test5}} {{/rollTotal() numrolls 5}} </div> You may also need to modify nb_dice to be {{nb_dice=[[0d6+?modifier|0]]}} That way it's an actual roll. Doing this, like I said, means the unused tests will still roll, but they'll be invisible as if they didn't roll. The only oddity is with 3d dice...they may still see all the dice rolling around, but...I don't know, I personally can't stand 3d dice. :)
Thanks for reply ! I've already made some tricks like yours in my template, so i ask this just in case . ;) I want to doing this without API script. Have fun !   o/
1593437962
GiGs
Pro
Sheet Author
API Scripter
I missed that this was for the design of a rolltemplate, not merely its use.  Oops.
1593441042
Finderski
Pro
Sheet Author
Compendium Curator
GiGs said: I missed that this was for the design of a rolltemplate, not merely its use.  Oops. It happens...usually to me. LOL :)