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

Macro that allows a choice

1698006629

Edited 1698006735
Hi, I am new to creating macros, and I have a couple that I am trying to combine that gives a choice, but I am having issues.&nbsp; This is what I currently have. ?{Choose Form|Lycan, #LycanImage #LycanStats |Vampire, #VampireImage #VampireStats } Here are the 4 sub macros #LycanImage !token-mod {{--set imgsrc|<a href="https://s3.amazonaws.com/files.d20.io/images/364090753/InG7SeOkRdL0YrQzasypRQ/med.png?1697832605" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/364090753/InG7SeOkRdL0YrQzasypRQ/med.png?1697832605</a> }} #LycanStats !setattr --sel --silent --mod --Strength|2 --Dexterity|2 --Constitution|2 --Intelligence|-4 --hp_temp|10 --passive_wisdom|2 !setattr --sel --silent --alignment|Chaotic Evil #VampireImage !token-mod {{--set imgsrc|<a href="https://s3.amazonaws.com/files.d20.io/images/360453615/iXJDd4Ib-t1KqKF4lgF8oQ/med.png?1695579288" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/360453615/iXJDd4Ib-t1KqKF4lgF8oQ/med.png?1695579288</a> }} #VampireStats !setattr --sel --silent --mod --Strength|-2 --Dexterity|-2 --Constitution|-2 --Intelligence|4 --passive_wisdom|-2 !setattr --sel --silent --hp_temp|0 --alignment|Neutral Evil Individually they work great, It's only when I try to combine them and add the Chose option that it doesn't work.&nbsp; I get the option to choose, but instead of showing "Lycan" &amp; "Vampire", it shows "Lycan" &amp; "<a href="https://s3.amazonaws.com/files.d20.io/images/364090753/InG7SeOkRdL0YrQzasypRQ/med.png?1697832605" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/364090753/InG7SeOkRdL0YrQzasypRQ/med.png?1697832605</a>", which is the link for the Lycan image.&nbsp; I currently have #LycanImage and #LycanStats combined into one macro and #VampireImage and #VampireStats combined into one macro.&nbsp; I would like them all in one to give the player to choose Lycan or Vampire. Any help you can offer would be greatly appreciated.
<a href="https://wiki.roll20.net/Roll_Query/Nested" rel="nofollow">https://wiki.roll20.net/Roll_Query/Nested</a> Your nested macros are breaking the query. You’ll have to use html substitutions or a chat menu.&nbsp;
Thanks for your response, but I can't figure it out.&nbsp; Am I changing the main macro or the nested macros?&nbsp; I'm guessing I change all of the '|' with&nbsp; &amp;#124; and all of the '}' with&nbsp; &amp;#125; Is that correct?
I just figured it out.&nbsp; Thank you for your help.
If you want to nest the macros, then you need to replace all closing braces, vertical pipes, and commas in the macros, which means they won't work as standalone macros anymore. TokenMod allows for alternate characters for just that reason, and you don't have to use surrounding pairs of braces if everything is on a single line. ChatSetAttr doesn't have any html replacements built in to nest queries. You also can't add any spaces between the comma of each query item and the output, or have a space to have multiple outputs in the way that you're trying to set this up with your query. #LycanImage !token-mod --set imgsrc#<a href="https://s3.amazonaws.com/files.d20.io/images/364090753/InG7SeOkRdL0YrQzasypRQ/med.png?1697832605" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/364090753/InG7SeOkRdL0YrQzasypRQ/med.png?1697832605</a> #LycanStats !setattr --sel --silent --mod --Strength&amp;vert;2 --Dexterity&amp;vert;2 --Constitution&amp;vert;2 --Intelligence&amp;vert;-4 --hp_temp&amp;vert;10 --passive_wisdom&amp;vert;2 --alignment&amp;vert;Chaotic Evil Since you're using scripts, you can also use Timmaugh's Metascripts to add a deferral character in your macro construction so you don't have to use html replacements .