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
This post has been closed. You can still view previous posts, but you can't post any new replies.

Using Variable within a Macro [Help]

Hi. I am trying to write a Macro for Yggdrasill rpg. The basic test rules are: To make a test, a player rolls a number of d10 equal to his Characteristic. He then picks his two best results, adds them together along with a Skill and compares them to a target number (typically 14). If a 10 is rolled, the player may roll the dice again and add that to the total along with the 10. I have read through the Macro Help Wiki and so far have the following: ?{Attribute|Strength,**Strength** [[@{selected|Strength}d10!!kh2 ]]|Vigour,**Vigour** [[@{selected|Vigour}d10!!kh2]]|Agility,**Agility** [[@{selected|Agility}d10!!kh2]]} This allow me to choose one of the three Body category attributes. It then rolls the right amount of dice (with exploding tens) and keeps the highest two. I have read the Advanced Usage section on nesting queries within queries and my head mind refuses to help me. What I would like to do is include a list of Body Category Skills as a query. So that the macro asks for the Attribute (as above) but also asks for the skill and adds the skill value to the total roll as a modifier. Could someone tell me if this is possible, and maybe give me a pointer as how to achieve the desired result. Many Thanks
1448220823

Edited 1448221066
Yup, it's possible. Write the Roll Query you'd like to nest. Replace the commas, vertical bars and closing brace of that Query with HTML entities, as you saw in the Advanced Usage section. You'll notice that Attributes/Abilities (e.g. @{selected|Strength}) have both a vertical bar and a closing brace. However, as per the Note in Advanced Usage, those should not be replaced. Place this Query within your ?{Attribute} parent Query, i.e. like so: ?{Attribute|Strength,**Strength** [[@{selected|Strength}d10!!kh2 + ?{Strength Skills|[...]} |Vigour, [...]}
Silvyre said: Yup, it's possible. Write the Roll Query you'd like to nest. Replace the commas, vertical bars and closing brace of that Query with HTML entities, as you saw in the Advanced Usage section. You'll notice that Attributes/Abilities (e.g. @{selected|Strength}) have both a vertical bar and a closing brace. However, as per the Note in Advanced Usage, those should not be replaced. Place this Query within your ?{Attribute} parent Query, i.e. like so: ?{Attribute|Strength,**Strength** [[@{selected|Strength}d10!!kh2 + ?{Strength Skills|[...]} |Vigour, [...]} Thank You so much, the help is appreciated. I have got the Macro working!!
Great!
1448358011
Ziechael
Forum Champion
Sheet Author
API Scripter
Since your question has been answered I'll go ahead and close this thread but feel free to open a new one if you have any other questions :)