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 Names for NPC Sheet - Global Macro

Hi I saw a video from a few years ago about creating a "Global" macro that launches a generic command (e.g. Attack1, Initiative, Dex Save etc), but the variables used in his macros don't work on the sheet version I've chosen. Where can I find the variable names that I can insert into his macro code? Example: The video has this for the attack, but when i run it NPCAction1 isn't found. Action:Weapon %{Selected|NPCAction1} I would have thought there was a matrix that shows the variable names for all character sheets somewhere. I created the character by clicking Add Character and then selecting Create NPC. In the game settings I chose to use the D&D 5E by Roll20 sheet.  Would be very grateful for any advice Thanks
1594935958

Edited 1594940034
David M.
Pro
API Scripter
The general term for what NPCAction1 is in your example is a character "attribute", so you'll need to go to your sheet to find all of the available attributes for that sheet.  Edit. Sorry, wasn't paying close enough attention to the original post. The NPCAction1 is an ability macro call, not an attribute. The below is still valid.  On the D&D by Roll20 sheet, there is a tab named "Attributes & Abilities". Go to that tab, and the left column lists all of the attributes by name, along with the current value of each of those attributes. The right column, "Abilities" is one location where you can add "macros" for that specific character. There are advantages & disadvantages of abilities vs global macros (found in the Collections tab of the chat window), but that is out of the scope of this discussion. You can reference the character attributes from a Collections macro using the syntax @{selected|AttributeName}, @{target|AttributeName}, or @{CharacterName|AttributeName}. Note if you use character name and that name includes spaces, you can either use just the first name or wrap the name in double quotes. If you want to reference the attribute from an character sheet Ability [macro] that you create, it is referenced with the syntax @{AttributeName}. The relevant character designator is unnecessary, since the Ability is already tied to the character. Finally, you can add your own attributes if you find a need, simply by clicking the +Add button in that region of the sheet. This will be specific to that one character, so if you want it on another, you will have to add it there as well.