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

New API Keys

1622747119

Edited 1622747539
Corey J.
Roll20 Team
Hello API developers and enthusiasts! We have a number of exciting updates to the API for you to go over. These additional keys have been long requested: Token Bar Location - ‘bar_location’ Bar Styling - ‘compact_bar’ Page   Play on Load - ‘jukeboxtrigger’ For Updated Dynamic Lighting, we have added support for the following: Token Light Multiplier - ‘light_sensitivity_multiplier’, Night Vision Effect - ‘night_vision_effect’ The following two keys are the same from the Legacy Lighting API but we thought it was worth mentioning again:  Page Update on Token Drop - ‘lightupdatedrop‘ GM Darkness Opacity - ‘fog_opacity’ And we made a lot of under the hood changes to UDL over the past few months so tokens should be able to update their light renders without the need to restart the page or use the key we added a few months back. So this is a notice that we will be deprecating the key ‘force_lighting_refresh’ in the upcoming months.. We’ve updated all of our Help Center articles to reflect these changes, so you can use those pages for reference. Cheers!
1622747481
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That is awesome and very welcome news!
1622747872
The Aaron
Roll20 Production Team
API Scripter
The token properties are now supported in TokenMod!&nbsp;&nbsp; <a href="https://app.roll20.net/forum/post/4225825/script-update-tokenmod-an-interface-to-adjusting-properties-of-a-token-from-a-macro-or-the-chat-area/?pageforid=10136003#post-10136003" rel="nofollow">https://app.roll20.net/forum/post/4225825/script-update-tokenmod-an-interface-to-adjusting-properties-of-a-token-from-a-macro-or-the-chat-area/?pageforid=10136003#post-10136003</a> Also of note, the setdefaulttokens() API function now preserves all the above settings.
1622748517
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Woot! looking forward to using this!
1622749915
Gold
Forum Champion
Looking forward to using the API scripts that make use of this (For starters, I make regular use of TokenMod to configure Monster Tokens and PC tokens according to my standard desired settings, being able to switch a whole group of monster tokens to Compact Bar, Underneath &amp; Overlapping style, will be great.) Thanks Roll20 &amp; those who script Community API Scripts, snippits &amp; the one-click.
1622751078
David M.
Pro
API Scripter
Particularly excited about the bar location and style! Thank you!
Thank you! It looks like my suggestion can be closed!
Super :) When do we get api access to the style/placement of the token bubbles? :)
Really, REALLY happy to see all of these but especially the&nbsp;light_sensitivity_multiplier!&nbsp;I have a neat lighting effect combining low light sensitivity and night vision that makes for great temporary obscured vision (like thick fog). Using between 1-10% sensitivity with 15/15 light sources gives them a minor halo effect (like it's piercing the fog) but the rest of the area stays obscured. It makes navigating easier for the player as they can keep a point of reference but can still blindly bump into walls and other obstacles. I was going to have to either set this by hand each time for each token or keep a second set of player tokens ready on the gm layer and switch out, but now I can add this to the API command that makes all the other changes and finish it out. Thanks guys! Looking forward to using it in the next session this week!
1623251435
The Aaron
Roll20 Production Team
API Scripter
That sounds like a cool project!&nbsp; One thing to be aware of: light sensitivity is computed for the full view of a player, so if they have one token with 15% and one with 100%, the view will be as if all of them have 15%.&nbsp;&nbsp; Also, there's a minor bug right now where if you remove a token with a light sensitivity setting, it doesn't recalculate the sensitivity multiplier.&nbsp; you need to either set it back to 100% before deleting it, refresh the page, or set a different value on another token (or set it and set it back).
Thanks for the heads up! I'll definitely keep that second one in mind. But yeah, I've noticed a few quirks like that since I test with a dummy account that has vision through all the player's tokens. In practice though, each player only uses one each and I've been using force_lighting_refresh as a precaution for the time being. Hopefully that's enough to satisfy the pink kraken. :-) The only thing left to complete the illusion would be the ability to change the page's darkness color, like you can the background. Shifting it to white or a light gray would sell the "fog" feeling much more. But I won't get greedy, and be happy with this. :-D
1623253278

Edited 1623253350
The Aaron
Roll20 Production Team
API Scripter
force_lighting_refresh doesn't actually do anything now, and probably will get removed as a property.&nbsp; (Corey posted that somewhere, I think.&nbsp; Edit: Here ) You could create a Path object and fill it with a transparent color like #ffffff99 to "white out" the scene.&nbsp; Just put it on the map layer sized for the area to affect and pulled to the front.
You can display paths over "darkness"? The only trick I know for doing something like that is giving the player control over a token and granting it vision to trick Roll20 into rendering it over everything else but use with a 0deg range, so it can't actually see (actually&nbsp;I think you're the one that suggested that to me a while back, it helped a lot! :-D) But then you have to use the object layer for vision to count and end up with the awkward situation where they can accidently select and move it. It works fine for temporary things that quickly get removed anyways (like message boxes or spell effects), but I learned not to use it for anything meant to be more permanent, like map decorations. Edit: Also, holy crap! I never knew you could add alpha values to the colors. That... opens a lot of doors for me... :-D
1623255795
Andreas J.
Forum Champion
Sheet Author
Translator
updated the references on the wiki, where all the api keys are on a single page: <a href="https://wiki.roll20.net/API:Objects" rel="nofollow">https://wiki.roll20.net/API:Objects</a>
1623257784
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Andreas J. said: updated the references on the wiki, where all the api keys are on a single page: <a href="https://wiki.roll20.net/API:Objects" rel="nofollow">https://wiki.roll20.net/API:Objects</a> Thank you!
1623274879
timmaugh
Pro
API Scripter
The token properties are now also supported in Fetch, making them available in the chat input line of any other script. Usage parameters here: <a href="https://app.roll20.net/forum/permalink/10151776/" rel="nofollow">https://app.roll20.net/forum/permalink/10151776/</a>
1624075269
Pat
Pro
API Scripter
The Aaron said: force_lighting_refresh doesn't actually do anything now, and probably will get removed as a property.&nbsp; (Corey posted that somewhere, I think.&nbsp; Edit: Here ) You could create a Path object and fill it with a transparent color like #ffffff99 to "white out" the scene.&nbsp; Just put it on the map layer sized for the area to affect and pulled to the front. I have a partially working version of just such a thing...&nbsp; <a href="https://app.roll20.net/forum/post/9631549/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/9631549/slug%7D</a>
Can the turn tracker window be given the option of being moved as an independent window - outside the map window?
1624216530
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Not to my knowledge, though you can double click on the header to minimize it.
Hi All,&nbsp; Wanted to follow up and mention two things that affect the API from the release this week: The first was the introduction of the ' lightColor ' key. This Graphic key will allow a color to be added to bright and dim light for a token. It takes strings with hex color codes like "#0000FF".&nbsp; The second&nbsp; change we unshackled the dynamic lighting keys that were primarily only updating through controlled tokens. This means on object creation and updating values on the fly for lighting should just work in many cases. We have a few more key to fold in as David M. mentioned in the main bug thread here &nbsp;like the directional and bright light keys. So we'll keep you posted when we get those addressed.&nbsp; Have a good weekend!
1632145427
Andreas J.
Forum Champion
Sheet Author
Translator
The Sept. 8th changelog mentions: Added Pro API support for removed cards. Is this a new function or a bugfix to existing stuff? Was the documentation update? I see several API pages where edited Sept.1st...
Hi @Andreas J.&nbsp; There were some new keys added to the 'deck' objects Key Default Value removedcardsmode 'choosefronts' removedcards 'none' And related we also added to the 'card' object Key Default Value is_removed false The is_removed flag&nbsp;marks them as "removed" which makes them not get recalled in the deck or show up in the discard pile, instead they show up in a "Removed Cards" section Andreas J. said: The Sept. 8th changelog mentions: Added Pro API support for removed cards. Is this a new function or a bugfix to existing stuff? Was the documentation update? I see several API pages where edited Sept.1st...
That's nice thanks.
1632755735
Andreas J.
Forum Champion
Sheet Author
Translator
September 1, 2021 You can now change the the brightness of Dynamic Lighting Daylight Mode&nbsp; Adjust Dynamic Lighting Daylight Mode brightness with the Pro API What's the key &amp; values for this?
1632758505
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
daylightModeOpacity, with a value from 0 to 1. per this thread .
1632760496
Andreas J.
Forum Champion
Sheet Author
Translator
lol missed that I've already added it to the docs
Thank you, that's amazing :D
1639506363
Andreas J.
Forum Champion
Sheet Author
Translator
(comment to avoid thread being archived)
Hey, hi everybody ! \o Someone can tell me how long PowerCards will stay OFF plz?
1640626739

