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

Variable use in Macros

So i want to make a macro which should do this: /roll [@Attribute A + @Attribute B]d10 But somehow i cant make him accept those variables. Its probably a very basic mistake but im not able to make it work so thx in advance =)
1451854037

Edited 1451854147
vÍnce
Pro
Sheet Author
Michael S. said: So i want to make a macro which should do this: /roll [@Attribute A + @Attribute B]d10 But somehow i cant make him accept those variables. Its probably a very basic mistake but im not able to make it work so thx in advance =) Try dropping the /roll and make it an inline roll like: [[(@Attribute A + @Attribute B)d10]]
Vince said: Michael S. said: So i want to make a macro which should do this: /roll [@Attribute A + @Attribute B]d10 But somehow i cant make him accept those variables. Its probably a very basic mistake but im not able to make it work so thx in advance =) Try dropping the /roll and make it an inline roll like: [[(@Attribute A + @Attribute B)d10]] i tried that now and then i get this error: SyntaxError: Expected "(", ".", "[", "abs(", "ceil(", "d", "floor(", "round(", "t", "{", [ |\t], [+|\-] or [0-9] but "@" found.
1451855466

Edited 1451856062
When creating a grouped roll, use parentheses instead of square brackets. Pairs of (singular) square brackets are syntactically reserved for inline labels within rolls. (As Vince posted above, pairs of doubled square brackets create inline rolls.) Also, be careful to format your Attribute calls by including the necessary curly braces . (i.e. @ { Attribute A } will call the Attribute named "Attribute A", but @Attribute A will not.) Also note that since Attributes are tied to Characters, the Attribute call @{Attribute} will only function when used within the Character Window of a Character containing that Attribute (e.g. when placed within an Ability, or within an input field of a Character Sheet). If you wish to use the aforementioned Attribute call outside of that Character Window (e.g. within a macro on the My Settings tab of the Sidebar, or input directly into the text chat), you'll have to include an identifying keyword within that Attribute call (e.g. @{selected|Attribute} or @{target|Attribute} or @{Character Name|Attribute}).
ahhh thanks a bunch, now its working. =) A little follow up question: Is there a way to summon some kind of popup window when starting a macro in which you can generate an additional variable? (like for varying difficultys or such)
Michael S. said: Is there a way to summon some kind of popup window when starting a macro in which you can generate an additional variable? (like for varying difficultys or such) Sure; check out Roll Queries .
Ah perfekt. Thanks again =)
1451872650
vÍnce
Pro
Sheet Author
Silvyre said: When creating a grouped roll, use parentheses instead of square brackets. Pairs of (singular) square brackets are syntactically reserved for inline labels within rolls. (As Vince posted above, pairs of doubled square brackets create inline rolls.) Also, be careful to format your Attribute calls by including the necessary curly braces . (i.e. @ { Attribute A } will call the Attribute named "Attribute A", but @Attribute A will not.) Also note that since Attributes are tied to Characters, the Attribute call @{Attribute} will only function when used within the Character Window of a Character containing that Attribute (e.g. when placed within an Ability, or within an input field of a Character Sheet). If you wish to use the aforementioned Attribute call outside of that Character Window (e.g. within a macro on the My Settings tab of the Sidebar, or input directly into the text chat), you'll have to include an identifying keyword within that Attribute call (e.g. @{selected|Attribute} or @{target|Attribute} or @{Character Name|Attribute}). Yea, that's what I meant to say.  ;-)