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

How do I setup a "Narrator" emoting with a quote when someone rolls a Nat 1 or 20?

 I'd like to setup a Narrator NPC like in Darkest Dungeon. Anytime someone rolls a natural 1 or 20 have the "Narrator" do an /em and say something like.. "Ghoulish horrors, Brought low and driven into the mud!" Image below of what I'm trying to have it look like,
1721933376
Gauss
Forum Champion
For whoever can help, for more background information, this came up initially on Reddit in this thread . 
1721934883
Gold
Forum Champion
This is one way to do it, It's a Mod API snippit. Meaning it's not in the One-Click for Mods, but you can just COPY this and PASTE it in a custom Mod API and save it with a name like AnnounceNats.js or something.&nbsp; It's a green line of text as-is, it's not an /em -- so some work would be needed to get it looking exactly as you asked for.&nbsp; // Github:&nbsp; &nbsp;<a href="https://github.com/shdwjk/Roll20API/blob/master/AnnouncRoll/AnnouncRoll.js" rel="nofollow">https://github.com/shdwjk/Roll20API/blob/master/AnnouncRoll/AnnouncRoll.js</a> // By:&nbsp; &nbsp; &nbsp; &nbsp;The Aaron, Arcane Scriptomancer // Contact:&nbsp; <a href="https://app.roll20.net/users/104025/the-aaron" rel="nofollow">https://app.roll20.net/users/104025/the-aaron</a> var AnnounceRoll = AnnounceRoll || (function() { &nbsp; &nbsp; 'use strict'; &nbsp; &nbsp; var version = '0.2.2', &nbsp; &nbsp; &nbsp; &nbsp; lastUpdate = 1427604233, &nbsp; &nbsp; checkInstall = function() {&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log('-=&gt; AnnounceRoll v'+version+' &lt;=-&nbsp; ['+(new Date(lastUpdate*1000))+']'); &nbsp; &nbsp; }, &nbsp; &nbsp; handleInput = function(msg) { &nbsp; &nbsp; &nbsp; &nbsp; var rolldata,out=[]; &nbsp; &nbsp; &nbsp; &nbsp; if (msg.type !== "rollresult") { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; rolldata = JSON.parse(msg.content); &nbsp; &nbsp; &nbsp; &nbsp; _.each(rolldata.rolls,function(r){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if('R' === r.type &amp;&amp; 20 === r.sides) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _.each(r.results, function(roll){ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch(roll.v) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 1: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out.push('&lt;div style="color: #009900;font-weight: bold"&gt;Nat 1.. The Narrator says it's a ghoulish horror! &lt;/div&gt;'); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 20: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out.push('&lt;div style="color: #009900;font-weight: bold"&gt;NATURAL 20! The Narrator is excited for you. &lt;/div&gt;'); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; }); &nbsp; &nbsp; &nbsp; &nbsp; if(out.length) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sendChat('',out.join('')); &nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; }, &nbsp; &nbsp; registerEventHandlers = function() { &nbsp; &nbsp; &nbsp; &nbsp; on('chat:message', handleInput); &nbsp; &nbsp; }; &nbsp; &nbsp; return { &nbsp; &nbsp; &nbsp; &nbsp; CheckInstall: checkInstall, &nbsp; &nbsp; &nbsp; &nbsp; RegisterEventHandlers: registerEventHandlers &nbsp; &nbsp; }; }()); on('ready',function() { &nbsp; &nbsp; 'use strict'; &nbsp; &nbsp; AnnounceRoll.CheckInstall(); &nbsp; &nbsp; AnnounceRoll.RegisterEventHandlers(); });
Scripts needed:&nbsp; emas &nbsp;and&nbsp; CustomizableRollListener This will listen for rolls on the 'D&amp;D 5E by Roll20' sheet and output your message if a 1 is rolled. You'll need to create a different one for 20s that are rolled and change 'roll=fumble' to 'roll=critical'.&nbsp;&nbsp; !crl \\create,name=Natural1s,template=spell atk atkdmg npcatk npcfullatk,text=##,roll=fumble, \\!emas The Narrator "Ghoulish horrors, Brought low and driven into the mud!" If you want to roll on a table for the output, that will require some more fiddling, as CustomizableRollListener doesn't handle rollable tables natively.
Jarren, Not to hijack this thread but I was playing around with CustomizableRollListener recently as well and couldn't get the roll=critical or roll=fumble to match but I didn't also add text like you have. Is the text=## required even if you don't really want to match on any text?&nbsp;
Joshua N. said: Jarren, Not to hijack this thread but I was playing around with CustomizableRollListener recently as well and couldn't get the roll=critical or roll=fumble to match but I didn't also add text like you have. Is the text=## required even if you don't really want to match on any text?&nbsp; Yep. The '##' is required to match on a roll. From the in-game help doc: &nbsp;text - What text must be present in the chat message for the listener to react. Inline roll locations are designated with "##". Multiple separate texts can be defined for a single listener by separating them with "&amp;&amp;". The listener will only respond if all of these texts are present. CRL is a cool script, but quite outdated at this point and doesn't have a lot of error checking built in so it can be pretty fiddly to work with.