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 Button problem

Hi everyone. I am trying to execute a macro from a Roll Button but I am getting the following errors: No character was found for 'character_name' SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "c" found. Here is my code: <button type='roll' value='&{template:default}{{name=@{character_name} makes a Strength Save}}             {{needing [[round(@{character_name|str}/5)+9]] or less}}{{and rolls [[3d6cs>7cf<0]]}}'></button> I have never used a Roll Button before, so this error confounds me...
1564393797
GiGs
Pro
Sheet Author
API Scripter
The problem is this part: @{character_name|str} just use @{str} character_name isnt a valid item for the left side of the |, and when calling attributes from a character sheet, its the same as when rolling Abilities: you dont need to use a character identifier - it's automatically supplied. Suggestion: give your button a unique name: name="roll_strength" , for instance. This lets people drag them to their macro tooolbar, or call them with %{selected|strength}. always start the name with roll_ , in the same way attributes start with attr_ .
GiGs said: The problem is this part: @{character_name|str} just use @{str} character_name isnt a valid item for the left side of the |, and when calling attributes from a character sheet, its the same as when rolling Abilities: you dont need to use a character identifier - it's automatically supplied. Suggestion: give your button a unique name: name="roll_strength" , for instance. This lets people drag them to their macro tooolbar, or call them with %{selected|strength}. always start the name with roll_ , in the same way attributes start with attr_ . Thanks for the assistance GiGs...I have added the "roll_" as suggested... I am having a problem however with the layout of the output to the chat window. Under normal circumstances executing the command as a macro, the output to the chat window would appear as three separate lines... Line 1: {{name=@{character_name} makes a Strength Save}} Line 2: {{needing [[round(@{character_name|str}/5)+9]] or less}} Line 3: {{and rolls [[3d6cs&gt;7cf&lt;0]]}} Which looks like this: Aden makes a Strength Save Needing&nbsp; 11 &nbsp;or less And rolls&nbsp;<span class="inlinerollresult showtip tipsy-n-right" original-title=" Rolling 3d6cs>7cf<0 = ( 4 + 5 + 2 )" style="box-sizing: content-box; background-color: rgb(254, 246, 142); border: 2px solid rgb(254, 246, 142); padding: 0px 3px; cursor: help; font-size: 1.1em;">11 But from the Roll Button it looks like this: Aden makes a Strength Save {{needing&nbsp; 11 &nbsp;or less}}{{and rolls&nbsp;<span class="inlinerollresult showtip tipsy-n-right" original-title=" Rolling 3d6cs>7cf<0 = ( 3 + 6 + 5 )" style="box-sizing: content-box; background-color: rgb(254, 246, 142); border: 2px solid rgb(254, 246, 142); padding: 0px 3px; font-weight: bold; cursor: help; font-size: 1.1em;">14 }} How can I keep the format the same as the first example, complete with the delineated bands for each separate line?
1564401347
GiGs
Pro
Sheet Author
API Scripter
It might be because of spaces and extra lines in your code. You dont need to have any gaps between the }} and {{, and you definitely shoul;dnt have extra lines. So try&nbsp; value='&amp;{template:default}{{name=@{character_name} makes a Strength Save}}{{needing [[round(@{str}/5)+9]] or less}}{{and rolls [[3d6cs&gt;7cf&lt;0]]}}' If that doesnt fix it, post your updated code for the button.