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

Nesting Macro's within a Roll Query

Hi, I've read the topics on Advanced Roll Queries etc. and followed the examples, but I do not get intended results, if I've missed something or misread something please feel free to point out my ineptitude!! Here's my macro: ?{Which macro?|Strength,#Save-Str |Con,#Save-Con } This gives me a pop-out box with the following text in it: Strength,/w gm /w gm &{template:simple Any help you can give would be appreciated!
So - the problem you are having is that the contents of the roll query are being substituted in, and partly parsed, before the roll query macro is itself executed.  I am absolutely no expert on this particular problem - but basically you have to substitute certain characters in the sub macros with html calls so that when they get parsed, the roll query macro is entirely correct. I generally get around this by having the parent macro whisper a bunch of macro call buttons into chat, and then I can click on those buttons to call the sub macros, rather than using the query, thus avoiding the whole 'substitute and parse' problem - it also means I can use the sub macros directly as they do not have to be parsed to become executable. Perhaps others can comment on the correct means to fix your issue - but you will probably need to provide the code of your sub macros for them to do it, as that is where the fixes will need to be.
I've read it about 10 times before, but something about the way you explained it made it click and so I understood I needed to change the "target" macro for this to work as that is substituted into the parent macro. That's great, except for now, when I replace the characters with the suggested html, when I save it and open it again, it has replaced the html with their respective characters :/ ie. /w gm %{selected & #124; Strength & #125; becomes: /w gm %{selected | Strength } Obviously in my actual macro, I do not have spaces in the HTML code. So once again I'm at a loss, any help would be much appreciated!
1519084482
GiGs
Pro
Sheet Author
API Scripter
Roll20 will parse the macro every time you open it. The trick is to enter the html substitutions, save the macro, and then never open the macro again . It's a good idea to save the macro in an external source, or in character abilities where the replacement doesnt happen. that way you have the original saved safely, in case you ever do need to open and edit the macro.
GG indeed! Thanks for the advice, I thought I was missing something obvious!