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 Update 7/21

We've made changes to the API Server along with this morning's update. Main and Dev Are Now Aligned The Main API Server now has the same code that the Dev server was running, including this update:&nbsp; <a href="https://app.roll20.net/forum/post/1884507/api-upda" rel="nofollow">https://app.roll20.net/forum/post/1884507/api-upda</a>... This means that some of your scripts may need to be updated (basically, if there was a "Dev" version of the script, you probably want to start using that now). New Functionality We've added two new pieces of functionality to the API: You can now pass an additional parameter to sendChat() for messages which are not intended to be saved to the long-term chat archive for the campaign. For example, if you are a script that is sending a "menu" in the chat using the API Buttons, this will allow you to do that without cluttering the chat archive for the campaign (and also saves storage space for us :-). To do so, just do this: sendChat("Name", "Message", null, {noarchive: true}); Note that you should pass "null" as the third parameter if you aren't going to use a callback function to receive the output of the sendChat(). You can now generate 3D Dice rolls using the sendChat() function. The syntax is simply: sendChat("Name", "Mesage", null, {use3d: true}); If you pass a player ID to the name parameter, such as sendChat("player|-ABC123"...) the player's color will be used for the dice. Otherwise a default white color will be used. Note that clients can only show the result of one 3D roll at a time, so making a bunch of separate 3D rolls in a row is not useful. Also note that using 3D rolls does place a bit more strain on the QuantumRoll server, so use your judgement and don't perform 100 3D rolls in the space of a second. Use 3D rolls when the roll will "matter" to the player and make an impact on the game.
1437499961
The Aaron
Pro
API Scripter
This also includes&nbsp; Nested Inline Rolls and Quoted Whispers for the API?
The Aaron said: This also includes&nbsp; Nested Inline Rolls and Quoted Whispers for the API? Yep!
1437506660
The Aaron
Pro
API Scripter
Schweeeeetttttt!!!!!! &nbsp;=D
Awesome. &nbsp;Thank You guys for always moving forward! &nbsp;It truly makes me happy to be a supporter when I see my money being constantly used for development. &nbsp;Thank you guys again!
Josh Stotz said: Awesome. &nbsp;Thank You guys for always moving forward! &nbsp;It truly makes me happy to be a supporter when I see my money being constantly used for development. &nbsp;Thank you guys again! Thanks, Josh! Your support is very much appreciated.
1437613758
Steve D.
Sheet Author
API Scripter
Is there a way to change the 3D dice color on an inline roll? I would like to roll 2 different sets of dice at the same time the a red and black color.&nbsp;
Steve D. said: Is there a way to change the 3D dice color on an inline roll? I would like to roll 2 different sets of dice at the same time the a red and black color.&nbsp; Not currently, no, but it's definitely something we're considering adding for a future update. I'm not sure if you'd ever be able to roll two different colors at the same time, though...but you might be able to set the color for all the rolls in a sendChat() command.
1437802633
Falcon
Pro
Sheet Author
Steve D. said: Is there a way to change the 3D dice color on an inline roll? I would like to roll 2 different sets of dice at the same time the a red and black color.&nbsp; I see where you are going with this Steve. I run into the issue when I am rolling to hit and damage and I am using all the same dice. &nbsp;I can't tell which ones are the attack and which ones are damage (at least not without some serious digging). &nbsp;It would be great if there was an API that could roll "to hit" then stop, and then roll "damage" or something natively. &nbsp;Maybe I will put in a suggestion... :)
Riley - does the 3d:true only work if you use null? Cause I can't get the dice to show up in the main sendChat I use to generate the inlinerolls for powercards. sendCat("", JSON.stringify(PowerCard), function(x) { ... }, {use3d:true});
HoneyBadger said: Riley - does the 3d:true only work if you use null? Cause I can't get the dice to show up in the main sendChat I use to generate the inlinerolls for powercards. sendCat("", JSON.stringify(PowerCard), function(x) { ... }, {use3d:true}); If you are using a function to capture the result of the roll, then the message for the roll never gets sent to the tabletop. If the message is never sent to the tabletop, then the 3D Roll is never shown. Basically, you can't show the 3D Dice as part of a "non standard/script-intercepted" roll result that you generate in the chat (the kind that the tooltip shows up for) -- it has to be a "real" roll result that is sent straight-through from the API to the clients, which would be sendChat() without a callback function. So the only way to use 3D Dice currently is to use them either a) client-side outside of an API command, or b) to use them server-side, without a callback function. I think the plan currently is to add a function so that the API can "play" the 3D Dice generated by a roll (whether it's generated client-side or server-side) to allow for this type of advanced usage. So you would get the ID of the original roll in the callback function, do whatever you want to with it and display the results however you want, but then you could also send a signal to say "show the 3D roll for this roll ID". Note that it would only be able to show the 3D roll for the original, unmodified roll, though -- you won't be able to fudge the roll or anything like that.