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

Another Macro Question

Hello I'm trying to the name section to match the Maneuver in the description section without having to select the name twice.  In the past I've used a identical query to populate spell level, but that solution doesn't seem to be working for me in this instance.  Any help is appreciated. &{template:default} {{name= Battle Maneuver ?{Maneuver| Ambush| Rally| Evasive Footwork}}} {{?{Maneuver?| Ambush, Add [[1d6]] to Initiative or Stealth| Rally, Choose a friendly creature who can see or hear you. That creature gains temporary hit points equal to [[1d6+4]]| Evasive Footwork, When you move, you can expend one superiority die [[1d6]] and add it to your AC until you stop moving}}}
You have two different queries. The first query is named 'Maneuver'. The second query is named 'Maneuver?'. For a query to be reused, it has to have the exact same name .  FYI, if you have multiple queries with the same name in a macro, then you only need to list the outputs the first time, as they will be ignored in any subsequent repeats, and the result of the first instance will be used in the rest of the macro wherever that query appears again. So you can't change the outputs in the second instance and expect a different output.  And you can't reference the input either.  Which means you can't have the same query in the 'name' field as the next line down but have a different output. I think this is the output you are looking for (there is an html replacement for the comma in the Evasive Footwork description, so make sure this is saved on a character sheet as an Ability, instead of as a Collections Macro): &{template:default} {{name= Battle Maneuver}} {{?{Maneuver| Ambush,Ambush=Add [[1d6]] to Initiative or Stealth| Rally,Rally=Choose a friendly creature who can see or hear you. That creature gains temporary hit points equal to [[1d6+4]]| Evasive Footwork,Evasive Footwork=When you move, you can expend one superiority die [[1d6]] and add it to your AC until you stop moving}}} Last piece of advice for macros: remove spaces at the beginning of the outputs, as they can cause issues in some situations (such as nesting additional macros).
I'm aware that the two queries currently don't match.  Currently when I run the macro, I select Ambush from the first drop down and then again from the second drop down to get the "Name" and "Description" section to match.  Which gives me the following output.   What I would like to do is make it so that I end with the same output, but only have to select Ambush once.  When I made the queries match each other it resulted in this output.  I'm just trying to figure if there is a way to tweak this to get the desired result with a single query instead of having to choose the same option twice on two separate queries.
Did you try the macro that I posted? Does that work for what you’re looking for?
1682999108
timmaugh
Forum Champion
API Scripter
You can't use one query for 2 different results/outputs in a command line without a script. If they are available I can give an example...
1683161948

Edited 1683161963
I did see yours Jarren, but it is not quite what I'm trying to accomplish.  It is possible that what I'm going for is not possible.   In this macro (That I know is not the prettiest).  The query from the Name category automatically fills the query in each section as selected.  I was trying to get something similar to happen for my current macro attempt, but I understand that they are very different query commands and order of operations.  So my current attempt might be impossible. &{template:spell}  {{name=Wand of Amplification: *Thunderwave* **(Level ?{Spell slot level| 1|2|3|4|5|6|7} )**}} {{castingtime=1 Action}} {{range=15ft Cube from Self }} {{component=Wand}} {{duration=Instant}}  {{description= A wave of energy bursts forwards in a **15ft Cube**. Each creature in that area must make a **Constitution ST** or take [[(1 + ?{Spell slot level})d8]] **Thunder Dmg** *and is pushed 10ft away* on a failed save, or half as much damage on a successful one and is not pushed.}}  {{savedc= [[12]]}} Thank you guys for giving it a try and taking some time to look at it.
1683166747
timmaugh
Forum Champion
API Scripter
So you want to drive 2 data points from your query without having to "fake" a second query that makes you pick the same data twice (pick "ambush" in each to get the title and the ambush-related-data). Without scripts this won't really be possible. However, with scripts, you can do: !&{template:default} {{name= Battle Maneuver ?{Maneuver| Ambush| Rally| Evasive Footwork}}} {{ Info={&if ?{Maneuver} = Ambush}Add [[1d6]] to Initiative or Stealth{&elseif ?{Maneuver} = Rally}Choose a friendly creature who can see or hear you. That creature gains temporary hit points equal to [[1d6+4]]{&else}When you move, you can expend one superiority die [[1d6]] and add it to your AC until you stop moving{&end}}}{&simple} That will tie the data reported to the battle maneuver you pick while only having to pick it once. Output: Required Scripts: ZeroFrame, APILogic
If you are using the D&D 5E by Roll20 sheet you can use the mancerroll template to display your maneuver choice without needing a script.  You just need to replace the C1 roll with a query that returns numbers and then fill in the corresponding options: &{template:mancerroll} {{title=Battle Maneuver}} {{c1=[[?{Maneuver?|Ambush,1|Rally,2|Evasive Footwork,3}]]}} {{option1=**Ambush** Add [[1d6]] to Initiative or Stealth.}} {{option2=**Rally** Give [[1d6+4]] temporary hit points to one friendly creature who can see or hear you.}} {{option3=**Evasive Footwork** Add [[1d6]] to your AC until you stop moving.}} Note the template uses a weird oversize format for displaying inline rolls so I had to reword the text a bit to make it look at little better.
Awesome, thank you guys.