Working on data and sztl

This commit is contained in:
2025-11-30 19:32:36 -06:00
parent b1a43d038e
commit 27d3f0b452
16 changed files with 157 additions and 142 deletions

View File

@@ -53,41 +53,53 @@ datapack_name/
## DatasetObject Template File
- Metadata fields are denoted with a `!` and are required for this template:
- `data_type` is an arbitrary value used to denote what kind of dataset type the template is for.
- The `uuid` field can be left at 0, but when uploading to the SessionZeroDB a uuid will be assigned.
- The `id` must be unique within the datapack
- `compatible_systems` is arbitrary and only reflects if the template can be used in a datapack according to it's `compatible_systems` value
- Some default fields are required by the default parser:
- `name: text` must be present
- Metadata fields required for data object templates:
- `template_type`: must be `data`.
- `id`: denotes the template's id; must be unique within the datapack.
- `uuid`: can be left at 0, a uuid will be assigned when uploading to the SessionZeroDB.
- `version`: must follow semantic versioning.
- `data_type`: is an arbitrary value used to denote what kind of dataset type the template is for.
- `compatible_systems`: is arbitrary and only reflects if the template can be used in a datapack according to its own `compatible_systems` value.
- `description`
```ini
!id = "core_item"
!uuid = 0
!version = "1.0.0"
!data_type = "item"
!compatible_systems = "sz_core, d20"
!description = """
- Supported Field Types for `data` template types:
- text
- textblock
- bool
- number
```toml
[metadata]
template_type = "data"
id = "core_item"
uuid = 0
version = "1.0.0"
data_type = "item"
compatible_systems = ["sz_core", "d20"]
description = """
Core SessionZero item template
"""
[name]
type = "text"
# Top-level fields
name: text
description: textblock
[description]
type = "textblock"
# Example of a group
stats {
value: number
weight: number
[consumable]
type = "bool"
default_value = false
# Example of a sub-group
modifiers {
# Field with a default value
base: number = 1
}
}
# -- Stats group --
[stats.value]
type = "number"
[stats.weight]
type = "number"
[stats.modifiers.base]
type = "number"
default_value = 1
```
@@ -97,35 +109,24 @@ An instanced DatasetObject should only contain simple fields and values, no obje
```json
{
"id": "some_id",
"uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
"id": "some_id",
"uuid": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
"template_id": "core_item",
"parent_dataset_id": "core_items",
"compatible_systems": ["sz_core", "d20"],
"fields": {
"name": "Human readable name",
"template_id": "some_template_id",
"parent_dataset_id": "some_dataset_id",
"description": "A description",
"icon": "path/to/icon",
"compatible_systems": ["sz_core", "d20"],
"fields": {
"groups": [
{
"id": "group_name",
"fields": [
{
"id": "field_name",
"type": "number",
"value": 1
}
],
"sub_groups": []
}
],
"top_level_fields": [
{
"id": "name",
"type": "string",
"value": "something"
}
]
"consumable": false,
"stats": {
"value": 10,
"weight": 2,
"modifiers": {
"base": 1
}
}
}
}
```