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

Seeking [Help] on Creating Chat Output that "Builds" on a Roll

1503779468

Edited 1503779577
GM Matt
Sheet Author
I am hoping to create some jscript that helps players to "build" die roll results in Torg Eternity. I don't THINK this is complicated, but I have limited experience with sheet building and zero experience with jscript, so I am just hoping for someone who can point me in the right directions to do this. So...first, a little about how the pen and paper mechanic works: A player rolls a d20 that explodes on 10s and 20s. The total of all die rolls is then compared to this chart/logarithm: The "bonus" value is then added to a skill value to create something called a "skill total." This skill total is then compared to a difficulty to determine failure (total less than difficulty), standard (total equals or exceeds difficulty up to 4 points), good (total exceeds difficulty from 5-9 points), and outstanding (total exceeds difficulty by 10+ points). So far, so good. I have access to macros that get me this far, and that put all of this into a chat output. But the game mechanics aren't done yet. There are ways to spend game resources to roll more d20s - multiple times, in fact if you really need it. Additionally, there are mechanics that let a player add +3s (again, multiple times) to their bonus number. So.... what I would like ideally is to see chat output that works like this. (1) Player rolls on a skill, inputting the difficulty given by the GM. Chat output shows dice rolled, bonus number, difficulty, and "current" success level (standard, good, outstanding). (**Okay...again, so far, so good...I am pretty sure that I can get myself this far**). (2) At the bottom of this chat output are three buttons or (preferably) hyperlinks, which read: "Roll another d20,"  "Add +3," and "Accept Results." When a player decides to spend a game resource, they click the appropriate hyperlink, which leads to another chat output like the one we saw in step (1), above, but which takes into account the additional d20 that was rolled and/or the +3 bonus that was selected. **This output, likewise, includes all three buttons/hyperlinks from the original output.** (3) When "Accept Results" is clicked, a chat output showing the final result is displayed. There are two "problems" from the standpoint of my working knowledge that are created by this scenario: (1) Creating the buttons/hyperlinks, and (2) Creating and updating the variables needed to track the running die total and +3 bonuses added. As I said, any help that at least points me in the right direction for coding examples, etc. would be greatly appreciated.
1503838099
The Aaron
Pro
API Scripter
This is functionally very similar to the Push mechanic from Mutant Year Zero. In the script of the same name, there's a "push" button that repeats the same Roll with updated info. It handles things like not letting older buttons get used and restricting the rolls to the person that rolled it (or the GM). You could look at it for reference.  Buttons inthe API are just HTML links where the href is a chat command. You can use inline styles to make them look however you like.