LMS > Overview > Flow Chart (MSBF)

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

TypeDescription
FLW3Nodes
FEN1Flowchart Labels
REF1?

FLW3 Block

This section holds all the nodes.

OffsetSizeDescription
0x02Node count
0x22Branch table ID 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 type (Only for Branch Nodes and Event Nodes)
0x22Reserved
0x44Parameter value
0x88Node data

Node Types

ValueTypeDescription
1MessagePrompts a message from a 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

Parameter Types

Parameter types dictate how parameter values may be passed into the node if it takes arguments. There may be more than one value passed into a node.

ValueDescription
0Int32 value
1Pair of Int16 values
2Int16 value + pair of Int8 values
3Pair of Int8 + Int16 value
4Int8 Array
5String value. Stored as an offset from start of block to the string in the string table
6Int32 value

Message Node

OffsetSizeDescription
0x02Next node index
0x22MSBT file index
0x42Message index into TXT2
0x62Unused

Branch Node

OffsetSizeDescription
0x020xFFFF
0x22Node Identifier
0x42Branch table case count
0x62Starting index into the branch table

Event Node

OffsetSizeDescription
0x02Next node index
0x22Node 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
0x02Flowchart index
0x26Unused

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.

Branch Table

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

OffsetSizeDescription
0x0List of node IDs

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.