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

Nested Macros Before/After saving

1527483686

Edited 1527483772
So, I ran into a weird issue regarding nested macros. The code I have below is what it does. This is before saving. However, when I save it, the code changes. Now, I'm sure there is more things working in the background that I haven't learned yet. However, if I go back to the macro and save changes with the after code, it all breaks. I am completely puzzled by this. I learned to script it, save it, and then leave it alone. It works if I don't save the after code. Before: /w Bartuc Vizjerei &{template:default} {{name=Character Stuff}}{{Stuff = [Initiative](! #Initiative )[Perception](! #perception )[Char Info](! #charinfo )[Saving Throws](! #SavingThr)[Whisper Player](! #WhisperPlyr)[Whisper GM](! #WhisperGM)}} After : /w Bartuc Vizjerei &{template:default} {{name=Character Stuff}}{{Stuff = [Initiative](! #Initiative )[Perception](! #perception )[Char Info](! #charinfo )[Saving Throws](! #SavingThr)[Whisper Player](! #WhisperPlyr)[Whisper GM](! #WhisperGM)}} Note: there is a !&#13 ; where the !'s should be. Also, is there more information on what the number 13 means? Is there more digits that do other things? by combining them creates a !, had to space out. Thank you for your help, I am absolutely loving roll20 and I am currently helping my DM with macros to help smooth out the gameplay.
Yup, you've put your macro in the global macro tab, and roll20 'helpfully' parses it for you. Get it right in an offline text editor, paste it in to roll20 and then *never open it again* Or put the macros into a character sheet abilities tab.
1527515854
GiGs
Pro
Sheet Author
API Scripter
This is a frustrating issue with roll20. HTML entities are a way of representing certain characters, which are interpreted differently by the macro parser. You need them in certain macros, to get around some limits with the way macros work. But whenever you open a Macro, any html entities within are converted to the characters they represent, and that breaks the macro. You have two ways of getting around this problem: When you save a Macro with html entities in it, never reopen it. It will work fine. It's a good idea to keep a backup of the original text of the macro somewhere, for when you do inevitably accidentally open one of those macros. Create a character sheet, call it Macros, store you macros in the Abilities section of that sheet, and run them from there. For some reason, Abilities are not parsed in the way Macros are, so the automatic conversion does not happen. 
1527516326

Edited 1527517109
Thanks for the explanations. I've been saving my macros to a spread sheet. I am curious to what the 13 does. I've seen the numbers 37, 134, and 125 used. What do these numbers represent?
1527517632

Edited 1527517673
See here for more details about HTML entites: <a href="https://eastmanreference.com/list-of-html-entity-n" rel="nofollow">https://eastmanreference.com/list-of-html-entity-n</a>... Note that in Roll20 there are very few you need to encode as entities. See the wiki here for the most common ones: <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>
1527522480
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Echoing the recommendation for the Macro Sheet, for many reasons. more detail&nbsp; here . Seriously, I think I recommend this and chat menus at least once a day. I need to automate the links... :)
keithcurtis said: Echoing the recommendation for the Macro Sheet, for many reasons. more detail&nbsp; here . Seriously, I think I recommend this and chat menus at least once a day. I need to automate the links... :) The macro sheet is a good idea, but I don't have a pro account so I don't have access to the character vault. I'll just copy and paste it all into a google sheet for later use. Thanks though!
1527525074
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Oops, didn't notice your account level. The Macro Sheet is still a good idea to simplify your code writing, though. You won't run into nearly so many issues requiring HTML replacements.
Yeah, I actually just did that with a bunch of dice rolls, and a global macro with the contents "%{Bartuc Vizjerei|Dice}". It is quite impressive how much there is to this game and to learn from to make things as smooth as possible. Thanks for suggesting the character vault Keith!