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

Macros breaking after a short time

1572829273

Edited 1572829508
I have tried making macros and character abilities before, but I am having some issue currently as the same issue keeps cropping up. The macro in question is effectively a cast of level 1 cure wounds using an item with 5 charges. Activating the macro asks how many charges are wanted to be used in the cast, then drops the result in chat. Ive made a similar one for healing potions. Regardless of how I seem to type it, after a few minutes the macro breaks, and, when clicking the button to trigger the macro, the ability to select the number of charges or the type of healing potion used breaks. The macro for the item with charges for cure wounds is: @{selected|wtype}&{template:atkdmg} {{damage=1}} {{dmg1flag=1}} ?{Charges used?|1 Charge (1d8+@{wisdom_mod}), {{rname=1 Ruat Charge (1d8+@{wisdom_mod})}} {{dmg1=[[1d8+@{wisdom_mod}]]}} |2 Charges (2d8+@{wisdom_mod}), {{rname=2 Ruat Charges (2d8+@{wisdom_mod})}} {{dmg1=[[2d8+@{wisdom_mod}]]}}; |3 Charges (3d8+@{wisdom_mod}), {{rname=3 Ruat Charges (3d8+@{wisdom_mod})}} {{dmg1=[[3d8+@{wisdom_mod}]]}} |4 Charges (4d8+@{wisdom_mod}), {{rname=4 Ruat Charges (4d8+@{wisdom_mod})}} {{dmg1=[[4d8+@{wisdom_mod}]]}} |5 Charges (5d8+@{wisdom_mod}), {{rname=5 Ruat Charges (5d8+@{wisdom_mod})}} {{dmg1=[[5d8+@{wisdom_mod}]]}} } When working, clicking this macro prompts the user how many charges they want to use for the cast with a drop down, then rolls the appropriate dice once selected. When it breaks only the code for the first option is shown in place of the drop down, as so: 1 Charge (1d8+1), {{rname=1 Ruat Charge(1d8+1) The macro for the healing potion is: @{selected|wtype}&{template:atkdmg} {{damage=1}} {{dmg1flag=1}} ?{Healing Potion Variety?| Standard (2d4+2), {{rname=Standard Healing Potion (2d4+2)}} {{dmg1=[[2d4+2]]}} |Greater (4d4+4), {{rname=Greater Healing Potion (4d4+4)}} {{dmg1=[[4d4+4]]}} |Superior (8d4+8), {{rname=Superior Healing Potion (8d4+8)}} {{dmg1=[[8d4+8]]}} |Supreme (10d4+20),{{rname=Supreme Healing Potion (10d4+20)}} {{dmg1=[[10d4+20]]}}} When working, clicking the macro prompts the user for what potion they drank with a drop down to cycle through the options. When it breaks, the drop down is missing, and the box is instead filled with just the first option's raw code, as so: Standard (2d4+2), {{rname=Standard Healing Potion(2d4+2) Any fixes would be appreciated, as I would much prefer to use a macro than have an attack in my character sheet, which is already overflowing.
1572854450
GiGs
Pro
Sheet Author
API Scripter
When you use queries and the nested text includes problem characters (like | or } or  , ), the macro will usually break. If you wish to use a macro like that, you need to study the wiki on advanced roll queries and html substitutions . An alternative is to switch over to using a chat menu, as discussed in the Stupid tricks thread. Though looking at your macros, they can be rewritten to avoid needing either of these approaches.  Here's the ruat charges one @{selected|wtype}&{template:atkdmg} {{damage=1}} {{dmg1flag=1}} {{rname=?{Charges used?| 1 Charge (1d8+@{wisdom_mod}),1|2 Charges (2d8+@{wisdom_mod}),2| 3 Charges (3d8+@{wisdom_mod}),3|4 Charges (4d8+@{wisdom_mod}),4| 5 Charges (5d8+@{wisdom_mod}),5} Ruat Charge (?{Charges used?}d8+@{wisdom_mod})}} {{dmg1=[[?{Charges used?}d8+@{wisdom_mod}]]}} The trick is that you can use queries as variables. You can use the query name multiple times, and it will use the value in each case.  That can be rewritten as !?{Charges used?|1 Charge (1d8+@{wisdom_mod}),1|2 Charges (2d8+@{wisdom_mod}),2|3 Charges (3d8+@{wisdom_mod}),3|4 Charges (4d8+@{wisdom_mod}),4|5 Charges (5d8+@{wisdom_mod}),5} @{selected|wtype}&{template:atkdmg} {{damage=1}} {{dmg1flag=1}} {{rname=?{Charges used?} Ruat Charge (?{Charges used?}d8+@{wisdom_mod})}} {{dmg1=[[?{Charges used?}d8+@{wisdom_mod}]]}} The trick here is that any line beginning with ! is not printed to chat. It's meant for API scripts (a Pro feature), but can be used like this to reorder the macro text. Here I put the full query first, then the next line is the macro and I only need to use the queries name each time.