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

Powercards keeps changing ! & # 1 3 ; to ! #

I have been nesting macros into my powercards to allow extra effects to occur. For example, I set up a spell macro that lists all of the details of the spell, range, what it does, triggers spell slot reduction for the caster, has a soud effect, etc. At the bottom it has the actual mechanical effecfts as macro links (triggered by a button linked to another macro via the addition of the ! & # 1 3 ; ) and they work great. Until I log out and log back in and what was once [Inspire Allies](!
#Condition-Knightly-Inspiration) has become [Inspire Allies](! #Condition-Knightly-Inspiration) and no longer works.  What am I doing wrong?
1600272683
GiGs
Pro
Sheet Author
API Scripter
The problem here is you are opening the macro. Whenever you open a macro, roll20 processes its contents, and thats when entities like this: 
 get erased. If you dont open the macro, it will work fine. Note that if you save this macro into a character ability, that processing wont happen and you can open the ability safely. So its common for people to create an extra character, call it something like Macros, and save your special macros on that. You can then call it with buttons like [Inspire Allies](~Macros|Condition-Knightly-Inspiration)  and need to use fewer html entities. If you create a character like this, leave its Visible To empty, so it doesnt show up in player journals, and set Edited By to All Players. That means players can use the abilities you set up for them, but cant open the sheet to edit it.
1600274035
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
More info: Macro Character Sheet
So I tried this just now and it now disables my API scripts.
1600279658
GiGs
Pro
Sheet Author
API Scripter
You'll have to be more specific. What did you change? and what scripts were 'disabled' ?
I created a new character sheet named macros, I put the test macros in there and nested/linked to them using the  [Inspire Allies](~Macros|Condition-Knightly-Inspiration) example. I don't know how to isolate which scripts are disabled. It is literally all greekto me.
1600280174
GiGs
Pro
Sheet Author
API Scripter
It's likely your macros need some alteration to handle the fact they are now on a character sheet instead of a macro. Can you post one of the abilities in full that isnt working?
!power {{ --bgcolor|#1c4587 --erowbg|F1F1D4 --orowbg|#b6d7a8 --name|Minor Dark Chaos Tentacles Grapple @{target|token_name} --@{target|token_name} Save Roll:| [[ [$Save1] 1d20 +@{target|IntelligenceMod} + @{target|Level} + @{target|Protection} + ?{ Challenge Level|0} ]] **Prime:** @{target|IntelligencePrime} **CL:** ?{ Challenge Level} --?? @{target|IntelligencePrime} == Yes AND $Save1 >= 12 ?? Success: | **@{target|token_name}** has **MADE** their save! --?? @{target|IntelligencePrime} == No AND $Save1 >= 18 ?? Success: | **@{target|token_name}** has **MADE** their save! --?? @{target|IntelligencePrime} == Yes AND $Save1 <= 11 ?? Failure: | **@{target|token_name}** has **FAILED** their save and takes [[ [$Dmgyes1] 3d1 ]] hit point(s) damage! --?? @{target|IntelligencePrime} == No AND $Save1 <= 17 ?? Failure: | **@{target|token_name}** has **FAILED** their save and takes [[ [$Dmgno1] 3d1 ]] hit point(s) damage! --?? @{target|IntelligencePrime} == Yes AND $Save1 <= 11 ?? alterbar1|_target|@{target|token_id} _bar|2 _amount|-[^Dmgyes1] _show|all --?? @{target|IntelligencePrime} == No AND $Save1 <= 17 ?? alterbar2|_target|@{target|token_id} _bar|2 _amount|-[^Dmgno1] _show|all --?? $Dmgyes1 >= @{target|bar2} AND @{target|IntelligencePrime} == Yes AND $Save1 <= 11 ?? api_token-mod|_ids @{target|token_id} _ignore-selected _set statusmarkers|dead --?? $Dmgno1 >= @{target|bar2} AND @{target|IntelligencePrime} == No AND $Save1 <= 17?? Defeated: | **@{target|token_name}** has been defeated! --?? $Dmgno1 >= @{target|bar2} AND @{target|IntelligencePrime} == No AND $Save1 <= 17 ?? api_setattr|_name @{selected|token_name} _mod _Experience|@{target|XP Value} }}
1600283696
GiGs
Pro
Sheet Author
API Scripter
I'm not familiar with power cards syntax, but I'm not seeing anything in there that shouldnt work. Have you tried running the Ability from the Macros character? If you are on the attributes and abilities tab, each ability has a roll button you can click to run it directly.
The macro powercard works fine from the character sheet. But not from the nested macro.
1600328611
Ziechael
Forum Champion
Sheet Author
API Scripter
Can you post the full macro you are using to call the powercards, from your OP it sounds like the menu is the one that is breaking rather than the powercard or its syntax. Is the menu macro a global/collections tab macro? If so, it will replace your carefully crafted html if you ever open it again but as long as you reset and don't open it you should be fine. Full recreation steps will help us to diagnose for you :)
I don't know what global/collections tab macro means. But this is what I wrote. !power {{ --bgcolor|#1c4587 --erowbg|F1F1D4 --orowbg|#b6d7a8 --name|Minor Dark Chaos --tokenid|@{selected|token_image} --emote|**Anáil nathrach, ortha bháis is beatha, do chéal déanaimh** --leftsub|**R:** 5 Feet **CT:** 1 **D:** 2 Rounds **C:** VSM --Effect:| A dark pair of smoky tendrils comes from the hands of **@{selected|character_name}** who uses them like whips to hit **@{target|1|token_name}** and **@{target|2|token_name}**. --soundfx|_audio,play,nomenu|charm of making --api_setattr|_name @{selected|token_name} _mod _numspells_1|-1 _silent --Spell Inventory: |**@{selected|token_name}** has [[ @{selected|numspells_1} -1 ]] 1st level spell(s) remaining! --soundfx|_audio,play,nomenu|charm of making --!Buttons|  [Dark Chaos Template](!
#Summon-Dark-Chaos) [Target One Round One](!
#Spell-Dark-Chaos-Minor-Round-One-Target-One) [Target Two Round One](!
#Spell-Dark-Chaos-Minor-Round-One-Target-Two) [Target One Round Two](!
#Spell-Dark-Chaos-Minor-Round-Two-Target-One) [Target Two Round Two](!
#Spell-Dark-Chaos-Minor-Round-Two-Target-Two) }}        
1600416998
Ziechael
Forum Champion
Sheet Author
API Scripter
Works fine for me, I get nicely clickable buttons which output the macro as expected... I doubt it is the issue but you have your soundfx row duplicated, that shouldn't be a problem since one would just override the other or so I believe. I reckon the issue is where the macro is stored and the fact that the macro has been opened after saving, is it in this section (the collections tab): If so, once saved you should never reopen the macro, it will convert the html as you've seen. The best idea is to house the macros offsite for edit/replace reasons OR, better yet, as abilities on a character sheet since that section of the VTT does not convert html by default.
Thank you. That part was explained to me by GiGs above. Now I'm trying to figure out why it won't open from the character sheet using ~