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

Is there a way to have the player select a couple of options, and then have a macro call another one...?

?{Melee or Ranged attack|Melee,melee|Ranged,range} ?{What Row|1,1|2,2|3,3|4,4|5,5|6,6} #row?{What Row}?{Melee or Ranged attack} Now it outputs the required output of #row1melee fine, but does not call the macro, which does exist.... Any ideas? Pref without API.
1555040041
GiGs
Pro
Sheet Author
API Scripter
I dont think you can build macro names like that, in normal macros. One solution i can think of without using the API would be a very complicated nested macro (not recommended, due to the need for html replacements ). If you go that route, you are probably best off reducing those two queries to one, like ?{Attack?|Melee 1,some code here|Melee 2,some code here|Melee 3,some code here|Ranged 1,some code here|Ranged 2,some code here|etc} A better approach than either of these might be the Chat Menu method listed here: <a href="https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=5927072#post-5927072" rel="nofollow">https://app.roll20.net/forum/post/5899495/stupid-roll20-tricks-and-some-clever-ones/?pageforid=5927072#post-5927072</a> In this approach, instead of having a query, your macro prints out one button for all attacks, and the player clicks the relevant one. It might looks something like &amp;{template:default} {{name=Choose Attack}} {{melee=[1](!&amp;#13;#row1melee) [2](!&amp;#13;#row2melee) [3](!&amp;#13;#row3melee) [4](!&amp;#13;#row4melee) [5](!&amp;#13;#row5melee) }} {{ranged=[1](!&amp;#13;#row1ranged) [2](!&amp;#13;#row2ranged) [3](!&amp;#13;#row3ranged) [4](!&amp;#13;#row4ranged) [5](!&amp;#13;#row5ranged) }} Which would look like this You can edit the macro names, add extra rows, etc. Just make sure the basic syntax of each button is correct. You just have to change the display name and macro-name sections in the code below for each button: [display name](!&amp;#13;#macro-name)
1555040359

Edited 1555040380
GiGs
Pro
Sheet Author
API Scripter
And if you wanted a more vertical display, with wider titles, you could do it like this (just change the numbers to descriptive titles) Code: &amp;{template:default} {{name=Choose Attack}} {{melee=ranged}} {{[1](!&amp;#13;#row1melee)=[1](!&amp;#13;#row1ranged)}} {{[2](!&amp;#13;#row2melee)=[2](!&amp;#13;#row2ranged)}} {{[3](!&amp;#13;#row3melee)=[3](!&amp;#13;#row3ranged)}} {{[4](!&amp;#13;#row4melee)=[4](!&amp;#13;#row4ranged)}} {{[5](!&amp;#13;#row5melee)=[5](!&amp;#13;#row5ranged)}}
1555049248
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
To make this even simpler to write, you could use a macro sheet (description and advantages here ), but the syntax reduces to simply [display name](~macro-name) In this case you are actually writing Abilities, or character-sheet-based macros. But you don't have to muck about with html replacements. Your code remains easily editable and much easier to write.
Thanks guys I will start looking into it.