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 .
×
D&D 2024 has arrived! Pre-order the new core rulebooks now and get an exclusive pre-order bonus for free!
Create a free account

Add text to a macro call

Hi, Is it possible to add text within a macro call. For example I have a character sheet (Owen) and a corresponding macro sheet (Owen Macro). I want to be able to select a token (Owen) and call a macro from the corresponding macro sheet (Owen Macro). I can use %{Selected|PC Strength} to call an ability but I'm trying to add text to call the ability from the macro sheet instead so something like  %{Selected Macro |PC Strength}. Is this something than can be done ?
1683755151

Edited 1683755373
<a href="https://app.roll20.net/forum/post/5899495/roll20-tips-and-tricks-innovative-solutions-to-common-problems/?pageforid=6137639#post-6137639" rel="nofollow">https://app.roll20.net/forum/post/5899495/roll20-tips-and-tricks-innovative-solutions-to-common-problems/?pageforid=6137639#post-6137639</a> &nbsp;Create an attribute on 'Owen Macro' called '%' Then the resulting macro would look like this: @{Owen Macro|%}{@{selected|character_name} Macro|PC Strength}&nbsp; What will happen is Roll20 will parse through the line several times. The first time through it will become: % { Owen Macro|PC Strength}&nbsp; You can change up which macro mule character you use for this as well, such as using a generic macro mule character for replacing attributes instead of 'Owen Macro'. Since you have a Pro subscription, you could also use a Mod script to achieve something very similar.&nbsp; I saw that Timmaugh just posted an update to his Metascript suite, so he'll probably drop by in a sec to give a scripting solution. :)&nbsp; And depending on what you're trying to do, it might be easier to use a single Macro Mule character, or to put all of the 'Owen Macro' macros directly onto 'Owen' instead.&nbsp; If you provide some more context then some other solutions might be simpler.&nbsp; You can check out my Universal Statblock Macro Mule for some idea of what I'm talking about.
1683755430
timmaugh
Pro
API Scripter
Yes, with Fetch (possibly ZeroFrame, too). !%(@{selected|token_name} Macro.PC Strength) If the "PC Strength" ability is not a script calling ability (that is, it just outputs something to chat), then you'll want ZeroFrame, too, so you can add a {&amp;simple} to the end of that line.
1683755856

Edited 1683755904
timmaugh
Pro
API Scripter
Jarren said: Since you have a Pro subscription, you could also use a Mod script to achieve something very similar.&nbsp; I saw that Timmaugh just posted an update to his Metascript suite, so he'll probably drop by in a sec to give a scripting solution. :)&nbsp; Lol
Guys, May thanks for this. I'll try both options tonight and see how I get on.
Jarren, You're solution works great. Initially with @{Owen Macro} at the start I was getting the right output but also got an error message. Made the following change and now get the right output and no error message. Cheers for your help on this. @{Selected|%}{@{selected|character_name} Macro|PC Strength}