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

Can GMNote whisper to select Tokens?

I would like to be able to use GMNote to whisper select tokens. This would be useful to display text to just specific characters within vision distance, who made a perception check,  or some other check.  Is this currently possible? Is there another way to accomplish this?   Thanks,  
1539157724
Robin
API Scripter
I'm not exactly sure what you mean. You want a handout with some text in the gmnotes, and when a player does a perception check with the right amount it should whisper them the text in the handout?
I do not need to it be automatic based on a check result.  I use the GM notes on an invisible token to manage map events.  I whisper the entire description to GM, and it includes command buttons for various location descriptions dependent on player decisions and events.  GMNOTES lets me send tagged description areas (description 1, description 2, image 1, etc) to chat for all players.  I would just like to be able to whisper output to just specific selected player tokens as well. The chat buttons below send the image and description sections to all players as needed, but in many cases not all players should receive the output based on their location, abilities, and skills. I hope this clarified my intent and use-case. 
1539173676
Robin
API Scripter
Oh, wait, I misread it, GMNote is a script? I thought you just meant the gm notes in a token. Is it this script? on('ready',function(){           'use strict';                  on('chat:message',function(msg){               if('api' === msg.type && msg.content.match(/^!wgmnote/) && playerIsGM(msg.playerid) ){                   let match=msg.content.match(/^!wgmnote-(.*)$/),                       regex;                   if(match && match[1]){                       regex = new RegExp(`^${match[1]}`,'i');                   }                                                          _.chain(msg.selected)                       .map( s => getObj('graphic',s._id))                       .reject(_.isUndefined)                       .reject((o)=>o.get('gmnotes').length===0)                       .each( o => {                           if(regex){                               let lines=_.filter(decodeURIComponent(o.get('gmnotes')).split(/(?:[\n\r]+|<br\/?>)/),(l)=>regex.test(l)).join('\r');                              sendChat(o.get('name'),'/w gm '+ decodeURIComponent(o.get('wgmnotes')));                           } else {                               sendChat(o.get('name'),'/w gm '+ decodeURIComponent(o.get('gmnotes')));                           }                       });               }           });       });
1539177956
The Aaron
Pro
API Scripter
It would be easy to add a button to the output when it’s whispered to the GM that would repeat the whisper to characters represented by the selected tokens. There are some other options, but that might be the easiest. 
1539178895
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It's hard to say exactly how to approach it without an example of one of your embedded API buttons. In general, you can format a directed whisper with a roll query: /w ?{Whisper|name1|name2|name3|name4|name5} ?{what do you wish to say} but putting a roll query inside of an API button, inside of a GMnotes script call might require some tweaking. I have a feeling it would call the roll query upon putting the notes into the chat window, regardless of whether you pressed the button.
The embedded buttons just include GMNOTE calls (!GMNOTE-Image 1, etc.) that send a specific Token GM note section to chat.  I will look into repeating the GM whisper to targeted players.  I think that might be a viable option.  Thanks All.  I will keep you posted.  
1539220901

Edited 1539221982
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I have created a duplicate GMnotes script that does not whisper, called PCNotes , and hacked in a footer in my GMNotes script that calls the PCNotes script. The footer appears at the bottom of every GMNotes output. Incredibly inelegant, but those who can't program, hack together monsters from dead body parts. I've frequently sat down and tried to create my dream AllNotes script, but eventually, my eyes cross, the hunchback who formulates my Regex expressions goes on strike, and the gentle villagers of the nearby town of Scriptenberg light up their torches and bring their pitchforks up to Curtis Castle demanding I cease and desist.