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

Need Help Creating a Macro for multiple Crit Hit rollable Tables

Hi, I've just spent the better part of the afternoon trying to figure this out, but I feel I'm just out of my depth.  I have created multiple rollable tables for crit hits based on damage type.  Now I'd like to create a macro that bundles them all with a click, allowing me to quickly choose the appropriate one (as seen in the example below made for conditions).  I start the macro with &{template:default}} {{name=Crit Hit}}  but after that I cannot figure out the coding to list each table I've created (bludgeoning, cold, fire, etc.).  I know the command to call up a table in the chat, but can't get it to work in a macro.  I appreciate any help that can be offered! Dave Rossi  
1590709914
GiGs
Pro
Sheet Author
API Scripter
Thats an interesting one. The way to do this is to make API Command Buttons as described on the wiki:&nbsp; <a href="https://wiki.roll20.net/API:Chat#Entering_API_Buttons_In_Chat" rel="nofollow">https://wiki.roll20.net/API:Chat#Entering_API_Buttons_In_Chat</a> BUT there doesnt seem to be a way that I can find to have this work with table rolls. So what you have to do is create a macro or ability, and but the table roll inside that. Then create a button that points to that macro. So say you have a table called crit-cold. Create a macro and put the command you normally roll it with, in that macro. For example. /roll 1t[crit-cold] Then give that macro a name, it can be identical to the table, so lets call it crit-cold . Now you create a button that calls that macro [Cold](!&amp;#13;#crit-cold) and you're all set.
Forgive me for being a knucklehead, but what do you mean when you say "create a button?"&nbsp; Further does that mean I can create a button for each damage type table I have and have them all come up as a block of choices?&nbsp; Thank you so much for your time!
1590711973
GiGs
Pro
Sheet Author
API Scripter
The picture you have above shows a bunch of buttons with labels like Blinded, Charmed, etc.&nbsp; Sorry, I assumed you know what they were.&nbsp; So yes, you can create a button for each type, if you create a matching macro for each type. Then if you want them to appear like the above, create a template like this &amp;{template:default}} {{name=Crit Tables}} {{ [Cold](!&amp;#13;#crit-cold)&nbsp; [Fire](!&amp;#13;#crit-fire)&nbsp; [Bludgeon](!&amp;#13;#crit-bludgeon)}} In this section: [Cold](!&amp;#13;#crit-cold) the bit in square brackets [Cold] is the button label. You can put anything there, that's what iwll appear on the button like the labels in the picture above. The bit in the round brackets&nbsp;(!&amp;#13;#crit-cold) is the command that does the roll. You just need to change the text at the end (crit-cold) to&nbsp;exactly&nbsp;match the name of macro you created. A Ward of Warning Buttons using code like this weird string !&amp;#13;# are fragile. If you ever re-open the macro they are in, this part will vanish: &amp;#13; and it will break the macro. So when you create them, keep the macro open till you have finished editing it. Then make a copy of the text and save it somewhere. Then close the macro and never open it again . If you really have to, make sure you have your copy handy.
1590712949
Oosh
Sheet Author
API Scripter
I would definitely champion a Macro Mule for this one, to avoid the HMTL replacement and to keep a big bunch of macros from flooding your Collections tab. The same as what GiGs has suggested, only you save all the macros under a character sheet called Macros (or whatever name you want) in the Abilities section, then call them with a slightly different syntax: [Cold](~Macros|crit-cold) Sorry if that confuses the issue, it looks like you're going to be making loads of macros though - you already have around 15 there and you're saying multiple tables! I'm worried about your Collections tab :)
1590742722
GiGs
Pro
Sheet Author
API Scripter
That is a better approach. I meant to add on something about checking that out, but I was a bit rushed.
Thank you, GIGs!!&nbsp; I would have never uncovered that #13 string of code! I appreciate you taking the time to help!
1590770115
GiGs
Pro
Sheet Author
API Scripter
You're welcome :)
Thanks Oosh.&nbsp; I've never used a character sheet for this purpose.&nbsp; Is there anywhere that shows step by step instruction on how to do this?&nbsp; Thanks!
1590770652
Kraynic
Pro
Sheet Author
It is out of the Stupid Tricks thread (the first post is an index) that is pinned at the top of this forum.&nbsp; There may be some other posts about it sprinkled in there, but the main 2 can be found here and here .&nbsp;
This is a very generous, kind collection of folks.&nbsp; Thanks everyone for your help!
OK so forgive the learning curve.&nbsp; I created a character sheet called DamageMacroCollector. In the abilities section I created a series of Macros: Crit-Acid, Crit-Cold, etc. that look like this:&nbsp; /roll 1t[Crit-Acid]&nbsp; Then I created a macro in that character sheet called Crit-Tables that looks like this: &amp;{template:default}} {{name=Crit Tables}} {{[Acid] (~Macros|Crit-Acid) [Cold] (~Macros|Crit-Cold) [Fire] (~Macros|Crit-Fire) [Force] (~Macros|Crit-Force) [Lightning] (~Macros|Crit-Lightning) [Major] (~Macros|Crit-Major) [Minor] (~Macros|Crit-Minor) [Necrotic] (~Macros|Crit-Necrotic) [Piercing] (~Macros|Crit-Piercing) [Poison] (~Macros|Crit-Poison) [Psychic] (~Macros|Crit-Psychic) [Radiant] (~Macros|Crit-Radiant) [Slashing] (~Macros|Crit-Slashing) [Thunder] (~Macros|Crit-Thunder) When I roll that macros, the only thing that shows up is this... Obviously I've done something incorrectly haha!&nbsp; Any help greatly appreciated!
1590885621
GiGs
Pro
Sheet Author
API Scripter
Try adding }} at the end
GETTING CLOSER! That brings this up, but they are not Buttons.
1590886661

Edited 1590887022
Oosh
Sheet Author
API Scripter
EDIT - I also just noticed you've said you called the character sheet DamageMacroCollector. That means you'll need to replaces (~Macros| with (~DamageMacroCollector| everywhere in the macro! It needs to match the name of the sheet where the macros are stored. Watch out for those spaces between your [] and (~), they will break the link! You can put a space or carriage return after the (~) link if you like, just not between it and the [LABEL]. The Thunder macro link in here for example, is moved a couple of lines down: &amp;{template:default}} {{name=Crit Tables}} {{[Acid](~Macros|Crit-Acid) [Cold](~Macros|Crit-Cold) [Fire](~Macros|Crit-Fire) [Force](~Macros|Crit-Force) [Lightning](~Macros|Crit-Lightning) [Major](~Macros|Crit-Major) [Minor](~Macros|Crit-Minor)[Necrotic](~Macros|Crit-Necrotic) [Piercing](~Macros|Crit-Piercing) [Poison](~Macros|Crit-Poison) [Psychic](~Macros|Crit-Psychic) [Radiant](~Macros|Crit-Radiant) [Slashing](~Macros|Crit-Slashing) [Thunder](~Macros|Crit-Thunder)}} So yeah - [Label](~MacroName) must be hard up against each other, but most fields within templates will allow carriage returns, unlike general macro syntax where a carriage return will send a blank line to chat. I can't see if you've specified which sheet you're using. If it's 5e, alot of people prefer the look of the other available templates. They have some different fields available, but if you are using 5e give this a try and see if you like it: &amp;{template:npcaction}} {{rname=Crit Tables}} {{description=[Acid](~Macros|Crit-Acid) [Cold](~Macros|Crit-Cold) [Fire](~Macros|Crit-Fire) [Force](~Macros|Crit-Force) [Lightning](~Macros|Crit-Lightning) [Major](~Macros|Crit-Major) [Minor](~Macros|Crit-Minor)[Necrotic](~Macros|Crit-Necrotic) [Piercing](~Macros|Crit-Piercing) [Poison](~Macros|Crit-Poison) [Psychic](~Macros|Crit-Psychic) [Radiant](~Macros|Crit-Radiant) [Slashing](~Macros|Crit-Slashing) [Thunder](~Macros|Crit-Thunder)}} Same content, but different look.
That's AMAZING! Thank you!&nbsp; One more question!&nbsp; I get the buttons as pictured below, but clicking on them doesn't access the rollable table.&nbsp; Any suggestions?
oh i need to change the macro name!! Got it. Sorry!
Now an aesthetic question.&nbsp; The table and buttons are working perfectly, thank you again!&nbsp; But clicking on the tables brings up results that look like this... Is there a way to give that a little more polish?
1590904825
Kraynic
Pro
Sheet Author
It usually cleans up rollable table output when you have it roll inside a template.&nbsp; Judging from what you are using for your menu, you might try something like this: &amp;{template:npcaction}} {{rname=Piercing Crit}} {{description=[[1t[Crit-Piercing]]]}}
Great result! Thank you Kraynic!&nbsp; Is there a place that lists what templates are available for this sort of thing?
1590915917
Oosh
Sheet Author
API Scripter
This page lists all the 5e sheet templates. It's missing a couple of fields for the npcatk template, {{type}} and {{typec}} fields, but apart from that it should have just about everything you need.