Extract
Extracting a save file splits it into a nested directory structure. Each folder contains the information for one object (or Global). It contains different files per object, depending on what attributes it has (listed in the sections below). The files all have the same name, they are discriminated by the directory they are part of.
The data from Global will be on the top level of the output directory.
From there the directory Contents
contains the globally available objects.
Object directories are named by using their nickname (the applied name that is also visible in the TTS tooltip), followed by a dot and their GUID.
If the object doesn’t have nickname, their internal name is used instead.
If the object is a container (a bag or deck), it’s content is again nested inside the Contents
directory.
The same applies for states
This process will create a directory structure like this:
<output-path> ├─ Data.json ├─ Contents.json ├─ Script.ttslua ├─ State.txt ├─ UI.xml ├─ Contents -- since this is Global, this contains all global objects │ ├─ Bag.abc123 | | ├─ Contents.json | | ├─ Data.json | │ ├─ Script.ttslua | | ├─ State.txt | | ├─ States.json | | ├─ UI.xml | | ├─ Contents -- this object is a container, so this contains the contained objects | | | ├─ CoolFigure.123456 | | ├─ States -- when the object is stated, the states are kept here | | | ├─ 2-OtherBag.123456 | | | ├─ 3-MoreOtherBag.111111 │ ├─ HandTrigger.123abc
Options
The Api offers several options
Name | Type | Required | Description |
---|---|---|---|
|
|
Yes |
The path where the save file will be extracted to. |
|
|
No |
If set, floating point values will be rounded to the 4th decimal point. When a number is given instead of a boolean, the values will be rounded to that decimal point instead. |
|
|
No |
If set, the script states of objects will also be extracted. Otherwise, they will be ignored, effectively clearing the state of all objects. |
|
|
No |
Name of the directory for a container object or the global table where each contained object will be written to. Defaults to no name, meaning objects are extracted directly into their container directory. |
|
|
No |
Name of the directory for an object with multiple states where each state will be written to. Defaults to no name, meaning states are extracted directly into their object’s directory. |
|
|
No |
Name of the directory for an object with attachments where each attachment will be written to. Defaults to no name, meaning attachments are extracted directly into their object’s directory. |
|
|
No |
A list of names for fields in an object’s data.
When set the keys in each E.g. an object data like this:
with a
|
Files
The following files are created while extracting (when applicable).
Script.ttslua
This file contains the Lua script attached to the object (or Global).
If the script contains require()
calls, it will be unbundled, so that only the root module will be written to the file.
E.g. this is the same behavior seen in the TTS editor plugins, so that only the relevant code is written to the file.
- NOTE
-
This tool does not (and does not intend to) support the use of the
#include
directive that is available in the Atom TTS plugin. Please userequire()
instead.
UI.xml
This file contains the XML UI attached to the object (or Global).
Like the script it will be unbundled, so it contains the <Include src="" />
directives from the original code similar to the behavior from the Atom TTS plugin.
Data.json
This file contains the data from the original save file for this object (or Global). Fields that where extracted (e.g. the Lua script or XML UI), will be empty and not included in the file. Adding contents to those fields will be ignored as their contents is solely driven by the available files for this object.