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

Roll using an attribute chosen from a drop-down prompt

Hello, I'm trying to write a macro that would ask the player to choose an attribute from a drop-down prompt and then roll dices with number of dices = value of the attribute chosen of the selected token. So far i have : ?{Attribute|athletics|awareness|explore|song|craft|inspire} /em Roll of ?{Attribute} with level @{selected|?{Attribute}|0} /r @{selected|?{Attribute}|0}D6 and it's not working because the ?{Attribute} in the /em line and in the /r line is giving the attribute name (got from the drop-down prompt) and it's not giving the attribute value. I tried to get the attribute value of the selected valued but i'm not successfull. Do you have any clue of how to do that ? Thanks in advance Eric
1493380419

Edited 1493380520
Andrew C
Marketplace Creator
?{Attribute|Athletics, athletics|Awareness, awareness|... } /em rolls ?{Attribute} for @{selected|?{Attribute} } /r [[@{selected|?{Attribute} } ]]d6 That should fix it.
1493381276

Edited 1493381364
Roll Queries cannot be used to construct Attribute calls because Roll Queries have a lower precedence than Attribute calls on the Order of Operations . To work with the Order of Operations, you'll need to instead place your Attribute calls within a Roll Query. For example, @{selected|?{Q|A|B|C}} will not work, but ?{Q|A, @{selected|A}|B, @{selected|B}|C, @{selected|C}} will work.
Thank you both.  @Andrew : it didn't work (reason is given by Silvyre) @Silvyre : it worked fine My macro now : /r ?{Attribute|Battle, @{selected|battle}|Craft, @{selected|craft}|Athletics, @{selected|athletics}|Song, @{selected|song}}D6 :-)