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

API Dev Help

I'm looking for someone familiar with the API to help me develop a few tweeks I'd like to add to the environment. Specifically, I'd like to tailor the game space to be more like a vendor's booth. It's almost there, but there are a few things that I think could make it almost perfect. In my previous topic, for example, I'd like for "players" (in this case booth visitors) to be able to click on an icon and have it open up a pre-made handout associated with the image. Another example might be making a "Ring for Service" icon/image on the desktop where the visitor clicks and it makes an audible chime to alert the "GM" there is someone at the booth.  I have a few other ideas I'd like to see if the API is robust enough to handle - if you're interested, please shoot me a note!! Thanks! KC Rift
1476462756
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Opening a handout is outside the purview of the API unfortunately. I do have some ideas for you, but am on my phone.
1476462996
The Aaron
Pro
API Scripter
The closest you can get is whispering a link to players when they interact with an object in some way (call a command with it as an argument, move it, etc);
1476482452
Tetsuo
Forum Champion
If, instead of handouts, you were open to using character sheets, you can link a token to a sheet, then the players can perform alt+double click on the token, and open the associated sheet.
Scott - let me know what you have in mind.  Franky - I might shoot you a note, if you don't mind, for some help on the character sheet!!  THank you!
1476484744
Tetsuo
Forum Champion
Sure, feel free.
1476651526

Edited 1476724320
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Sorry for the delay KC, was out of town. So, first off, the API can't do anything just on a click of token, but you can get pretty close to the same functionality by giving players control of the booth token so that they can access its token actions. You then make probably two token actions for your use case, one to notify the GM of what they want to do (Brian's  SoundTrigger  API would be useful here). And the other to output a formatted list of hyperlinks to appropriate journals to the chat. You could probably utilize Aaron's  TokenLock  script to allow your players to interact with the booth's token actions, but prevent them from being able to move it. You also don't need to make each booth a character; instead make a global macro that calls bar1, 2, or 3 of a selected token - make it visible to players and a token action - you can now store what should be output by each token action (up to three  six different outputs) in the appropriate bubble. You can remove player ability to edit/see these from the token's popup details menu so that they can use the token actions, but can't move or edit the token (in conjunction with tokenlock or an API based on it to make a more targeted lock effect. That's the bare bones of the idea, hope it helps, Scott
Scott - wow, thanks! That REALLY helps a lot - especially the nudges to which particular scripts to check out.
Looks like the Triggered SFX script is no longer available. Was able to get the tokenlock one. That will still help a ton.
I think someone mentioned it in another thread, but I'm not finding it - is there a method for calling a URL (or really, anything) into the chat window onClick of a token in the game? In other words, if someone clicked Bob's token, could I have it auto-populate text with a URL?
1476725331

Edited 1476725388
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
KCRift said: Looks like the&nbsp;Triggered SFX script is no longer available. Was able to get the tokenlock one. That will still help a ton. Huh, didn't realize that was no longer active, sorry about that. KCRift said: I think someone mentioned it in another thread, but I'm not finding it - is there a method for calling a URL (or really, anything) into the chat window onClick of a token in the game? In other words, if someone clicked Bob's token, could I have it auto-populate text with a URL? The chat uses&nbsp; basic markdown formatting . So you can use the markdown for a link, [Text to display]( <a href="http://www.exampleURL.com" rel="nofollow">www.exampleURL.com</a> ), to generate a link to a webpage or even to an in game handout ( if you jump through some setup hoops ). You can also use this to print images right to chat if the link ends in .jpg, .png, or .gif. You'd still need an extra click (to click a token action button for a macro that would generate the chat message).