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 .
×
D&D 2024 has arrived! Pre-Order the new core rulebooks now.
Create a free account

Macro: Return Name and Value to another Macro

So I have one macro that calls other macros. This one calls AskSkill which asks for an skill and returns the rating of that skill to roll the dice: @{selected|character_name}  [[{1d#AskAttribute + 1d#AskSkill + 1d?{Specialization|0} +1d?{Distinction|0} +1d?{Signature Asset|0} + 1d?{Asset|0}+ 1d?{Complication|0}}kh2]] AskSkill looks like this: ?{Skill| Craft,@{selected|Craft} | Drive,@{selected|Drive} |  Fight,@{selected|Fight} |  Fly,@{selected|Fly} |  Focus,@{selected|Focus} |  Influence,@{selected|Influence} |  Investigate,@{selected|Investigate} |  Know,@{selected|Know} |  Labor,@{selected|Labor} |  Move,@{selected|Move} |  Notice,@{selected|Notice} |  Operate,@{selected|Operate} |  Perform,@{selected|Perform} |  Resources,@{selected|Resources} |  Shoot,@{selected|Shoot} |  Sneak,@{selected|Sneak} |  Survive,@{selected|Survive} |  Treat,@{selected|Treat} |  Trick,D8,@{selected|Trick} | } Is there someway I can get the NAME of the skill they selected as well as the value for that skill? So that I can do a chat message like: "Token, Fight: 11"  rather than just "Token: 11"?
1567781188
The Aaron
Roll20 Production Team
API Scripter
Not really without the API. You could structure the information in your Query with each row like this: Know, [Know](@{selected|Know} Then where you use it as text, you'll get "[Know](3)" (assuming the attribute contains 3) and where you use it in a roll, the text becomes a label. YMMV. 
1567781393
GiGs
Pro
Sheet Author
API Scripter
Not without using the API, unfortunately. And that would take a custom script.
Thanks, Aaron! You got me 80% of the way there and that's good enough. The answer for anyone interested: Change the AskSkill macro to include the Skill name as Aaron pointed out: Craft,@{selected|Craft} [Craft] | The skill name will then show up in the roll. It's buried in there a bit, but it's there.&nbsp; Then I stumbled on to this tidbit - If a macro calls another macro multiple times, Roll20 doesn't actually call it multiple times. It only calls it once and uses the same result for the other rolls. So I can do a macro like this: #DicePool /em @{selected|character_Name} #AskSkill : [[ { #DicePool }}kh2 ]]&nbsp; The DicePool macro is calling the AskSkill macro which asks the user which skill to use. Since the AskSkill macro is then called again, you might think Roll20 would ask them for the skill again, but it doesn't. It just uses whatever they picked the first time. Same with the DicePool macro being called twice - it's only actually executed once. So that gets you output like: Paladintodd (GM) Jasmine Chrium 6 [Craft] :&nbsp; <span class="inlinerollresult showtip tipsy-n-right fullcrit" original-title=" Rolling { 1d6 + 1d6 [Craft] + 1d0 +1d0 +1d0 + 1d0+ 1d0 }}kh2 = {( 2 )+( 4 )+( 0 )+( 0 )+( 0 )+( 0 )+( 0 )}" style="box-sizing: content-box; background-color: rgb(254, 246, 142); border: 2px solid rgb(63, 179, 21); padding: 0px 3px; font-weight: 700; cursor: help; font-size: 1.1em; color: rgb(101, 62, 16); font-family: &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-style: italic; text-align: center;">6 And that's good enough for me.&nbsp;
1567877120
The Aaron
Roll20 Production Team
API Scripter
Cool beans. =D