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

Can an External Site Use API?

This will actually be a two-part question, but let's start with the presumptive element. We have a somewhat complex "store system" in our game.  What is available, and the price it costs, and its delivery time, are formulaic, but all are subject to other variables.  Simple example:  Buy goods from the Dwarves, but the cost and the delivery time are both affected by the "Road Condition" of the road between our location and the Dwarven lands. We have an external tool we've developed to manage this more easily -- a web site which essentially allows the GM to alter the states and availability information, and the players can easily shop for the things they want, compare prices and encumberence before committing the purchase, etc. But OH MY GOSH would it be great if we can then, upon commit, have it adjust the character sheet for that character to adjust gold, silver, copper, etc. and add items purchased (and remove items sold) on the Inventory page, and manage the "Notes" field on the inventory page for things purchased by not yet arrived, etc. I am not seeing anything anywhere which specifically says this can be done, nor anything which provides much in the way of guidance on how to do this even if it can be done.   Before I go plunking down $100/mo on Developer's License, I need to know if I can even get there from here.  And I'm not achieving clarity on this point from perusing the site(s). I've been toying with the idea of hacking URL postings to cause Character Sheet updates; or, worse, some local app sending keystrokes to the Roll 20 window -- none of this screams "futureproof" or "stable coding technique" in any demented imagination I might fabricate. Which inspires the second part of the question: Is it possible to simply incorporate this complex store into a character sheet (in some way which would not require quintupling the size of the page load for a character sheet) and simply re-implement this tool directly in Roll20?  And would everyone who uses it be required to have a Developer's License, or could I develop the solution under a Dev License but the users could use it under a user's license?  Just....  not able to garner answers to these conceptual questions from what I'm finding out there. Any bread crumbs I might follow up on?
1742841689

Edited 1742845840
timmaugh
Forum Champion
API Scripter
By "Developer license" I think you mean a pro subscription. That is the level at which you can install scripts in your own games. So, to answer your last question first, it is only the owner of the game that requires a pro subscription. They, or other GMs, can install scripts in the game. But then everyone in the game can make use of the installed scripts to the extent that those scripts, themselves, are set up to be available. For instance, there are strips that only allow GMs to implement certain activities, for predictable reasons.  I think the easiest way for you to close the circle on what you're trying to do is to either develop a script for the roll 20 side, or to simply leverage an existing script on the roll 20 side, which your external site, then, can produce a command line for at the point where you have finalized purchase. For instance, your command line can include the items purchased or any notes that need to be included. Someone within the game could then copy and paste the command line produced by your external site, and your roll 20 script would take over putting the details where they needed to go in the game. Aaron's UVVT importer takes this approach, where he set up an external site to take a UVVT file and extrapolate the command lines necessary for a script in the roll 20 environment. That script, Walls, then interprets all of the command lines output by the external site to create walls on the map for your game. This would be the same approach.  For entering information in a character's attributes, you can use ChatSetAttr. For storing things on a token, you can use TokenMod. Dropping information in a handout gets a little more specific to each individual implementation, so you would likely want your own script if you were going to go that approach.  If you have questions about any of that, drop a reply and we'll try to steer you in the right direction.
1742843081
Gold
Forum Champion
the plunk is around 110/yr not 100/mo for Roll20 Pro that has API access 
Gold said: the plunk is around 110/yr not 100/mo for Roll20 Pro that has API access  D'oh!  The year is young, but that may qualify as my best typo of the year thus far.  :-D
1742843950

Edited 1742844032
timmaugh said: I think the easiest way for you to close the circle on what you're trying to do is to either develop a script for the roll 20 side, or to simply leverage an existing script on the roll 20 side, which your external site, then, can produce a command line for at the point where you     [...] have finalized purchase. If you have questions about any of that, drop a reply and we'll try to steer you in the right direction. Awesome info -- I may hit you back up when I am ready to implement (or get stuck developing).  But I could develop this under an upgraded Pro plan with its annual  fee (not monthly  LOL), wiggle in and out of here as I learn the ropes, and then present it to my GM who already has Pro and give him solid installation instructions and... barring all the other things that go wrong when people try to interface with technology (HA!), we should be golden. Thanks for all the help!
1742844612
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If your GM has Pro, and you are developing this for your group, just have them create a game for you and assign you as GM. You will have access to the Mod system for that game.
(I started writing this and got sidetracked before I hit Submit so there have already been a few other great responses saying the same thing.) Roll20 Mod  scripts are 'sandboxed' and don't interact outside of the Roll20 VTT. The only way to interact with the Roll20 sandbox/server is by using chat commands. However, if you wanted a way to interact directly between an external website and the Roll20 script server, you would need to create a custom browser extension in addition to a custom Roll20 script, and that would have to be installed on each player's computer who wanted the interaction between the external website and Roll20.  It would probably be easier to recreate the external websites "Store System" directly in Roll20 with a custom script, instead of a custom script to interpret information through a browser extension from the external website. And as Timmaugh said, if by "Developer License" you mean a Roll20 subscription , it's not $100/month - a Pro subscription is $109.99 per year , or about $10/month.