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

Wild surge table setup for Tasha's Barbarian

It's not the biggest table to worry about but I'm basically braindead when it comes to understanding the coding for macros, could anyone help me out here?
1611796027

Edited 1611796051
David M.
Pro
API Scripter
You can roll on the table using the syntax [[ 1t[TableName] ]] then put it into the template of your choice.  Here's an example using the npctraits template (if you are using the 5e OGL sheet) and a table name of BarbWildMagic &{template:traits} {{name=Wild Surge!}} {{source=Path of Wild Magic}} {{description=[[ 1t[BarbWildMagic] ]]}} Note that unless you use an api script like RecursiveTable , the die rolls in the table entries will not be rolled for you, so the 1d12 necrotic damage for a roll of "1" will just output the text "1d12". 
1612052483

Edited 1612092281
David M.
Pro
API Scripter
FYI, Kurt J just shared a new version of Powercards called "ScriptCards". It's really powerful. I was playing around with it today and decided to use the Barbarian wild surge feature as a test case. This doesn't use a rollable table, but rather has all the text in the macro itself. Probably not how I would have approached the problem from the get go, but like I said it was more of an experiment for me with the new script. You can find the macro code I used on the ScriptCards thread here . It does all the extra rolls for various damage types and calculates the save DC's, etc. Sample output
see, this is what I mean by braindead on my end, I wouldn't know where to start, I'm trying to make it easier on speed and the parties eyes on seeing script from bugging out every time I see it, I just don't understand where to start, nor if I can understand the basics.
1612109932

Edited 1612109959
David M.
Pro
API Scripter
Sure, np. The easiest solution is to create a rollable table with 8 items and paste the text for each wild surge type into them, then create a macro with the code in my first post (assuming you are using the 5e by Roll20 character sheet). If you need help with this part, let me know and I can step you through it. Some general notes: the macro in my first post is using a roll template (see wiki on roll templates ). Specifically, it is using the "traits" template that is available in the 5e by Roll20 sheet. Each of the text strings inside of double brackets {{...}} is parsed and formatted to create the nice looking output. Sometimes there are blocks that are required, and sometimes they are optional. Look over the 5e templates wiki and play around with a few of them to see how they work. You can start by just copying the generic examples into a macro (or directly into chat) and then changing some of the values to the right of the = sign. E.g.  &{template:traits} {{name=Traits Name}} {{source=Source:Source type}} {{description=Trait description}} The double square bracket syntax I used is called an inline dice roll  (this link has all kinds of good information on dice rolling in Roll20). Everything inside of [[...]] gets treated as if you typed /roll XXX into chat. Inline roll formatting is required if you are using a roll template because using /r will not work inside of one. So, typing [[ 1t[TableName] ]] is the same as typing /r 1t[TableName]. It is telling the roll parser to roll 1 time on the table called TableName. We didn't use any in our example, but you can reference attributes on a character sheet with the syntax @{CharName|AttributeName}, or for the selected token's character sheet with @{selected|AttributeName}. You can see the attributes on your character sheet by going to the "Attributes and Abilities" tab on the sheet. So, for example if you wanted to display the DC for any of the saving throws required by the Barbarian wild surge feature (8 +proficiency bonus +CON modifier, you would use 8 + @{selected|pb} + @{selected|constitution_mod} (Again assuming the 5e OGL sheet).  The API script solution is admittedly pretty complicated to create relative to most macro solutions, though using it in game is quite simple. It's probably best to leave that for another time until you are more familiar with the basics of creating macros. Let me know if there is anything else I can do to help clear things up!