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

Embedding abilities from a character sheet

1626374243

Edited 1626375330
Hi all, I have been having a look around the forums and googling to try and find a way to embed an ability macro that is on a character sheet (roll20 5E OGL) into a single macro that whispers a list of buttons to the player; I know you can embed a global macro using: [button-name](!
#macro-name ) but the ability I was hoping to embed looks like this when I run it from the sheet and call the code using the up key: %{character-name|ability-name} is there a way to do something like the first code with the global macro but with the ability? ***Figured it out, so if anybody is looking at this and is interested I needed to use the HTML code for the % sign.*** looks like this: [button name](!
&#37{character-name|ability-name} Thanks in advance, Aaron.
1626375762
timmaugh
Forum Champion
API Scripter
Sure... [button-name](!
%{character-name|ability-name})
I tried that, it just rolled the macro, I had to change the % to &#37 for it to work properly. it just didnt occur to me at first.
1626377424
timmaugh
Forum Champion
API Scripter
Ah, sorry. I see now you were trying to embed it.
timmaugh said: Ah, sorry. I see now you were trying to embed it. yup, and it has taken me hours of searching before I decided to ask on here and about 10 mins after I asked the question the "D'OH" moment came to me that I probably needed to substiute the % for HTML code for it to be picked up properly.
1626383058
GiGs
Pro
Sheet Author
API Scripter
See here on the wiki: <a href="https://wiki.roll20.net/API:Chat#API_Command_Buttons" rel="nofollow">https://wiki.roll20.net/API:Chat#API_Command_Buttons</a> : a screenshot - PS: I'm honestly not posting this as a gotcha - it's really hard to find. Even though I know it's there, whenever I go looking for the syntax, it still takes me a while to find it.
GiGs said: I'm not posting this as a gotcha - it's really hard to find. Even though I know it's there, whenever I go looking for the syntax, it still takes me a while to find it. Oh I never doubted it was there I just couldn't find it for love nor money.
1626398478

Edited 1626398523
Oosh
Sheet Author
API Scripter
I usually pop this reference open in a tab when I'm descending into the realm of multi-layered nesting. I find the &amp;lcub; &amp;rcub; notation significantly easier to read back &amp; troubleshoot than huge string of numbers - e.g. nesting a template inside a button inside a template inside a button inside a template.
1626403010
GiGs
Pro
Sheet Author
API Scripter
That's a very handy page - I'm not sure why the wiki uses the number versions of the HTML entities, because as you point out, they are the hardest to read and remember.
1626430969
Oosh
Sheet Author
API Scripter
I dunno, some people are very good at remembering number strings, but I find myself going cross-eyed once you've got the [[ {{ (&nbsp; all bumping into each other. I mean, no one ever wants to nest anything simple do they? :)
Oosh said: I dunno, some people are very good at remembering number strings, but I find myself going cross-eyed once you've got the [[ {{ (&nbsp; all bumping into each other. I mean, no one ever wants to nest anything simple do they? :) Of it was simple, what would be the point...the battles worth fighting are those least likely won...and all that