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

Macro Results with Descriptions

Hi! Am looking at making a macro that will work with a Spirit Bard's Tales from Beyond skill, where when they press it, it will roll the die and then also give the description for the result to try and save time finding and explaining it every time they roll for the ability.
1721107228
Gauss
Forum Champion
Hi AndrewC,  I am a bit confused by your post. Are you asking how you might do this? Or were you offering a solution for anyone else with this problem?
1721109167
Andrew R.
Pro
Sheet Author
I would do that with ScriptCards, but I'm sure the MetaScriptToolbox could do it too with Rollable Tables, etc., 
Gauss said: Hi AndrewC,  I am a bit confused by your post. Are you asking how you might do this? Or were you offering a solution for anyone else with this problem? Hi! Sorry, I am asking how someone could make a macro that would roll a d8 and then give a prompt based off the result, so it would look a bit like what I had posted. Sorry for my bad formatting. 
1721109785

Edited 1721109899
Gauss
Forum Champion
If you are the Game Owner you can do that with a Mod (API Script) as Andrew stated.  However, if you are not, and the Game Owner does not have a Pro account, this would require a lot of work via Rollable Tables. I set that up in one of my own games once.  Unfortunately, Rollable Tables are only accessible to GMs in a game, so if you are a player your GM would need to set it up or temporarily promote you so you could set it up.  Please state which option you'd like to go with so folks can narrow the assistance to that option.
Which character sheet are you using?
1721162191
timmaugh
Pro
API Scripter
Hi, AndrewC... As Andrew R. pointed out, you could do this with metascripts. Fetch (part of the Metascript Toolbox), offers a way to retrieve items from a rollable table based on value. That means you can use rolls, modifiers, etc., to retrieve a specific item from the list. In short, Fetch builds a list of items from the table and assigns sequential ranges to the options based on the "weight" given to that entry. If an entry has a weight greater than 1, it will be returned for the sequential series of values equal to the weight proceeding from the previous entry. In other words, if the first item in the table has a weight of 1, it will be returned by referring to the value of 1. If the next item has a weight of 3, it will be returned for the values 2, 3, and 4. Maybe it's just easier to see it. Assumptions I'm Making Looking at your example, I am assuming that the 5 you rolled for "Spirit Roll" is the d8 which then should choose which output you get for the second template (the information you want to convey as a part of having rolled that value on the d8). I am also assuming that the "1" in the second template statement is simply a reference to the number of info components you have to convey (i.e., bullet points), or that it is otherwise unrelated to the decision making you're trying to automate. Setup Create a rollable table for your secondary output (the second template statement in your example image). I'll call this table TalesFromBeyondDescriptions .  Add entries to this table for each of the possible outcomes. Each entry should be the full template statement of the second output. For instance, from your example image, it would look something like this (I'm not sure where the roll for "Sneak" is coming from, so I'm going to fudge that): &{template:default}{{name=Result}} {{1=Tale of the Clever Animal. For the next 10 minutes, whenever the target makes an Intelligence, a Wisdom, or a Charisma check, the target can roll an extra die immediately after rolling the d20 and add the extra die's number to the check. The extra die is the same type as your Bardic Inspiration die.}} {{Sneak=[[1d20]]}} Create somewhere to house the following command line (I would suggest a macro-mule character , but you could probably do it as a macro): !{{(^)   {^&template:default}{{name=Tales From Beyond}}{{Spirit Roll=[[1d8]]}}   @^(table.TalesFromBeyondDescriptions.$[[0]].value) }} Run that command, and you will get an output like what you show. Alternate Setup for Alternate Output You wouldn't need to have two separate template statements just to return this value using the Metascript Toolbox. Instead, you could include the extra rows that make up the "Result" template as a part of the original template statement. To get all of this information as part of a single template command, you would create the same table and populate the entries, but this time the entries would be just the template parts that you want to add to the single template statement. Again using your example, that would make for an entry in the rollable table that read: {{ 1=Tale of the Clever Animal. For the next 10 minutes, whenever the target makes an Intelligence, a Wisdom, or a Charisma check, the target can roll an extra die immediately after rolling the d20 and add the extra die's number to the check. The extra die is the same type as your Bardic Inspiration die.}} {{Sneak=[[1d20]]}} Note that this is just the template parts, not the entire template statement. Also note that I included a space before the 1 to make sure it didn't auto-sort itself to the top of the template output when it's all said and done. With this sort of setup, your executing command line simplifies to something like: !&{template:default} {{name=Tales from Beyond}} {{Spirit Roll=[[1d8]]}} @(table.TalesFromBeyondDescriptions.$[[0]].value) {&simple} That would create a single-template output that looked more like: Required Scripts Metascript Toolbox