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

HElp re RollTemplate

I have a roll button theat sends the following  &{template:savingThrow} {{name=@{character_name}}} {{reason=Wit AST}} {{target=[[@{witST}]]}} {{roll1=[[1d20+?{Modifier?|0}[Mod]]]}} which is picked up by the following roll template: <rolltemplate class="sheet-rolltemplate-savingThrow"> <div class="sheet-container">         <div class=sheet-hdr>{{name}}</div>         <div class=sheet-content>             <div class="sheet-subHdr">{{reason}}</div> {{#rollLess() roll1 2}} <div>{{roll1}}</div> <div>Critical Success</div> {{/rollLess() roll1 2}}                 {{#^rollLess() roll1 2}}                     {{#rollGreater() roll1 19}}                         <div>{{roll1}}</div>                         <div>Critical Failure</div>                     {{/rollGreater() roll1 19}}                     {{#^rollGreater() roll1 19}}                      <div>{{roll1}} vs {{target}}</div> <!-- here to help work out whats going on-->                                                  {{#rollGreater roll1 target}}                         <div>{{roll1}} Failed!</div>                         {{/rollGreater roll1 target}}                         {{#^rollGreater roll1 target}}                         <div>{{roll1}} Success</div>                         {{/^rollGreater roll1 target}}                                          {{/^rollGreater() roll1 19}} {{/^rollLess() roll1 2}} </div>         </div>     </div> </rolltemplate> The template should return Critical success if roll1 is <=1 and a critical falure if roll1 >=20.  This it does. :-) What i can't get it to do is pick up the success if  >1 and <= target  or Failure if roll 1 > target and <20 no matter how I try to write target  in the template {{target}} {target} [target] [[target]] and target, is is just ignored. II have also tried {{target=[[@{witST]]}} and {{target=@{witST}}} in the call. Can anyone give some advice as to what I am doing wrong. Many Thanks
1701743208
GiGs
Pro
Sheet Author
API Scripter
A quick note: II have also tried {{target=[[@{witST]]}} and {{target=@{witST}}} in the call. The second of these can never work. The logic helpers in Rolltemplates only work with numbers in inline rolls, so you'd need to use [[@{witST]] On to your question: it looks like you're making a mistake I often make.You're missing the parenthesis on several branches. This: {{#rollGreater roll1 target}} should be {{#rollGreater () roll1 target}} Check you have those parentheses after every logic helper.
GiGs many thanks - it was the missing parentheses. You have no idea how long i was looking at that, and didn't spot it Once again Many thanks
1701792309

Edited 1701792374
GiGs
Pro
Sheet Author
API Scripter
Martin said: You have no idea how long i was looking at that, and didn't spot it Once again Many thanks You're welcome, and i might have an idea, because I've done that myself :)