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: How to Store an Attribute and Label from an Inline Dropdown Macro Query?

I'm trying to create a macro with a drop-down menu for players to select which attribute (in the WoD style) they want to include in an ability/skill roll. The attribute name and ability name should display when the sheet button is pushed, such as "Intelllitence + Alchemy"), then it should pull the appropriate attribute from the sheet and make the roll. At present, I can do so with the following: <button type='roll' value='&{template:default} {{name=?{Attribute|Strength, @{Strength}|Dexterity, @{Dexterity}|Stamina, @{Stamina}|Presence, @{Presence}|Manipulation, @{Manipulation}|Composure, @{Composure}|Intelligence, @{Intelligence}|Perception, @{Perception}|Resolve, @{Resolve}} + Alchemy}} {{Roll=[[(@{alchemy} + ?{Attribute} + ?{Bonus Dice|0} )d10>?{Difficulty|6} ]]}}' name='roll_Alchemy'></button> However, this displays the value of the attribute in the label, not the name, such as "4 + Alchemy," instead of "Intelligence + Alchemy." I can make the label display using the code below, but I cannot then pull the attribute, as the only value stored is the name, and the number is lost. (See below.) <button type='roll' value='&{template:default} {{name=?{Attribute|Strength|Dexterity|Stamina|Presence|Manipulation|Composure|Intelligence|Perception|Resolve} + Alchemy}} {{Roll=[[(@{alchemy} + @{( ?{Attribute} )} + ?{Bonus Dice|0} )d10>?{Difficulty|6} ]]}}' name='roll_Alchemy'></button> So, is there a way with only one macro query to store both the name and the value of an attribute, selected from an inline dropdown query by the player when they push the roll button? If anyone can help me with this, I'd be really grateful. Thanks!
1530547610

Edited 1530547676
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Nope, you could do something like: ?{Attribute|Strength, @{Strength}[Strength]|Dexterity, @{Dexterity}[Strength]|Stamina, @{Stamina}[Strength]} But, that's still not quite what you want. EDIT: Also, as a note, this won't work: @{( ?{Attribute} )} due to the order of operations
1530551255
GiGs
Pro
Sheet Author
API Scripter
It looks like this is a custom character sheet? You could have two dropdowns on the sheet to pick stat and skill, which set hidden attribute values, then the roll button uses those two stats and reads the selected values from the sheet. It's not as convenient, but if they are expected to pick values from dropdowns anyway, it is the same number of clicks, they just click the roll button at the end instead of the start.
I appreciate the feedback! For those asking, yes, this is a custom character sheet. I've tried the "inline label" solution, above, but it broke the code. Here's what I've got, though! The following code works , but it doesn't store the name of the attribute, so I can't display which attribute is being rolled. It only stores the value of that attribute, so I can't display it. When I try including the inline labels,  The working code: <button type='roll' value='&{tempalate:default} {{name=@{character}: ?{Attribute|Strength, @{Strength}|Dexterity, @{Dexterity}|Stamina, @{Stamina}|Presence, @{Presence}|Manipulation, @{Manipulation}|Composure, @{Composure}|Intelligence, @{Intelligence}|Perception, @{Perception}|Resolve, @{Resolve}} + @{Power1}[@{NamePower1}]}} {{Roll=[[(@{Power1} + ?{Attribute} + ?{Bonus Dice|0} )d10>?{Difficulty|6}  ]]}}' name='roll_Power1'></button> If I change the following part, then it can no longer execute the roll. {{name=@{character}: ?{Attribute|Strength, @{Strength}[Strength]|Dexterity, @{Dexterity}[Dexterity]|Stamina, @{Stamina}[Stamina]|<etc.> }} + @{Power1}[@{NamePower1}]}} So, it seems what I still need is one of two things: A way to allow the player to select the attribute with a single pulldown and, as a result, store both the name of the attribute and the value of that attribute, from the sheet, as separate variables. A way to store just the name of the attribute that will also allow me to pull the value of the attribute the user selects. Any ideas on that one? I really appreciate any thoughts you all might have!
1530619568

Edited 1530637161
OK, so in your drop down, have the option labels be the names of the attributes - you know what they are so you can just type those into your query.  Then have the output of each query option be both text you supply (again you know what the attribute is, because its the one that matches the query choice) and an inline roll that uses the attributes.  You can have the output be a class for your power card output for nice formatting, although you might need to do some ascii character substitutions as stuff inside a query gets certain characters parsed out.
1530630252

Edited 1530637168
Dave
Pro
Aranador said: OK, so in your drop down, have the option labels be the names of the attributes - you know what they are so you can just type those into your query.  Then have the output of each query option be both text you supply (again you know what the attribute is, because its the one that matches the query choice) and an inline roll that uses the attributes.  You can have the output be a class for your power card output for nice formatting, although you might need to do some ascii character substitutions as stuff inside a query gets certain characters parsed out. Thanks for the reply! That sounds really promising, though unfortunately I don't understand much of it. What's a class for a power card, and how would ASCII substitutions help?