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

Token tooltips

Is there any way to give a token a tooltip? Using the D&D 5e Character Sheet, I have sheets for all of my monsters so that I can just drag add them onto the map to generate a token for them. When the token is generated: I change the name to 'Mob #', Roll up HP for the mob and set it in the token bar, and then read in the action names and descriptions and write them into the token GMNote. I have token macros to execute the selected tokens action 1,2,3,... Having the actions listed in the GMNote gives me an easy way to see which actions are in which slot for that mob, but it still means I need to double click the token, and then scroll down to see the GM Notes. It would be nice to have a tooltip like "1-Club, 2-Shortbow".
1426260851

Edited 1426260867
Yes, but it requires a script and a macro and would only appear when you click the macro.
Thanks, Can you point me to it so I can look at it?
1426262200
The Aaron
Pro
API Scripter
You might like these two scripts: TokenNameNumber -- automatically numbers tokens with %%NUMBERED%% in the token name MonsterHitPoint5e -- automatically rolls hit points based on an attribute (it's named 5e because it works with the 5e npc sheet, but easy to adjust to anything) You could setup a macro that whispers the contents of the GM note to you, so you can highlight the token and hit the macro to see a reminder of it's options.
Excellent idea, Thanks.
1426262882
Ziechael
Forum Champion
Sheet Author
API Scripter
The Aaron said: You could setup a macro that whispers the contents of the GM note to you, so you can highlight the token and hit the macro to see a reminder of it's options. At the risk of a can of worms... how would one do such a thing?
1426263755
The Aaron
Pro
API Scripter
It would have to be back-ended to a script. The outline of which would be: for each selected token, get the token object, get the gmnotes (via callback) whisper them to the gm on('ready',function(){ 'use strict'; on('chat:message',function(msg){ var args; if ( 'api' !== msg.type || !playerisgm(msg.playerid) ) { return; } args = msg.content.split(/\s+/); switch(args[0]) { case '!wgmn': _.each(msg.selected,function (o) { // 1 var t=getobj(o._type,o._id); // 2 if(t){ t.get('gmnotes',function(n){ // 3 sendchat('gm notes',n); // 4 }); } }); break; } }); }); I haven't tested it, but this should be the basic idea... =D
1426274724

Edited 1426274817
So...I tried it, and for some reason I don't appear to be able to get the "gmnotes" from the token. I have no problem setting them, but getting them does not seem to be working for me. My code: log('tokenid: ' + tokenId); var token = getObj('graphic', tokenId); if(token === undefined) return; log("Token: " + token.get('name')); token.get('gmnotes', function(gmnotes){ log('read gmnotes'); sendChat('GM Notes', '/w GM ' + gmnotes); }); My results: "tokenid: -JkJCrxagqwQ850rg9Lu" "Token: Mob 1" As you can see, I know I get the correct token, but the callback for getting the gmnotes is never called. Any ideas? Edit-------- I tried just doing a "var gmnotes = token.get('gmnotes')", and it worked for reading all of the text. Apparently, the token 'gmnotes' does not use a callback for reading it.
1426276723
The Aaron
Pro
API Scripter
ah, interesting. even easier!
1426277400
Gen Kitty
Forum Champion
Knox said: I have token macros to execute the selected tokens action 1,2,3,... Having the actions listed in the GMNote gives me an easy way to see which actions are in which slot for that mob, but it still means I need to double click the token, and then scroll down to see the GM Notes. It would be nice to have a tooltip like "1-Club, 2-Shortbow". I have a very dumb question, so bear with me: Could your scripting that sets all this up for you be modified to have the buttons be labeled 'Club' 'Shortbow' and so on, instead of 1, 2, 3, N?
1426277444
Gen Kitty
Forum Champion
*eyes Aaron* How goes the changes to GroupInit, BTW? *toetap&smirk*
GenKitty said: Knox said: I have token macros to execute the selected tokens action 1,2,3,... Having the actions listed in the GMNote gives me an easy way to see which actions are in which slot for that mob, but it still means I need to double click the token, and then scroll down to see the GM Notes. It would be nice to have a tooltip like "1-Club, 2-Shortbow". I have a very dumb question, so bear with me: Could your scripting that sets all this up for you be modified to have the buttons be labeled 'Club' 'Shortbow' and so on, instead of 1, 2, 3, N? That is a great idea. I don't see an event I can catch for when the token selection changes though...
Knox said: As you can see, I know I get the correct token, but the callback for getting the gmnotes is never called. I tried just doing a "var gmnotes = token.get('gmnotes')", and it worked for reading all of the text. Apparently, the token 'gmnotes' does not use a callback for reading it. Only journals (characters objects) require a call back to receive their 'gmnotes' or 'bio'. It's a strange thing really given you can just .set() them. Probably has to do with 'in-time' semantics as fetching from firebase takes time.
1426306172
The Aaron
Pro
API Scripter
Actually, if I remember correctly it was introduced with the intent to slow down updates by the API. If you look back about 8-10 months, rRiley had a thread about some major API changes, this being one.
1426306439
The Aaron
Pro
API Scripter
Knox said: GenKitty said: Knox said: I have token macros to execute the selected tokens action 1,2,3,... Having the actions listed in the GMNote gives me an easy way to see which actions are in which slot for that mob, but it still means I need to double click the token, and then scroll down to see the GM Notes. It would be nice to have a tooltip like "1-Club, 2-Shortbow". I have a very dumb question, so bear with me: Could your scripting that sets all this up for you be modified to have the buttons be labeled 'Club' 'Shortbow' and so on, instead of 1, 2, 3, N? That is a great idea. I don't see an event I can catch for when the token selection changes though... There isn't one. You'd have to have different characters for tokens that are armed differently to do it thst way. I only just realized that must be why you are doing it this way, so you can have different tokens of the same creature but with different weapons. So all the guards are the same, but some are using swords and some are using halberds. You could use a rollable table token with differently equipped tokens, then watch the sides property for changes and switch the represents to point to a character with different macros. That would give you simple drag in, with simple changing of weapons.
The Aaron said: There isn't one. You'd have to have different characters for tokens that are armed differently to do it thst way. I only just realized that must be why you are doing it this way, so you can have different tokens of the same creature but with different weapons. So all the guards are the same, but some are using swords and some are using halberds. You could use a rollable table token with differently equipped tokens, then watch the sides property for changes and switch the represents to point to a character with different macros. That would give you simple drag in, with simple changing of weapons. Yes, I have different character sheets for each monster (Ex: "Orc", "Skeleton", "Orc Shaman", "Hell Hound"). Each character sheet is bound to a rollable table token as you describe. Yes, I'm anal...and yes, I have many NPC Monster sheets (and the list is growing). However, when I am filling an encounter I can simply lookup the mob I want and drag and drop it as many times as I need to create the encounter. Another script I have calculates the difficulty of the encounter so that I can quickly tailor it to the number of PCs I have. This keeps the game moving along instead of waiting on me to work it all out. My problem is that the actions these monsters can take are often completely different, so switching character sheets won't really accomplish anything for me. Action2 for the Orc might be a Shortbow, where Action2 for the Hell Hound is Fire Breath, or maybe its Bless for the Orc Shaman. If there were a way to tell that the selected token changed, then I could tailor the token macros to fit the token...which would be sweeeeet on several levels. For example, there are macros that I have for PC tokens, and different macros for NPC tokens (NPCs use different attributes than PCs). I have a large list of macros (thank goodness for huge monitors) that show for every token to encompass the scope of both NPC and PC tokens. Such functionality to contextually display the token macros would be very very nice.
<a href="https://app.roll20.net/forum/post/1397909/script-d" rel="nofollow">https://app.roll20.net/forum/post/1397909/script-d</a>... You could use the Speech Balloons script to mimic tooltips.