Dialogue Node Option version 2
Schema: Dialogue Node Options that ends Dialogue
{
"type": "@lorehub/dialogue-node-option",
"apiVersion": "2.0.0",
"id": "dialogue/6147dcb9-b8bd-4238-9c8b-5b773260570c/dialogue-node/895b060b-8af4-47c7-b607-98455103e9b1/dialogue-node-option/08acd44c-a3f6-4f82-9adf-c0b6f87b882d",
"text": "Bye",
"stateData": { "selected": false }
}
Schema: Dialogue Node Option that leads to next node
Use links to connect Nodes, Options and Dialogue Link v1.1
An option can have several links, each with its own conditions. Follow a link whose conditions are all met.
When a link returns to the options of a node ("entry": "options"), show the node's options again and check each option's requiredVariables again.
Schema: Dialogue Node Options with required variables
{
"type": "@lorehub/dialogue-node-option",
"apiVersion": "2.0.0",
"id": "dialogue/6147dcb9-b8bd-4238-9c8b-5b773260570c/dialogue-node/895b060b-8af4-47c7-b607-98455103e9b1/dialogue-node-option/08acd44c-a3f6-4f82-9adf-c0b6f87b882d",
"text": "Bye",
"requiredVariables": [
{
"variableId": "f7fbdcd0-60ac-407e-9239-bb3214119298",
"value": "true"
}
]
}
RequiredVariables
Contains reference to variable and value that is required for this dialog option. All required variables must have their values (AND). Conditions on where the option leads are set on its links.
Number conditions
A condition on a number or unsignedNumber variable can compare instead of checking equality. Such a condition has operator:
{
"variableId": "3b0c3e4e-5b1c-4a55-8f0a-5f7d1d2a9b11",
"value": "10",
"operator": ">="
}
operator - optional, left out when it is ==. One of ==, !=, <, <=, >, >=; the condition is met when variable operator value is true, so the example needs gold of 10 or more. Boolean and state data conditions always use ==.
State data conditions
A condition can check the dialogue's state data instead of a variable: whether a node was played or an option was selected. Such a condition has kind, and its variableId is the id of the node or option, which is always in the same dialogue:
{
"variableId": "08acd44c-a3f6-4f82-9adf-c0b6f87b882d",
"value": "true",
"kind": "stateData.isOptionSelected"
}
kind - optional. Left out when variableId is a variable.
stateData.isNodePlayed-variableIdis a node; the condition is met when the node'sstateData.playedequalsvalue.stateData.isOptionSelected-variableIdis an option; the condition is met when the option'sstateData.selectedequalsvalue.
value - "true" or "false".
LoreHub doesn't let authors delete a node or option while a condition checks it, so variableId always points to a node or option of the exported dialogue.
StateData
Every option has a stateData block. It is required and always exported with its default value:
"stateData": {
"selected": false
}
selected - false until the player picks the option, then the game engine or player sets it to true. It is runtime state: authors can't set it in LoreHub and it is not saved with the dialogue. Your game keeps it per playthrough and decides when to reset it.