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

Script to ask a player to roll a hidden roll (Stealth, Perception, etc.)

Hi, I've been looking at the library, but I can't say that I've seen something that does exactly this, asking a player to click a button in the chat, the result being a d20 rolled that only the DM can see.(a bit like "roll your dice behind my screen, please). Bonus if the DM can select the ability for the roll and add the modifier to the roll. I'm not adverse to writing scripts myself, but I must say that I'm a bit lost about that one, some of the concepts of the scripts are very obscure to me... So if it does not exist, a few pointers would be appreciated. Thanks in advance, Philippe
1509719848

Edited 1509720828
The Aaron
Pro
API Scripter
I don't know of any scripts that do that.  If you're going to write it yourself, the basic order of operations you've sketched out would be something like this: [DM] executes a command to prompt the player.  He specifies the player, what the roll is, and a message to tell the player !get-roll "Bob Smith" 1d20+@{Slayer Bob|dex}+@{Slayer Bob|stealth} --Hey Bob, I need a secret blind stealth roll from you! [API] Stores the details of the roll with some identifier [API] Issues a chat message whispering an API Command Button to the player /w "Bob Smith" [Hey Bob, I need a secret blind stealth roll from you!](!fill-roll SOME IDENTIFIER) [Bob] clicks the button, issuing the command [API] Checks the identifier against the stored details it has for rolls Success:  Sends a message to the player thanking them for their roll. Performs the roll and whispers the results to the GM. Removes the details for the identifier. Failure: Sends a message to the player stating that roll has been filled already There's quite a bit of fiddling around just to give the player agency in their roll.  They won't actually be rolling anything, so you could just shortcut all of that and whisper them a button that does nothing and do the roll yourself: /w "Bob Smith" [Hey Bob, I need a secret blind stealth roll from you!](!
/w gm "Yes, make that roll for me") /w gm [[1d20+@{Slayer Bob|dex}+@{Slayer Bob|stealth}]] Slayer Bob's Stealth Roll
1509719902
The Aaron
Pro
API Scripter
However, if you want to see an example of that sort of delayed action message prompting, you can look at my Mutant Year Zero dice roller.  Players have the option to Push, and it uses the same system of storing the details in the API and triggering the additional rolls at player action.
Is that macro missing a closing parenthesis? EDIT: the forum ate the html replacement, but I don't know how to fix that. /w "Bob Smith" [Hey Bob, I need a secret blind stealth roll from you!](! /w gm "Yes, make that roll for me" )
1509720905
The Aaron
Pro
API Scripter
Yup, it was.  I put them as separate lines because the button is only intended to report assent. If it also rolled, the roll would be displayed to the player.  The intent is that you'd send the button to the player, they'd click their assent, then you'd issue a command as gm to whisper yourself the result.
The Group Check script could also be helpful. It allows you to roll whatever for any number of players with just one click. I use it all the time. For us who played a long time around a table, it is a bit disturbing at the beginning that (as a player) you do not click or see anything. But anyway, if you do not trust your dm/gm, how can you play in her/his campaign? So players get used quickly to such 'non-output' scenario. 
1509814925
The Aaron
Pro
API Scripter
That’s one reason I like passive skills in 5e. =D
Thanks for all the good replies. Just to start with, passives solve a lot of things indeed, but not all of them, there are in particular two cases when I'd like a hidden roll from the player without him having no idea what he rolled: One is the roll when the player does something actively but I'd rather that he (and the other players) does not know the results because it would influence the play of the game. The best example is Stealth, I have this group where some of the guys are really good at proceeding even though they know that they rolled a crap result, but where some others will immediately begin to meta-game around this and do actions that prepare them for them or the other guy having rolled badly. But there are other cases like intimidate, perception, insight, etc. The other case is a sort of luck / random encounter where for example they fall in the water in Port Nyanzaru while chasing smugglers and I'd like to know whether there are crocodiles in the water or, maybe, how close they are :) . My style of DMing is that the players doing the roll raises their stress level and involvement because they don't really know what the roll means, they just have that 6th sense feeling that something might  be happening. :) In a sense the shortcut that the Aaron proposed sort of does the trick, but not completely, I think I'll investigate the route suggested up front, thanks !
1509922335
The Aaron
Pro
API Scripter
There's a Blind Roll script you can use to just issue blind rolls from a player.  One thing you might do is tell them that on a skill where they shouldn't know what they go, they use their skill as normal, but you'll be adding a 1d20 to their d20 roll and taking the modulus, so that they don't know what the actual is.  For example, they might roll 17+8 for 25, but you'll be then doing [[ ((17+1d20)%20)+8]].  You might roll a 14 so they really got a 19 roll.  Then they can feel like they are getting something and you can get a number that's not known. =D
Thanks a lot, I have heavily borrowed from your original script and came up with something that actually works (considering that it's the first time that I program using javascript, it's something of a miracle). It's probably not robust, but I think that the basis are there. Testers are welcome, all suggestions are appreciated. Usage is:&nbsp; !brr (Target|*) [Skill [Bonus]] You can specify a target or you can put * so that it is sent to all the players (It's in a /em because I did not find another option that worked, suggestions are welcome). So, simplest form is: !brr Vecna &nbsp;to ask for a simple roll from Vecna !brr Vecna Stealth to let him know that it's a stealth check !brr Vecna Stealth 6 &nbsp;to let him know that it's going to be made with a +6 bonus For me, the intent is for it to be called from a macro (and more precisely a token action), with the skill and value computed by the macro from a character sheet. // Github: &nbsp; BlindRoll.js // By: &nbsp; &nbsp; &nbsp; Philippe K., Great Old One // Contact: &nbsp;<a href="https://app.roll20.net/users/321064" rel="nofollow">https://app.roll20.net/users/321064</a> var BlindRoll = BlindRoll || (function() { &nbsp; &nbsp; 'use strict'; &nbsp; &nbsp; var version = '0.0.1', &nbsp; &nbsp; &nbsp; &nbsp; lastUpdate = 150995981, &nbsp; &nbsp; &nbsp; &nbsp; roller, &nbsp; &nbsp; &nbsp; &nbsp; rollN = 0, &nbsp; &nbsp; &nbsp; &nbsp; skill = "", &nbsp; &nbsp; &nbsp; &nbsp; bonus = 0, &nbsp; &nbsp; &nbsp; checkInstall = function() { &nbsp; &nbsp; &nbsp; &nbsp; log('-=&gt; BlindRoll v'+version+' &lt;=- &nbsp;['+(new Date(lastUpdate*1000))+']'); &nbsp; &nbsp; }, &nbsp; &nbsp; handleInput = function(msg_orig) { &nbsp; &nbsp; &nbsp; &nbsp; var msg = _.clone(msg_orig); &nbsp; &nbsp; &nbsp; &nbsp; if (msg.type !== "api") { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return; &nbsp; &nbsp; &nbsp; &nbsp; } // brr - Blind Roll Request, sent by the GM, Format is !brr (Target|*) [Skill [Bonus]] if(msg.content.indexOf("!brr ") !== -1) { var params = msg.content.replace("!brr ", "").split(" ",3) roller = params[0]; rollN = Date.now(); var chatCommand = (roller == '*' ? "/em" : "/w "+roller); switch(params.length) { case 3: skill = params[1]; bonus = params[2]; sendChat("GM", chatCommand+" [Blind "+skill+" Roll - Modifier "+(bonus &lt;0 ? '' : '+')+bonus+" ](!bra "+rollN+") ", null, {noarchive:true} ); break; case 2: skill = params[1]; bonus = 0; sendChat("GM", chatCommand+" [Blind "+skill+" Roll](!bra "+rollN+") ", null, {noarchive:true} ); break; default: skill = ""; bonus = 0; sendChat("GM", chatCommand+" [Blind Roll](!bra "+rollN+") ", null, {noarchive:true} ); } } // bra - Blind Roll Answer, send back by the button in the chat of the target if(msg.content.indexOf("!bra ") !== -1) { if (rollN == 0 || msg.content.replace("!bra ", "") != rollN) { sendChat("GM", "/w "+(roller == '*' ? msg.who : roller)+" Only one roll, please..."); } else { sendChat("GM", "/w "+(roller == '*' ? msg.who : roller)+" Thanks for the "+(skill == '' ? '' : skill+' ')+"roll!"); sendChat((roller == '*' ? msg.who : roller), "/w GM Blind "+(skill == '' ? '' : skill+' ')+"Roll [[d20"+(bonus &nbsp;&lt; 0 ? bonus : '')+(bonus &nbsp;&gt; 0 ? '+'+bonus : '')+"]]"); rollN = 0; } } &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; }; &nbsp; &nbsp;&nbsp; }()); on('ready',function() { &nbsp; &nbsp; 'use strict'; &nbsp; &nbsp; BlindRoll.CheckInstall(); &nbsp; &nbsp; BlindRoll.RegisterEventHandlers(); });