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 Commands / Variable Names

Hi All, Sorry in advance if I'm overlooking something simple here, but I'll be darned if I can locate the data.  There are a lot of lovely macros floating around the forums and I've used a lot and written some of my own.  I've doped out how to write macros mostly by dissecting examples.  Some times I can't figure out what's going on in some of them.  My question is:  Where can I find a list of ALL the commands that may be used in a macro (i.e. %, @, &, /em /roll) and how do I figure out what variable names are on character sheets (i.e. %{selected|repeating_npcaction_$0_npc_action}  ) ? That's a lovely little macro, but how the heck do I figure out that that first attack option is actually called 'repeating_npcaction_$0_npc_action when I'm looking at the character sheet? I've looked over the macro data in the wiki as closely as I could and can't seem to locate anything that would tell me what the % sign is used for in the above macro, nor how to find the variable name.  Any help in pointing me to the correct documentation would be greatly appreciated! Thanks! Nim
1455380778

Edited 1455381325
Lithl
Pro
Sheet Author
API Scripter
% indicates an ability (from the Attributes & Abilities tab of a character sheet, or from a roll button on the Character Sheet tab). @ indicates an attribute (from the Attributes & Abilities tab, or from a form field on the Character Sheet tab). # indicates a macro (from the Settings tab of the right sidebar). Attributes and abilities both use the same syntax: @{ name }, @{ character name | name }, @{selected| name }, @{target| name }, or @{target| target label | name }. (Obviously replacing @ for % when using abilities instead of attributes.) Attributes can also add "|max" to the end (eg, @{ name |max}) to access the max value of the attribute instead of the current value, although if you want max on a targeted attribute, you have to use the full form (@{target| target label | name |max}, not @{target| name |max}). Macros are simply # name &nbsp;and you need to have a space afterward. There are several ways to learn the name of an attribute or ability. If it's one you've created yourself, obviously use the name you gave it. All attributes from the character sheet which are not in repeating sections and which have had a value set for them will have an entry in the Attributes & Abilities tab, as well. Some character sheets have documentation about names (check the wiki for your sheet), some will tell you a field's name when you hover over it with your mouse, and some have documentation on the character sheet selection page of your campaign settings. If all else fails, you can right-click on the value you're trying to use from the sheet and inspect it to see the HTML. The form field will have an attribute like name="attr_npc_action" , and the bit after "attr_" is the name. In repeating sections, you also need to specify the name of the section (found in the HTML as either div data-groupname="repeating_npcaction" &nbsp;or fieldset class="repeating_npcaction" ), as well as either the row id (discoverable by dragging a rollable button to your macro bar) or a row index (eg, $0). Chat commands include: /em or /me : send an emote as the character or player currently selected in the "As" dropdown /w name : send a whisper to the named player or character speaking as the currently selected player or character. If name has a space, you need to enclose it in quotes, but you can also just use partial names. If you whisper to a character, everyone with control over that character will receive the message. name &nbsp;can also be "gm" to send the message to everyone with GM privileges. /o : send a message as yourself, regardless of your current selection in the "As" dropdown /as name : send a message as the named character. GM use only. No character avatar will be used, even if the name matches an actual character. /emas name &nbsp;send an emote as the named character. GM use only. No character avatar will be used /desc : send a description, not something from any character. GM use only. /direct : send raw HTML to chat. API only You can also use a subset of Markdown formatting in your messages: *italics* -&gt; italics **bold** -&gt; bold [google]( <a href="http://google.com" rel="nofollow">http://google.com</a> ) -&gt;&nbsp; google If the URL ends in .png, .gif, .jpg, or .jpeg, the image will be displayed in chat instead of just a link.
1455385232

Edited 1455385397
Silvyre
Forum Champion
Character Sheets should have their own Roll20 Wiki page, which should document the names of their Attributes and Abilities , especially those that are repeating. More generic documentation on macro components can be found elsewhere on the Roll20 Wiki: <a href="https://wiki.roll20.net/Character_Sheets#Advanced_" rel="nofollow">https://wiki.roll20.net/Character_Sheets#Advanced_</a>... <a href="https://wiki.roll20.net/Macros#Attribute_Macros" rel="nofollow">https://wiki.roll20.net/Macros#Attribute_Macros</a> <a href="https://wiki.roll20.net/Macros#Nesting_Abilities" rel="nofollow">https://wiki.roll20.net/Macros#Nesting_Abilities</a> <a href="https://wiki.roll20.net/Dice_Reference" rel="nofollow">https://wiki.roll20.net/Dice_Reference</a> <a href="https://wiki.roll20.net/Text_Chat#Chat_Commands" rel="nofollow">https://wiki.roll20.net/Text_Chat#Chat_Commands</a> <a href="https://wiki.roll20.net/Text_Chat#Basic_Formatting" rel="nofollow">https://wiki.roll20.net/Text_Chat#Basic_Formatting</a>
Thank you, Brian and Silvyre! &nbsp;Two very helpful posts. &nbsp;:)