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 Request] GM Notes on chat.

1494826192
Nick S.
Pro
Marketplace Creator
Translator
Hello, I was wondering if there was any script out there that would show the GM Notes on the chat (only for the GM or for everyone). And preferably allow you to edit or replace those notes. For example selecting a token and typing !gmnotes would show "These are the GM Notes for Token 1" for the GM and !gmnotes --all would show it to everyone, and selecting the token and typing !gmedit --Blah, blah, blah would replace the gm notes with that text. In reality the most important thing is simply to show the GM the notes, the rest is a nice addition but not necessary. This would be useful when you have several rooms with their description, secrets, etc. to quickly check notes where a player is in, like in the image below, where the circled numbers are. Thanks!
1494845308
The Aaron
Pro
API Scripter
The way people usually do that is with a hidden token with the notes in one of the bars.  All the tokens represent a single Character (say "Notes") that has an ability as a token action which whispers the GM the contents of one of the bars.  You can write multiple Abilities, one for each bar and bar max, and get 6 different notes out of it.  You can standardize what you put in each bar so macros could then be named after the contents (bar1 might be atmosphere, bar1 max could be traps, etc).   Make a clear token with an aura that only you can see if you want it to be on the object layer.
1494966695
Nick S.
Pro
Marketplace Creator
Translator
Thanks Aaron! That seems like a plausible way to do it, but stubborn as I am I looked a bit more and found some code you wrote for something like that, so I grabbed it and barely changed it to use the 5e shaped style: on('ready',function(){ 'use strict'; on('chat:message',function(msg){ if('api' === msg.type && msg.content.match(/^!gmnote/) && playerIsGM(msg.playerid) ){ _.chain(msg.selected) .map( s => getObj('graphic',s._id)) .reject(_.isUndefined) .reject((o)=>o.get('gmnotes').length===0) .each( o => { sendChat(o.get('name'),'/w gm &{template:5e-shaped} {{title=GM Notes for '+o.get('name')+' }} {{text='+ decodeURIComponent(o.get('gmnotes'))+'}}'); }); } }); }); So far it does the basic function I needed. Now I'm checking if there's a way to make it so !gmnotes --"name" would return the notes of a token without having it selected, which might be useful if you know the names (if they're just numbers for example) and they're in the GM Layer. Also ran into some trouble with a few characters like “” and ’, as opposed to "" and ', which returns an error in the console. For now I just manually edit them, but I'll also try to look into that and see if I can replace the characters if they're encountered. Cheers!
1494966959
The Aaron
Pro
API Scripter
Cool. =D  Let me know if you need any help. =D
1494969391

Edited 1590416553
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Ha! I made those exact same modifications. Much later edit: I have made a substantial modification to this script, adding reporting options. It can be found here: Supernotes .