Edited 1640626747
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
This is a thread about new API keys being added to the API library. PowerCard questions should be posted in the PowerCards Feedback thread . Note: You may be interested in investigating ScriptCards , its "spiritual successor".
Hi Scripters, Moments ago we added a new key to give you the ability to lock a Graphic object in place. The feature can be found in the context menu when selecting a token/map on the VTT. Key Value lockMovement Boolean Warm Regards, Corey J
1646257806
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Thanks Corey!
How long before Tokenmod gets this is the real question!
1646285439
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
The Aaron added it today. You can grab it at his git for a manual install, or wait till next Tuesday for the weekly merge. Details are in the Great Big TokenMod Thread.
Corey J. said: Hi Scripters, Moments ago we added a new key to give you the ability to lock a Graphic object in place. The feature can be found in the context menu when selecting a token/map on the VTT. Key Value lockMovement Boolean Warm Regards, Corey J This is a great addition! Thank you! If I could make another suggestion - this would be a great action to have as a hotkey, and my suggestion would be for it to be tied to the '.' key (as in period), so for the regular hotkey it would toggle on a ' Ctrl/Cmd+. ', and for the advanced hotkey it would be ' l . '
1646290149
GiGs
Pro
Sheet Author
API Scripter
DM Eddie said: How long before Tokenmod gets this is the real question! And of course, it's added before anyone even asks about it. Aaron works fast!
1646290214
GiGs
Pro
Sheet Author
API Scripter
Jarren said: Corey J. said: Hi Scripters, Moments ago we added a new key to give you the ability to lock a Graphic object in place. The feature can be found in the context menu when selecting a token/map on the VTT. Key Value lockMovement Boolean Warm Regards, Corey J This is a great addition! Thank you! If I could make another suggestion - this would be a great action to have as a hotkey, and my suggestion would be for it to be tied to the '.' key (as in period), so for the regular hotkey it would toggle on a ' Ctrl/Cmd+. ', and for the advanced hotkey it would be ' l . ' I agree, I've had quite a few problems lately with nudging things out of alignment and it is a feature that should be very accessible IMO.
Hey Folx, With One way Dynamic Lighting lines out for use the API has also been updated. Lighting Lines now have a barrierType option that defaults to 'wall'. And if 'oneWay' is used as a value the key oneWayReversed is helpful in changing the direction the arrows are facing.&nbsp; Key Value barrierType 'oneWay' or 'wall' oneWayReversed false or true Warm Regards, Corey J
1649892368
The Aaron
Roll20 Production Team
API Scripter
Nice!
God I wish I was smart enough to do this stuff!&nbsp;
1650378337
The Aaron
Roll20 Production Team
API Scripter
The Kingsley said: God I wish I was smart enough to do this stuff!&nbsp; What would you write if you had the time and requisite knowledge already?
1) Most immediately I would write a script to lookup in a lookup table an image and then show it to the players. When the image is clicked on it would then post some text to chat. Specifically I would like to do a 5e Deck Of Many Things. When the table is rolled on it would show the graphic and when the graphic is clicked on it would show the text as per the DMG in the chat. I have tried to get the text into the tool-tip portion of a card deck but it won't take all of the text for some of the cards, (you, the Aaron, have touched on this in a recent Post). 2) Another script I would like is to somehow have a macro attached to a language in the skills section of the character sheet. The macro would whisper to all players that understand the given language language. 3) I would like to figure out how to send images directly to chat in a format that is large enough to see. Right now if I use a roll table with images in it they do show up in chat but they are so tiny I cant see really them.
Ooo That'd be nice. bar locations can be a pain and a setting, if i'm reading this correctly, would be very nice.
3) I would like to figure out how to send images directly to chat in a format that is large enough to see. Right now if I use a roll table with images in it they do show up in chat but they are so tiny I cant see really them. Actually, I make images in the library that I show the players... but It'd be nice to be able to display it to just one player.. the person who drew it and then the other players would have to venture a guess as to what happened to the player.lol...&nbsp; But otherwise, I would lvove to see your suggestion too. :)
Did this do something with token actions? because I don't see the token actions when I click on any of the tokens in any of my games now.