Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

LMS > Overview > Flow Chart (MSBF)

This file is identified by the magic number MsgFlwBn. The format holds flowcharts.

This page describes file format version 3.

TypeDescription
FLW3Nodes
FEN1Flowchart Labels
REF1?

FLW3 Block

This section stores a global pool of all nodes in the file.

OffsetSizeDescription
0x02Node count
0x22Branch table index count
0x412Padding
0x1016 per nodeNodes
2 per IDBranch table
String table

Nodes

Actions defined within the FLW3 Section are done via nodes.

OffsetSizeDescription
0x01Node type
0x11Parameter types (Only for Branch Nodes and Event Nodes)
0x22Reserved
0x44Parameter data
0x88Node data

Node Types

ValueTypeDescription
1MessagePrompts a message from an MSBT file
2BranchBranches to a different node depending on a specific condition
3EventExecutes a specific action or game event
4EntryNode that acts as a starting point for a flowchart
5JumpJumps to a different flowchart in the current file or an external MSBF

Parameter Types

The parameter type determines how the 4 byte parameter data will be parsed by the game. Once the data has been interpreted, the values obtained are passed to the node as arguments.

ValueArguments
0u32
1u16, u16
2u16, u8, u8
3u8, u8, u16
4u8, u8, u8, u8
5str (offset from start of block to string in string table)
6u32

Message Node

OffsetSizeDescription
0x02Next node index
0x22MSBT file index into the CTI1 block of an MSBP
0x42Message index into TXT2
0x62Unused

Branch Node

OffsetSizeDescription
0x020xFFFF
0x22Condition identifier
0x42Branch table case count
0x62Starting index into the branch table

Event Node

OffsetSizeDescription
0x02Next node index
0x22Event identifier
0x44Unused

The node identifier allows a game to link the node to a specific action or condition.

Entry Node

OffsetSizeDescription
0x02Next node index
0x26Unused

Jump Node

OffsetSizeDescription
0x02Entry node index
0x22MSBF file index into the CTI1 block of an MSBP
0x44Unused

The next node index when marked as 0xFFFF is the end of a flowchart unless it is a branch node. The next node for a jump node must refer to the index of the entry node for another flowchart.

When the MSBF file index is marked as 0xFFFF, the jump node is referencing a flowchart in the current file.

Branch Table

Nodes that are branch will jump to a specific case based on a condition. These function like switch statements.

OffsetSizeDescription
0x0List of node indices

String Table

OffsetSizeDescription
0x0List of null-terminated strings

FEN1 Block

This block contains the flowchart labels. The index of a flowchart is the location of its Entry node.