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

Simple Nesting Macro Difficulty

1527298083

Edited 1527312431
Hey everyone,  I've been searching the forums and working on this simple nesting macro I've been trying to make for a players who is a paladin. I'm trying to make a nesting macro for his divine smite. I've made a simple macro for each spell slot level, both against undead and live creatures. An example of this macro looks like this: &{template:npc} {{normal=1}} {{name=}} {{rname=Divine Smite Level 2}} {{mod=}} {{r1=[[3d8]]}} With each macro made, and working, I tried to nest them all into another macro so they show up as buttons in the chat window. So far it looks like this: &{template:default} {{name=Divine Smite}} {{=[Level 1](!#Divine-Smite-Lvl-1)}} When I test the macro, the result looks alright, but when the button [Level 1] is pressed, nothing happens. I have a similar macro set up for healing potions in another game, which works fine. If anyone can help with this, I would greatly appreciate it. Thanks!
1527338146

Edited 1527338258
GiGs
Pro
Sheet Author
API Scripter
It sounds like you're running into the bane of nested macros, html replacement. See this confusingly written and badly explained section on the wiki:&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_</a>... (Sorry to whoever wrote it, but I know what the issue is and I still have trouble understanding what that section is saying.)* The short answer is: if you want a macro to nest multiple macros, it's usually best to go against good programming practices - don't break them up into separate macros, but put them all in one giant macro, which you can then debug and apply the html entities needed to make it work. You'll need to replace some } characters with the matching html entity, and maybe some others too (like | or ,). Your best hope of getting this worked out is to put them all in a single macro, post the code here, and some html entity wizard will tell you how to adjust the code to fix it.&nbsp; -------------- *Admittedly, the problem is probably more to do with the way the roll20 wiki crams so much information into each page, and thus cannot give each section the full description and examples they need.&nbsp;
Thanks G G, I'll try a query macro then!&nbsp;