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

Nested Macros - What Am I Doing Wrong?

1592777430

Edited 1592777586
Hi everyone. I'm trying to use nested macros as per <a href="https://roll20.zendesk.com/hc/en-us/articles/360037256794-Macros#Macros-NestinginaRollQuery" rel="nofollow">https://roll20.zendesk.com/hc/en-us/articles/360037256794-Macros#Macros-NestinginaRollQuery</a> I have a number of macros that use The Aaron's Tokenmod so that players can resize their character tokens.&nbsp; It would be nice to have just one macro and let players choose which size they want. Here's the script used for SzFull: !token-mod --set width|=70 height|=70 The other macros are similar except for the pixel sizes.&nbsp; Here's how I nested all of them: ?{Choose a size|20 by 20 pixels,#Sz20 |33 by 33 pixels,#Sz33 |40 by 40 pixels,#Sz40 |50 by 50 pixels,#Sz50 |Full square,#SzFull } However, when I run this, the drop down looks like this: Please, what am I doing incorrectly? Thank you in advance.
1592800500

Edited 1592800614
Oosh
Sheet Author
API Scripter
Since you're nesting a macro which contains characters important to the query, you're going to run in HTML entity replacement issues. You need to replace those | pipes in all your macros with &amp;#124; otherwise the query thinks the | is a break to another option. Before the macro runs the query, it is replacing all the macro calls, like #SzFull, with the contents of that macro. The other (easier) option is to use a Chat Menu. First, I would move all your macros to a character sheet under Abilities, and call it Macros, or Resize (or whatever you want, really). Then make a chat menu something like this (player needs to replace /w gm with /w &lt;their name&gt;): /w gm &amp;{template:default}{{name=Token Resize}}{{Pick Size=[Very Small](~Resize|Sz20) [Small](~Resize|Sz33) [Medium](~Resize|Sz40) [Large](~Resize|Sz50) [Full](~Resize|SzFull) }} This would remove the need for HTML replacement. If you want to stick with the drop-down, I would still move all the macros into a character sheet, as Collections macros destroy HTML replacement every time you open them.
1592855902

Edited 1592861399
Oosh said: Since you're nesting a macro which contains characters important to the query, you're going to run in HTML entity replacement issues. You need to replace those | pipes in all your macros with &amp;#124; otherwise the query thinks the | is a break to another option. Before the macro runs the query, it is replacing all the macro calls, like #SzFull, with the contents of that macro. The other (easier) option is to use a Chat Menu. First, I would move all your macros to a character sheet under Abilities, and call it Macros, or Resize (or whatever you want, really). Then make a chat menu something like this (player needs to replace /w gm with /w &lt;their name&gt;): /w gm &amp;{template:default}{{name=Token Resize}}{{Pick Size=[Very Small](~Resize|Sz20) [Small](~Resize|Sz33) [Medium](~Resize|Sz40) [Large](~Resize|Sz50) [Full](~Resize|SzFull) }} This would remove the need for HTML replacement. If you want to stick with the drop-down, I would still move all the macros into a character sheet, as Collections macros destroy HTML replacement every time you open them. Ah, the pipes make perfect sense as to why the drop down (or drop UP in the screen shot!) is formatted the way it is, thank you. I'll give that a go. Hmmm, strangely enough, it doesn't appear to improve things with just a straight replace, but as you said the collections macros destroy the HTML.&nbsp; :) I'll definitely have to look into the chat menu further.&nbsp; I'm hoping to set up basic routines for rolling for the different weapons versus normal/large and, where applicable, thrown. Thank you so much for your reply.