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

Html code turning into symbol when saving macro (5e npc-template)

Hi, I am currently trying to make a macro that gives me API command buttons/Ability Command Button within a 5e nsc-template (simply because I think it looks better). And after some work I got this macro: @{<char-name>|wtype}&{template:npcaction}{{name=<char-name>}}{{rname=Eldritch Blast}}{{description=[kein Hex](!
%{<char-name>|EB_nohex}) [Hex](!
%{<char-name>|EB_hex})}} Which works fine, as long as I copy it directly into the Chat or click on the "Test Macro" button. But as soon as I save the macro the html codes !
% are turned into the symbols they represent "! %" and the macro doesn't work anymore. When I reopen it, it looks like this: @{<char-name>|wtype}&{template:npcaction}{{name=<char-name>}}{{rname=Eldritch Blast}}{{description=[kein Hex](! %{<char-name>|EB_nohex}) [Hex](! %{<char-name>|EB_hex})}} I tried removing the space between "!" and "%" but that doesn't make a difference. Can someone help me with that? Thanks in advance.
Since you are calling a character ability here, you should be able to simply use  [kein Hex](~<char-name>|EB_nohex) If this ability is within the character's Attributes and Abilties tab, you can even remove all of the references to the character's name. @{wtype}&{template:npcaction}{{name=@{character_name}}}{{rname=Eldritch Blast}}{{description=[kein Hex](~EB_nohex}) [Hex](~EB_hex})}}
1548877594
GiGs
Pro
Sheet Author
API Scripter
This is a classic problem that everyone who uses html entities runs into. When you save the Macro, it is fine, and will work. But if you ever  reopen  the macro for editing, the html entities are transformed into the symbols. To be clear: the symbols arent being transformed when you save the macro. It is when you reopen it to check the macro that the transform happens. You have two solutions to this problem: Never ever reopen the macro. Get it right, save it, and then leave it alone. (Also saving a copy elsehwere for when you do accidentally reopen it.) More reliable method: as Kyle suggests, save it as a Character Ability, on the Attributes and Abilities tab. A lot of people create a new character called Macros, to hold these Abilities. If you make this sheet controlled by everyone, players can use the Abilities, and it's just like having a universal macro.
1548877615

Edited 1548877802
@Kyle: Thank you very much, the first one works fine. What kinda bothers me now, is that I'm pretty sure I tried that before... @GiG Thanks for the explanation. The new Character is not an option scince I am a player.
1548878482
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
But, if you already have a character, then you could simply make these as abilities on your character using the attributes&abilities tab.
1548880813
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
My personal rule of thumb: If it can be an Ability instead of a Macro, it should . There are some legitimate reasons to use macros, but they account for less than 3% of the automation in my game. The syntax is simpler, they are more portable and they rarely have to deal with HTML entity replacement.