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

Table with a modified die roll (API)

Hello, I feel like this is completely impossible or so easy no one ever mentions it, because I have been searching and cant find an answer.   I have 9 possible outcomes which are the result of a 1d4 +Con Modifier.  How do I make a button that I can click and the highlighted token will get a written result. Ex.  1 You are awesome 2 You are great 3 Great job 4 Tough Guy 5 Your ripped 6 Be my valentine 7 critical success 8 you win!
1664830179
timmaugh
Forum Champion
API Scripter
Interesting that you bring this up. Muler (and ZeroFrame) can do that, though in the current form it would require you to build your table as a Mule (an ability on a character sheet): <=1=You are awesome 2=You are great 3=Jingle jangle 4=Widdershins Spanklebits 5=Spectralescent 6=Volcano Man 7=Actual Cannibal >=8=You know jiu jitsu I say it's interesting you bring this up because I am working on a new release for Muler and only about a half-hour ago I realized that I can have it read a Roll20 rollable table in order to construct a mule on the fly... reading the relative weights of the entries. So you can try Muler in its current form, or wait a day or 2 and try the new version. Or both. In the current form, you'd use something like this to get the value: get.character.mule.[[1d4+@{selected|con_attribute}]].value/get (changing each of the underlined parts to match your particular setup) ...and something like this to load the mule to make that table available: {&mule character.mule} Finally, if you are returning this value to another script, that's the end of what you have to do. However, if you just want to report the value to chat, use {&simple} . For example, let's say you create a mule (an ability) named ConRollOutcome  on a character named MuleBoy . Also, let's say that your CON attribute is named con_attribute,  And you wanted to just output the value. That could look this: !The result of the roll is: get.MuleBoy.ConRollOutcome.[[1d4+@{selected|con_attribute}]].value/get {&mule MuleBoy.ConRollOutcome}{&simple} Or, as a part of a roll template: !&{template:default}{{name=Static Access Table Demo}}{{Result=get.MuleBoy.ConRollOutcome.[[1d4+@{selected|con_attribute}]].value/get}} {&mule MuleBoy.ConRollOutcome}{&simple} Almost all of that will stay the same once I get the rollableTable-to-Mule code added to Muler, except that the syntax of the {&mule} statement might change slightly to let the parser know you're looking for a table instead of a character ability.
1664832597

Edited 1665000399
Kofi
Pro
Thank you for the reply.  I will start tinkering with this.  It will probably take me 2 days to make headway so do let me know what you get the final version.   EDIT: After many many, many hours of tinkering with this, I finally figured out that "Muler" is a API Mod I need to install. LMAO!