Maptool Database Support

We are always looking for new tools to create to help facilitate the table top gaming experience. Let us know if you have an idea for a new gaming tool you'd like to see. (Note: this is NOT for feature requests on existing tools!)

Moderators: dorpond, trevor, Azhrei

Post Reply
GDraghetti
Kobold
Posts: 6
Joined: Thu Mar 04, 2021 4:31 am

Maptool Database Support

Post by GDraghetti »

I hope this is the right section for this post.

I have try to add the equipments for my game using JSON but only for armors I have a macro of more than 3000 lines!
The access to this macro results very slow.

It's would be great have a set of function to handle a database (SQLite could be the right choice) file in the campaign's resources.

There is no need to create a graphic interface to build and populate the database inside your software, there is many free and multi-platform software like DB Browser.
It would be enough to have functions to send query and fetch results.

Do you think it is possible?

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Maptool Database Support

Post by JoeDuncan »

Yes, absolutely. Support for this is built-in via the "RESTful" API implementation - allowing Maptool to query any DB that has a REST webapi.

Check out the examples here:

https://wiki.rptools.info/index.php/REST.get
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
JoeDuncan
Giant
Posts: 118
Joined: Sun Nov 22, 2020 9:02 pm

Re: Maptool Database Support

Post by JoeDuncan »

This looks like it might fit the bill pretty simply:

https://medium.com/@clintnetwork/lucid- ... e734586e26
"Joe's Ugly Hacks - Get 'em while their hot! Guaranteed ugliest hacks around or your money back!"

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Maptool Database Support

Post by aliasmask »

I'm assuming most of those lines are not code and are your db list. What I usually do is put csv db in to a macro, then have a macro build a json array of json objects (column name for keys) and save it to a lib token. I can then access the data pretty easily that way. I know I have some code floating around here and/or on discord that does in one function. All you need to do is call the function, specify the macro name with the db and it saves returns it to the calling macro to be saved.

I have more info and macros here on the topic: https://discord.com/channels/2962308222 ... 1068898329

Post Reply

Return to “Ideas for New Applications”