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

macro that rolls another macro and adds a fixed value.

I want to write a macro that rolls another macro and adds a fixed value. Example: /me is spotting with a bonus of 2 @{Charname|spotcheck} + 2 I just can't get it to work... thanks for the help!!
1486003424

Edited 1486003465
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Have you looked at the  wiki's entry on nested macros? Also, currently that macro is calling an attribute. Did you save your spotcheck as an attribute (left hand side of the attributes and abilities tab), an ability (right side), or as a global macro (under the collections tab in the right menu pane where the chat is)? Attributes are accessed by @{keyword|AttrName} Abilities are accessed by %{keyword|AbilityName} (note the keyword is always required for abilities, whether you use a character's name, selected, or target) Global macros are access by #MacroName Also, for the chat to do the math you need to mark it as a roll by either putting /r (or /gmroll if it's going to be whispered to the gm) or wrapping your expression in inline roll brackets ([[ ]]).
yes, i looked that up. @{char|spotcheck} runs the spotcheck macro just fine and returns the correct value.....d20+x @{char|spotcheck}+2 ignores the +2 and just runs the @{char|spotcheck}....d20+x if i enter [[@{char|spotcheck}+2]] nothing happens...the entry disapears..same goes for the % instead of @
1486060080
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
What does the output of @{spotcheck} look like? it sounds like there's something in there that is preventing the +2.
the output is using a template....now that I write this....how should he add +2 to a template..... thanks alot
I now wrote a completely new macro &{template:DnD35StdRoll} {{skillflag=true}} {{name=@{charname|character_name}}} {{check=[Spot](dandwiki.com/wiki/SRD:Spot_Skill ) check:}} {{checkroll=[[1d20 + [[@{charname|spot}]] +2 ]] }} working like a charm thanks!
1486070608
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Glad you figured it out. Best practice wise, attributes should really only be values, and the abilities would have the formatting and slash commands.