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

Query a rollable (or other) table

Is it possible to use rollable tables to store data that can be called via some sort of SQL query? Or is there another way to store data in a table structure that's accessible from within Roll20?
1477495269

Edited 1477495275
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The only way to interact with data in the Roll20 VTT programmatically is the API AFAIK. That said, you can store data in the state to save things between games (up to 2 mb in anyone one variable). Using the API, you could also parse data from rollable tables or a properly formatted text area (journal/character bio, gmnotes, or attribute) to use in your code. It's a Trap does this for its trap definitions using JSON and the Shaped companion does something like this to parse statblocks for monster imports. And I have now reached the end of my limited programming knowledge.
Thank you Scott. 
1477496884
The Aaron
Pro
API Scripter
Minor correction, the whole state object can't be larger than 2mb. But you can freely create API scripts that have a large internal data structure and search/reference them.  You'd not want to put those in the state since they are large and static.  Another option is to place information in the body of a handout.  It's easier to add/edit that way, but slightly complicated to access from the API.
1477500380

Edited 1477500411
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
The Aaron said: Minor correction, the whole state object can't be larger than 2mb. I'm gonna have to reevaluate how I store some things for PageNavigator then as campaigns with large player bases/lots of destinations could easily eat that up just from PageNavigator the way it is now, leaving no room for any other script to store anything.