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 .
×

Macros- Automated Commentary on Result

1519045909

Edited 1519046024
Hi! Very script/macros ignorant n00b here. Was messing around with *very simple* macros and thought it would be awesome to have commentary on a roll result. Ex: I fumble on a 'To Hit' roll which is automatically followed by, "Well *that* didn't go like it did in my head." Or let's say I roll a 20 which is automatically followed by, "You're gonna feel this one in the morning." I cannot imagine there hasn't been an inquiry regarding this topic in the past but half a day of Google-Fu has not yielded results. Could anyone let me know if this is possible and if so, please direct me to a source that might be able to help me with this endeavor? Thank you very much for your time!
You could use a rollable table.  Create a table named Attack, with 20 lines numbered 1 to 20, and for any where you want a comment, just add it after the number.  The weight by default will be equal, so with 20 lines, you have a d20 in essence, but with comments as part of the result.  The macro can call the table by name.  The macro can be roll-attack, and have the line [[1t[Attack]]].  I don't know why, but in my experiment with this idea, when the first character on the rollable table line is a number, the rest of the line is ignored.  So instead of a line that says "1, you look foolish!" you need to start with a letter, like "Ha ha! a 1! You look foolish!"
1519050414
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
While Valerie's suggestion is a good one, it won't quite work because roll tables that start with a number resolve to that number, ignoring the text afterwards. Swapping the text and number means you can't use it with modifications. What system/sheet are you using Greg?
1519101430

Edited 1519102036
Thank you both so much for your replies! Pretty slick work-around attempt Valerie! And thank you for the advice Scott. What system/sheet are you using Greg? I don't even know if I'm answering this correctly but my char. sheet is a PCGen 'Standard'. I'm not using a sheet within Roll20. I'm in the middle of attempting to set one up but so *very* much of it is above my head. Regarding the system info, I do not know how to find that out. However, a message in the group chat tells me that I'm using a 'Legacy' version of roll20. Regarding the macros proper I'm using the *most rudimentary* of methods which don't reference a sheet: /me readies a melee attack★ vs target's AC /roll 1d20+1 I'm guessing the short answer to my question is a 'no' and the long answer is 'maybe, but it's beyond you' ^o^ EDIT: Regarding modifications. Let's say I have a 1d20+3, in that event would I just make 23 lines? In the event that my mod increases, I would just add a new line. *In theory* (despite probably being inefficient overall) would that work?
1519104695
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, there's a way to do this with a Roll20 character sheet, but sounds like that won't work for you. For your edit, no, you'd just change the distribution of the table.your new min would be 4, your new max 23.
1519105126
The Aaron
Pro
API Scripter
The Rollable Table becomes a bit onerous when you need to account for bonuses. You’d need to remove from the lower end and add on the higher end. The effect is that you’d always have 20 rows, but if your Roll was 1d20+3, they’d go from 4 to 23. You might be better off having a regular roll of [[1d20+3]], then follow it up with whispering some buttons to roll from a table of results, one for crit fail and one for crit success. That has the added benefit of variety in the responses and choosing if a situation warrants brevity over levity.  To get a truly automated commentary would require the API, a Pro subscriber perk.  
Scott & Aaron, thank you both for the information. Scott, if I ever get my Roll20 sheet sorted, may I contact you again? It's not for lack of desire, it's just overwhelming ^o^ Aaron, I'm interested in the subscriber perk you mentioned. If I'm a subscriber might I apply the feature, or would that require our GM to subscribe? Also, are there tutorials for how I might accomplish this through API? I'm concerned about subscribing, then being granted the materials *but having no clue how to utilize them properly* ^O^
1519108228
The Aaron
Pro
API Scripter
Ah, the creator of the game would need to be the Pro Subscriber. The API is written in JavaScript. There are various general purpose tutorials around and bunch of helpful peeps in the community that assist with people learning scripting the Roll20 API, or flat out do it for you. 
Great info and much appreciated! Thank you for your time!
1519134427
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
You'rewwelcome to contact me Greg, however, there are others on the forums who know a lot more than I. Also, keep in mind that a custom char sheet also requires the creator of the game to be a pro subscriber (and honestly you need pro to develop it too)
i created a crithit and miss table and use another API call roll lisner and place the crit hit and miss in the DESC field so it is rolled all the time and when needed can be referenced for a crit hit or miss.