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

Nesting Macros... again...

1599211615

Edited 1599211722
I have three macros for different weapons like this: &{template:default} {{name=Attack with rapier}} {{Attack=[[1d20cs>18+?{modifier|5}+?{studied|yes,1|no,0}]]}} {{Damage=[[1d6+1+?{sneakAttack|yes,0d6|no,0}+?{studied|yes,1|no,0}]]}} seems complicated but works like a charm. The other ones are the same only with different numbers and weapon names. Now I want to use a choosing macro like this: ?{weapon choice|rapier,#Rapier|ShortBow,#ShortBow|Dagger,#Dagger} Didn't work, looked into different threads and found the problem of "problematic characters". So I changed all } with & #125; (without space) and all | with 124 and all , with 44. But the only thing I get when I choose one of the weapons is the name of the macro. It doesn't get fired. As I tried this and that I once got it working, but as soon as I saved it, changed the other macros and tried again, it stopped working and I couldn't get it working again since then. Has anyone an idea how to get this solved?
1599212786

Edited 1599212873
GiGs
Pro
Sheet Author
API Scripter
You need to read the section on the wiki about replacing characters. It's important to identify which characters to change. You cant simply change all } | , characters - you need to change just &nbsp;the ones you need to. That information is here:&nbsp; <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> In your macro this might be complicated by the fact that you have more queries inside the query, which may each need an extra level of nesting. Personally, I never use nested queries any more. A much better, much simpler solution is to use a chat menu . This whispers a button for each macro in chat to you - only you can see it - and when you click the button, the macro is triggered. To use them, leave your original macros unchanged. No replacement characters. Then call it with a macro like this: /w "your character name" &amp;{template:default} {{name=My Character's Attacks}} {{[Rapier](!&amp;#13;#Rapier) [Short Bow](!&amp;#13;#ShortBow) [Dagger](!&amp;#13;#Dagger)}} This does have some html characters, which means you have to be careful about reopening the macro. A better solution is to put this macro on the Abilities section of your character sheet (Attributes &amp; Abilities tab) - you can open it safely.&nbsp; If you move your attacks to your Abilities section of the character sheet, and your character name is Bob, the above would become /w "your character name" &amp;{template:default} {{name=Bob's Attacks}} {{[Rapier](~Bob|Rapier) [Short Bow](~Bob|ShortBow) [Dagger](~Bob|Dagger)}} You might also find it advantageous to change your macros to Abilities on your character. This simplifies the syntax, using no ugly html characters. A big advantage of these approaches, is you can make new attack macros or abilities, and can just add them in by adding another section like [New attack Label](~Bob|New-attack-name) No need to modify the new macro or ability directly - just add another button to call it.
1599221642

Edited 1599222294
That works really well. Thank you. Is there a possibility to get the attributes of a character and put them into the ability macros? @edit: Nevermind, found it. This is really cool... a little bit uncomfortable, but could be worse :D Thanks again
1599222817
GiGs
Pro
Sheet Author
API Scripter
You're welcome :)
1599228805
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
More info on&nbsp; Macro Character Sheets .