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

Macros Using Attributes from the Journal Won't Work

We are not using character sheets, but when I access my character through the Journal and add attribute, say Dexterity for example. Attribute name is Dex I set a value, 2. Then I use the macro /roll 1d20 + {target|Dex} So I should be able to click the macro, then click the token to take the action, it then rolls and d20 and adds whatever value the Dex attribute is set to, however, it instead rolls a d20 and says " No attribute was found for targeted token by the name of Dex"
1532202938
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The syntax for calling attributes is @{...}. The other thing to check is that your token is actually set to represent your character (your gm will need to check this)
1532241063
GiGs
Pro
Sheet Author
API Scripter
In this case, the macro is using target so it doesnt matter if the token is linked to the character sheet. It does look like your error is using /roll 1d20 + {target|Dex} when it should be /roll 1d20 + @{target|Dex} By the way, since you are using the Attributes tab, you can store macros like this in Abilities, and you can just use the attribute name directly, like so: /roll 1d20 + @{Dex} It's better if you are just having to create macros for one character. You can also select the token first, and use  /roll 1d20 + @{selected|Dex}
1532242232

Edited 1532242363
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Actually, since target is being used, the token has to be connected to a character sheet (unless you're referencing token_name or one of the bar values), otherwise there are no attributes to find, and you would get an error similar to what was reported. The odd part of this is that {target|attribute names} shouldn't do anything. It's not valid syntax to trigger an attribute or ability search, and with the bar in there, it's not valid grouping syntax. I would have expected something more along the lines of "number expected, but t found".
1532246427
GiGs
Pro
Sheet Author
API Scripter
Scott C. said: Actually, since target is being used, the token has to be connected to a character sheet (unless you're referencing token_name or one of the bar values), otherwise there are no attributes to find, and you would get an error similar to what was reported. Oh yes, that's true :)
it's because he's forcing it to roll the Attribute via /roll instead of the popular [[Inline Rolling]] which most of us use; it has it's own Logic Patterns, & it's own potential errors as a result. They are correct, you need the @ (at) symbol, & yes the GM MUST Link it to your Character Sheet in order for it to find that attribute you set, this can be preformed by either the Creator, or an appointed GM, whomever it is, they must be in GM mode (Rejoin as GM in the top Settings Page, if they are already GM, it reads "Rejoin as Player"). They need to do the following: Select the Token Open the Token's Settings Link it to your Character Sheet Then, to save effort in the future, once it's all properly set up for play in it's neutral position the condition you want it to be linked to whenever you drop it note: Variable Attributes such as HP needs to be linked to some Attribute on the Character Sheet to be tracked across multiple Maps Correct Token Size Open the Sheet it was just linked to Hit Edit in the Top Right (with the Token still selected) if there is already a Default Token Set, he can simply Remove the previous one by clicking in the Picture's Top Right set the Selected Token as the Default Token Hit Save Changes it should now retain those exact settings wherever you take that character, so long as it is dropped from that specific Sheet, until changed. it's much easier to do than it is to say or read. It's actually more difficult if you have the Advanced Fog of War (Pro & Plus feature) unlocked because that's an entire half a menu on it's own! (Line of Sight & Light Radius stuff, it's really good stuff, very worth it) If you have the Call placed on the Sheet somewhere, you don't need to tell it to designate a Target, the majority of uses for the @{target| prefix is for multiple Targets for things such as spells. For example; here's the Magic Missile Spell I'm looking to get help with: Show as Token Action: /ooc &{template:default} {{name=@{selected|character_name} Casts Magic Missile}} {{Per Dart=[[1d4+1]] Force Damage}} {{Level=?{Cast at what level?|Level 1,1|Level 2,2|Level 3,3|Level 4,4|Level 5,5|Level 6,6|Level 7,7|Level 8,8|Level 9,9} Spell Slot}} {{1st Dart=@{target|1|character_name}}} {{2nd Dart=@{target|2|character_name}}} {{3rd Dart=@{target|3|character_name}}} {{4th Dart=@{target|4|character_name}}} {{5th Dart=@{target|5|character_name}}} {{6th Dart=@{target|6|character_name}}} {{7th Dart=@{target|7|character_name}}} {{8th Dart=@{target|8|character_name}}} {{9th Dart=@{target|9|character_name}}} {{10th Dart=@{target|10|character_name}}} {{11th Dart=@{target|11|character_name}}} works like a charm, but it's current problem is that it is always asking for targets for the Level 9 Slot, even at a Level 1 Slot.