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

Moving a macro that creates chat buttons which roll on tables into a macro mule

1614941444

Edited 1614941570
I'm sure anyone who understands the title of this topic will be able to help me out :-) For a while now I have been using a macro that creates a set of buttons in chat (allowing players to click on them) where each button rolls on a different rollable table. It has been working fine with no problems (I forget where I got all the syntax for this macro, but it was bound to be from these forums!). The macro that creates the buttons looks like this: &{template:default} {{name=Select CRIT Table:}} {{Critical HIT=[Melee](`#chm) | [Ranged](`#chr)}} {{Critical MISS=[Weapon](`#cmw) | [Spell](`#cms)}} This creates 4 buttons labelled "Melee", "Ranged", "Weapon" and "Spell" in a nice format. Each button runs a separate macro (called chm, chr, cmw, cms), each of which performs a roll on a different rollable table. An example of what one of these macros looks like is here: &{template:traits} {{charname=Critical Hit Melee}} {{name=Critical Hit Melee}} {{source=Table}} {{description=[[1t[Crit-Hit-Melee]]]}} This all works lovely when the macros are stored in the macro list - the first macro displays the table in chat and when you click on one of the four buttons in this table, it rolls on the appropriate table and displays the result, like this: However, I wanted to move the macros into a "macro mule" character in order to easily copy between games. But when the macros are contained within attributes of this character, they stop working (the buttons are created by the first macro, but when you click on them, it just displays "#chm" or similar). I have tried substituting " %{Tableroll|chm}"  (where Tableroll is the name of the macro mule character) but this doesn't work. I've also tried messing around with the &# syntax but I got quickly out of my depth (and managed to crash out of the Roll20 game!) Anyone have any ideas how I can make my macros work from within a character?
1614945994
Ziechael
Forum Champion
Sheet Author
API Scripter
You were warm... for abilities on a sheet the syntax is ~<ability>, to call from a specific sheet you create an attribute-esque call without the braces ~<name>|<ability This should work: &{template:default} {{name=Select CRIT Table:}} {{Critical HIT=[Melee](~Tableroll|chm) | [Ranged](~Tableroll|chr)}} {{Critical MISS=[Weapon](~Tableroll|cmw) | [Spell](~Tableroll|cms)}}
Ziechael, you are a genius, thank you :-) Works really well. The only issue now, and it is something that I can live with if it can't be changed, is that the buttons are displayed in that horrible pink background, rather than simple, clickable text in the original macros: I cannot remember which bit of syntax in the original macro prevented this pink background (or if it is transferable to the new syntax)
1614947425
Ziechael
Forum Champion
Sheet Author
API Scripter
It will have been the ` but putting it back in breaks it currently... will have a play...
1614947812
Ziechael
Forum Champion
Sheet Author
API Scripter
Been a while since I played with these things but this seems to work for me: &{template:default} {{name=Select CRIT Table:}} {{Critical HIT=[Melee](`%{Tableroll|chm}) | [Ranged](`%{Tableroll|chr})}} {{Critical MISS=[Weapon](`%{Tableroll|cmw}) | [Spell](`%{Tableroll|cms})}} Which sounds like something you tried initially but *shrug*
Hmmm. That doesn't work for me. It displays only "Critical Miss Spell" in a purple banner (i.e. the header of the table, where "Select CRIT Table" should be) with nothing below it, and nothing clickable.
1614949316
Ziechael
Forum Champion
Sheet Author
API Scripter
Hmm, might be as a result of the contents of the abilities, my basic test had no issues... back to the drawing board using your actual example now lol
1614949533
Ziechael
Forum Champion
Sheet Author
API Scripter
Yup, was me over simplifying it... remember how I said I was out of practice with these things ;) THIS should do it: &{template:default} {{name=Select CRIT Table:}} {{Critical HIT=[Melee](`!
%{Tableroll|chm}) | [Ranged](`!
%{Tableroll|chr})}} {{Critical MISS=[Weapon](`!
%{Tableroll|cmw}) | [Spell](`!
%{Tableroll|cms})}}
Woo Hoo! Works beautifully, thanks so much. You've made me a happy GM :-) Now if you could fix all the issues I'm having with UDL.... ;-) Thanks Ziechael, much appreciated
1614950803
Ziechael
Forum Champion
Sheet Author
API Scripter
You are most welcome... and I've never braved the waters of UDL personally... best of luck though lol
1615009930
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Chris A. said: I cannot remember which bit of syntax in the original macro prevented this pink background (or if it is transferable to the new syntax) The inline buttons you were seeing before came fro the Shaped Sheet roll template, which avoids the Roll20 Big Pink Buttons. If you are no longer using the Shaped Sheet, or wish to go back to inline links regardless of what sheet you are using, you could style them with the Stylus Extension: Inline Links on OGL Roll Templates   Default Roll Template Enhancement
1615026227
Ziechael
Forum Champion
Sheet Author
API Scripter
Pretty sure it was just the back tick, when I was testing to get it working (as seen in my screen shot) that was in a game with the 3.5e sheet enabled...
Yeah, I always use the DnD 5e by Roll20 sheet in my games (primarily for use with the Beyond20 extension to show rolls nicely from DND Beyond - we don't actually use populated sheets at all in R20).  I got the original syntax from elsewhere in these forums a few months ago when I was looking for a way to nest a rollable table call into a chat button. A neat trick when I found it, but I can't remember who posted it originally.