Tabletop Simulator

Tabletop Simulator

Not enough ratings
JsonTool
   
Award
Favorite
Favorited
Unfavorite
Number of Players: 1, 2, 3, 4
Assets: Scripting
Tags: Misc, 4+
File Size
Posted
Updated
37.867 KB
15 Mar, 2018 @ 2:51pm
30 Mar, 2018 @ 6:18am
15 Change Notes ( view )

Subscribe to download
JsonTool

Description
DESCRIPTION:

JsonTool is a tool for exporting and importing information about in-game objects in JSON-format. JsonTool works with Notebook tabs for all actions. All needed tabs would created automatically. Exporting and importing processes use tab "json.data" for saving or getting information in JSON-format. Before every exporting and importing JsonTool would save backup to tabs with prefix "json.exp.backup" and "json.imp.backup". Tool configuration is saved in tab "json.conf". This tab would be read before every importing and exporting process. JsonTool print information about a current process into a Chat window.

Note 1: sometimes Tabletop Simulator incorrectly works with Notebook tabs. If you did not see any data in created tabs try to remove all tabs and then run Export or Import again.

Note 2: note that GUID of objects in Tabletop Simulator is a not constant. Object GUID may change after this object was put to container and then taked from that container. This is a reason why config option 'processContainers' is disabled by default. But GUID is not changed for all objects outside of containers after saving game and loading.

Note 3: only fields "name" and "description" is being processed now, and "guid" is used as a key in JSON. If you need more fields you can add processing of this fields into 2 LUA methods: exportObject(object), importObject(object, fields).


CONFIGURATION:

Config options (tab "json.conf"). Every option is presented in this format: "option_name: default_value":

"exportEmptyData: false"
If false, objects with empty Names and Descriptions would be skipped.

"createExportBackups: true"
If true, JsonTool will create backup of data before exporting in tab "json.exp.backup-*".

"createImportBackups: true"
If true, JsonTool will create backup of data after importing in tab "json.imp.backup-*".

"processContainers: false"
If true, JsonTool will process containers. Objects inside of containers (Bags, Decks) would be taked from container before processing and put back after.

"takeRelativePosition: [2, 0, 2]"
If "processContainers" option is enabled, this relative coordinates would be used as a point for taking object from container.

"takeErrorTimeoutSeconds: 10"
Sometimes taking of object from container turns into failure (taked object may "fall" back to container for example). If this happened JsonTool will try to take this object again after this timeout.

"processDuplicates: false"
If true, JsonTool may process objects more than once.

"includeGuids: {}"
You may exactly specify which guid would be processed by this option, for example: includeGuids: {"2ab6f8": true, "2ba601": true}.

"excludeGuids: {}"
You may exactly specify which guid would be skipped by this option, for example: excludeGuids: {"5366f8": true, "6c2ba5": true}. Option excludeGuids has a priority over includeGuids.

"mode.auto: true"
If true, JsonTool would be automatically process all objects. All above options is relate to this mode.

"mode.manual: true"
If true, you need to take object manually for processing. If mode.auto is true and mode.manual is true, firstly JsonTool would be run in Auto mode and after that in Manual mode.


LINKS:

Source code: https://github.com/indvd00m/json-tool