Skip to main content

Flowchart

MahiruAbout 2 min

Flowchart

A flowchart draws the story nodes of your game as a chart. After the player passes a node, it is unlocked. The player can then view unlocked nodes in the flowchart and click a node to return to the progress recorded there.

Info

The flowchart is available since v4.6.2.

Enabling the Flowchart

Two steps are required:

  1. Add Enable_flowchart:true; to config.txt.
  2. Put a flowchart.json file describing the flowchart in the game folder.

Once enabled, a Flowchart entry appears in the game menu and the bottom control bar.

Tips

If you use the graphical editor, you can edit the flowchart visually on the editor's flowchart page instead of writing flowchart.json by hand.

Format of flowchart.json

The following example contains a main story and one character route:

{
  "flowcharts": [
    {
      "id": "main",
      "name": "Main Story",
      "type": "main",
      "nodes": [
        { "id": "start", "type": "root", "position": { "x": 0, "y": 0 }, "data": { "label": "Prologue", "sceneName": "start.txt", "isRoot": true } },
        { "id": "ch1", "type": "chapter", "position": { "x": 0, "y": 120 }, "data": { "label": "Chapter 1", "sceneName": "chapter1.txt" } }
      ],
      "edges": [
        { "id": "e-start-ch1", "source": "start", "target": "ch1" }
      ]
    },
    {
      "id": "route_a",
      "name": "Route A",
      "type": "character",
      "nodes": [
        { "id": "a1", "type": "chapter", "position": { "x": 0, "y": 0 }, "data": { "label": "Route A Chapter 1", "sceneName": "route_a/chapter1.txt" } }
      ],
      "edges": []
    }
  ]
}

Each item in flowcharts is one flowchart, shown as a tab in the flowchart screen:

FieldDescription
idUnique identifier of the flowchart
nameName shown on the tab
typemain (main story) or character (character route). Defaults to character. A flowchart whose id is main is always treated as the main story. The main story is always shown; a character route stays hidden until the player unlocks any of its nodes, to avoid spoilers
nodesList of nodes
edgesList of edges

Fields of each node:

FieldDescription
idUnique identifier of the node within this flowchart
data.labelName shown on the node
data.sceneNameScene file of the node, relative to the scene folder, such as chapter1.txt or route_a/chapter1.txt
data.isRootWhether the node is a starting point of the flowchart
typeNode type, such as root, chapter, branch, ending, or event. Used by the editor
positionPosition of the node in the editor. The in-game flowchart is laid out automatically from the edges and does not use this position

Fields of each edge: id is the unique identifier of the edge, and source and target are the ids of the start and end nodes.

Unlocking and Returning to Nodes

After entering the scene of a node, the node is unlocked when the first dialogue of that scene is shown, and the current progress is recorded. If nodes in several flowcharts point to the same scene, they are unlocked together. When the player passes an unlocked node again, the recorded progress is updated to the latest one.

Clicking an unlocked node in the flowchart returns the player to the recorded progress. Locked nodes cannot be clicked.

Clearing all data in Options → System also clears the flowchart progress.

Displaying Locked Nodes

Set how locked nodes are displayed with Flowchart_Locked_Node_Visibility in config.txt:

ValueEffect
nodeDefault. Shows the node without its name
allShows the node and its name
noneHides locked nodes completely
Enable_flowchart:true;
Flowchart_Locked_Node_Visibility:none;