Documentation
LoreHub Dialogue System

Relations version 1

relations.json holds every relation between documents in a world: who is whose parent, ally or rival, and how strongly. Game Sync writes it at the top of a game's folder, next to the dialogues, whenever the world has relations. You can also download it from GET /api/v2/Export/ExportRelations/{worldId}.

Schema

{
  "schemaVersion": 1,
  "relationTypes": [
    { "key": "ally", "id": "5f0c7a52-3e8e-4f5b-9a8f-0c3b6b1d9f10", "sides": ["Ally", "Ally"], "shape": "mutual", "hasValue": true, "colour": "green" },
    { "key": "parent_child", "id": "b8d1f7e4-0a52-4c39-8c1d-7f1e2a6c4b90", "sides": ["Parent", "Child"], "shape": "hierarchy", "hasValue": false, "colour": "blue" }
  ],
  "documents": [
    { "id": "031476c0-2504-4ed7-aa79-e5fce21e2091", "name": "Mira Voss", "template": "Character" },
    { "id": "4a8e2d10-6c1f-4f0e-9d7a-2b5c8e3f1a77", "name": "Edda Voss", "template": "Character" },
    { "id": "9c3b7e21-5d4a-4b8f-a1e6-0f2d7c9b3e55", "name": "Oskar Venn", "template": "Character" }
  ],
  "relations": [
    { "id": "e1c4a7b2-3f6d-4e9a-8b0c-5d2f1a7e9c33", "type": "ally", "from": "031476c0-2504-4ed7-aa79-e5fce21e2091", "to": "9c3b7e21-5d4a-4b8f-a1e6-0f2d7c9b3e55", "value": 60, "note": "Since the harbor fire" },
    { "id": "7b2e9f40-1a3c-4d5e-b6f7-8c9d0e1f2a3b", "type": "parent_child", "from": "4a8e2d10-6c1f-4f0e-9d7a-2b5c8e3f1a77", "to": "031476c0-2504-4ed7-aa79-e5fce21e2091" }
  ]
}

Relation types

FieldDescription
keyThe type's export key, unique in the world and in snake_case (lowercase letters, digits and underscores). You can set it in Relation types. A new type gets one from its side names (ally for a mutual type, parent_child for the others, _2, _3 when taken), and renaming a side keeps it. A type made before export keys existed gets its key from its side names until it is edited.
idThe type's id in LoreHub. It never changes.
sidesSide A's name, then side B's. A mutual type has the same name twice.
shapedirected, mutual or hierarchy.
hasValueWhether relations of this type carry a value from -100 to 100.
colourThe type's colour in LoreHub: grey, red, orange, yellow, green, teal, blue, indigo, purple or pink.

Documents

Only the documents that relations join are listed. id is the same as in the dialogue export's Document resources, so a speaker in a dialogue can be matched to their relations. template is the name of the document's template, or absent for a document without one.

Relations

FieldDescription
idThe relation's id. It stays the same when the relation is edited.
typeThe key of its relation type.
fromThe document on side A. In a hierarchy type it is the parent.
toThe document on side B.
valueFrom -100 to 100. Only written when the type has values switched on and the relation has one.
noteThe writer's note, when there is one.

A mutual relation is listed once: read it both ways. Files are sorted by key and id, so a pull request from Game Sync shows only what changed.