STB - LordNed/WindEditor GitHub Wiki
The data that runs major cutscenes is stored in STB files.
###File Header
//In total 0x20 /32 bytes long
/*0x00*/ string magic; //"STB\0"
/*0x02*/ short endianness; // BOM, 0xFEFF unless flipped endianness
/*0x04*/ short unknown1;
/*0x08*/ int fileSize;
/*0x0C*/ int numObjects;
/*0x10*/ string unknown2; // "jstudio\0", maybe name of program that created the file
/*0x18*/ int unknown3;
/*0x1C*/ int unknown4;
###Object Header
/*0x00*/ int objectSize;
/*0x04*/ string objectType;
/*0x08*/ int nameSize;
/*0x0C*/ string objectName;
NOTE: If nameSize is not a multiple of 4, there is padding after the null terminator of objectName to make up the extra space.
###JFVB Header
Considered an object for numObjects
purposes, the JFVB block differs from the other objects in that it doesn't have the above common object header. Instead, it uses the following header:
/*0x00*/ int objectSize?;
/*0x04*/ string objectType; // "JFVBFVB\0"
//------
/*0x0C*/ short endianness; // BOM
/*0x0E*/ short unknown1;
/*0x10*/ int objectSize2; // From `endianness` field to end-of-object
/*0x14*/ int numBatches;
###Commands
####Control Command
/*0x00*/ short cmdType; //Control commands: 0x8000, 0x0200, 0x0400
/*0x02*/ short cmdLoad;
There are only three control commands: paragraph declaration (0x8000), wait (0x0200), and halt (0x0400).
####Data Command
/*0x00*/ short loadSize;
/*0x02*/ short cmdType;
/*0x04*/ byte[loadSize] cmdLoad; //Data types held in this array depends on cmdType
####Structure
Commands are organized into blocks called "paragraphs," with the structure
[Paragraph declaration]
[Data commands]
[Wait command]
An object may begin with either the first paragraph or a wait command. There are also rare cases in which two wait commands appear back-to-back.