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] Quick hack to let players see tokens more clearly in a whispered image.

1445432517
The Aaron
Pro
API Scripter
Short little script: on('ready',function(){ "use strict"; on('chat:message',function(msg){ var args, who; if (msg.type !== "api") { return; } who = getObj('player',msg.playerid).get('_displayname'); args = msg.content.split(/\s+/); switch(args.shift()) { case '!see': _.chain(args) .map(function(id){ return getObj('graphic',id); }) .reject(_.isUndefined) .each(function(o){ sendChat('','/w "'+who+'" [pic]('+o.get('imgsrc')+'#.png)'); }); break; } }); }) Then just have a macro for everyone that is: !see @{target|token_id} When they click it, it will prompt them to select a token, which will then be blown up and whispered to them:
1445434076
DK Heinrich
Marketplace Creator
Sheet Author
Very Cool! minor quibble - is there a way for it not to say 'From:' ? 
1445434754

Edited 1445434788
The Aaron
Pro
API Scripter
Unfortunately, no.   It could say something more like "From: You take a closer look" or "From: the API".  Just change that '' parameter on the sendChat() call to whatever you want it to say after the From:.  Maybe we can get an enhancement out of the Devs to remove that From: if the first parameter is empty.
1445513475
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Properly coded this could be a great script!
Curious... can players hunt for tokens this way even through dynamic lighting or fog of war?
1445514982
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
HoneyBadger said: Curious... can players hunt for tokens this way even through dynamic lighting or fog of war? Good point... If selectable to the player.
1445515149
The Aaron
Pro
API Scripter
Players can do that with any @{target}.
1445519579
The Aaron
Pro
API Scripter
Actually, at further thought, I see what you mean.  I suppose it has to go back to the "if you players are cheating, get better players" type of thing.  One thought is to instead of showing the image of the token, permit registering an image to show when the token is !see n.  That could actually be quite nice because (as Stephen S. pointed out to me on Skype), it could give you a different view than you would otherwise have.  His example was looking at the details of a door in Tomb of Horrors, but it could just as easily be the image Vince mentioned in the suggestion that spawned this script, an image with text describing something.  It wouldn't even have to be a single image, or an image at all.  It could just be a description.  I'll see about making that improvement. =D
1445560010
vÍnce
Pro
Sheet Author
The Aaron said: Actually, at further thought, I see what you mean.  I suppose it has to go back to the "if you players are cheating, get better players" type of thing.  One thought is to instead of showing the image of the token, permit registering an image to show when the token is !see n.  That could actually be quite nice because (as Stephen S. pointed out to me on Skype), it could give you a different view than you would otherwise have.  His example was looking at the details of a door in Tomb of Horrors, but it could just as easily be the image Vince mentioned in the suggestion that spawned this script, an image with text describing something.  It wouldn't even have to be a single image, or an image at all.  It could just be a description.  I'll see about making that improvement. =D Stephen told me the door looked harmless... Can't wait to see where this leads.  
Once again, The Aaron has come up with something both brilliant and valuable... thanks! I'm definitely adding this to my campaign(s) from now on. -Phnord PS: I've added this to my 'look' script, it really makes it a whole lot better!
1445565781
The Aaron
Pro
API Scripter
Sweet!  glad you like it! 
1445567224

Edited 1445567449
Stephen S.
Pro
Marketplace Creator
Sheet Author
API Scripter
Vince said: The Aaron said: Actually, at further thought, I see what you mean.  I suppose it has to go back to the "if you players are cheating, get better players" type of thing.  One thought is to instead of showing the image of the token, permit registering an image to show when the token is !see n.  That could actually be quite nice because (as Stephen S. pointed out to me on Skype), it could give you a different view than you would otherwise have.  His example was looking at the details of a door in Tomb of Horrors, but it could just as easily be the image Vince mentioned in the suggestion that spawned this script, an image with text describing something.  It wouldn't even have to be a single image, or an image at all.  It could just be a description.  I'll see about making that improvement. =D Stephen told me the door looked harmless... Can't wait to see where this leads.   When you don't have a thief to check the door.... ask Vince to do it. Kept me safe so far.
1445570886
Lithl
Pro
Sheet Author
API Scripter
Stephen S. said: Vince said: The Aaron said: Actually, at further thought, I see what you mean.  I suppose it has to go back to the "if you players are cheating, get better players" type of thing.  One thought is to instead of showing the image of the token, permit registering an image to show when the token is !see n.  That could actually be quite nice because (as Stephen S. pointed out to me on Skype), it could give you a different view than you would otherwise have.  His example was looking at the details of a door in Tomb of Horrors, but it could just as easily be the image Vince mentioned in the suggestion that spawned this script, an image with text describing something.  It wouldn't even have to be a single image, or an image at all.  It could just be a description.  I'll see about making that improvement. =D Stephen told me the door looked harmless... Can't wait to see where this leads.   When you don't have a thief to check the door.... ask Vince to do it. Kept me safe so far. Thieves/Rogues need to do work to deal with locked/trapped doors. Barbarians always carry a skeleton key. =)