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 .
×

Error in a Macro

Hi! I´m trying to test how to put a macro into another to D&D5. I created this simple macro: ?{Escolha o teste de perícia |Adestrar,#adestrar |Arcanismo,#arcanismo |Atletismo,#atletismo |Atuação,#atuação } (sorry, it's in portuguese) and all the macros inside are working, but this big macro doesn't work. when I press it, it appears "Escolha o teste de perícia" (choose the hability test), but it doesn't appear the 3 options (Adestrar, Arcanismo e Atletismo). What appears is: "Adestrar,&{template:simple". I don't know what's the problem, because the macros #adestrar, #arcanismo and #atuação are working pretty well. Just if to be sure, those are the macros inside: #adestrar= @{selected|wtype}&{template:simple} {{rname=^{animal_handling-u}}} {{mod=@{selected|animal_handling_bonus}}} {{r1=[[@{selected|d20}+@{selected|animal_handling_bonus}@{selected|pbd_safe}]]}} @{selected|rtype}+@{selected|animal_handling_bonus}@{selected|pbd_safe}]]}} @{selected|global_skill_mod} @{selected|charname_output} #arcanismo= @{selected|wtype}&{template:simple} {{rname=^{arcana-u}}} {{mod=@{selected|arcana_bonus}}} {{r1=[[@{selected|d20}+@{selected|arcana_bonus}@{selected|pbd_safe}]]}} @{selected|rtype}+@{selected|arcana_bonus}@{selected|pbd_safe}]]}} @{selected|global_skill_mod} @{selected|charname_output} #atuação= @{selected|wtype}&{template:simple} {{rname=^{performance-u}}} {{mod=@{selected|performance_bonus}}} {{r1=[[@{selected|d20}+@{selected|performance_bonus}@{selected|pbd_safe}]]}} @{selected|rtype}+@{selected|performance_bonus}@{selected|pbd_safe}]]}} @{selected|global_skill_mod} @{selected|charname_output}
1593023841

Edited 1593023969
David M.
Pro
API Scripter
Yes, common problem. You will need to replace the brackets, vertical lines (pipes), and commas in your individual macros with html replacements, as described here: <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_Roll_Queries</a> After doing this, you may run into the next common problem which is if the macros are in the Collections tab, if you EVER open them again, the html replacement text will revert back to brackets, pipes, and commas, which will cause your master macro to start failing again.&nbsp; The solution to this secondary problem is to make them into character sheet ability macros rather than global macros in the Collections tab. For some reason, the html replacements "stick" when done in this way.&nbsp; EDIT - I would suggest using a text editor to find/replace the problem characters, since if you try to do it manually, you may go blind and insane :)
1593024340

Edited 1593025068
Oosh
Sheet Author
API Scripter
Ninja'd! &lt;same stuff as David said deleted&gt; Glad I refreshed the page before I looked stoopid! I guess I'll have to come up with something else then: So your first macro, #adestrar, should look like this (you will need to wrap it in a Query to run it): &amp;{template:simple&amp;#125; {{always=1&amp;#125;&amp;#125; {{rname=^{animal_handling-u&amp;#125;&amp;#125;&amp;#125; {{mod=@{selected|animal_handling_bonus}&amp;#125;&amp;#125; {{r1=[[@{selected|d20}+@{selected|animal_handling_bonus}@{selected|pbd_safe}]]&amp;#125;&amp;#125; {{r2=[[1d20+@{selected|animal_handling_bonus}@{selected|pbd_safe}]]&amp;#125;&amp;#125; @{selected|global_skill_mod} @{selected|charname_output} There's not only the HTML replacement in the macro, but also removing the @{rtype} call. This Attribute contains its own query, and cannot be nested inside another query without modification. So we have to change it to always roll advantage (like the default sheet setting). You can throw your own Advantage query into the macro if you like, you just can't use the inbuilt one from another query. If you are trying to get all the skills into one dropdown, and link to the inbuilt skill rolls, consider using a Chat Menu - it's much easier!
1593025295
David M.
Pro
API Scripter
Good tip regarding @rtype not working in nested queries -- I didn't realize that!
1593028455

Edited 1593028688
Oosh
Sheet Author
API Scripter
Sorry, I should have been more explicit. You can certainly use it, but you need to make sure it's not inside the other query. This macro is a great example, he's moved the @{rtype} call right to the start so it doesn't break the skill selection query. Actually it's quite a clever macro, I've never seen it before. It works for PCs and NPCs. Just needs a Portugese translation, Pupide! I still prefer the chat menu - rolling a check for 5 NPC's is significantly faster just spamming a link 5 times.
Thank you so much, I will try all that. Actually the macro that I used I found on internet, so I don´t understand it all. I think I will use the Chat Menu that you talked about. Thanks