You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, thanks for compiling all of this information in one place! It's been very useful.
I thought I'd share some of my own findings about the CST format, but unfortunately the wiki seems to be read-only.
What you call the "Input Offset Table" is actually the list of script blocks.
Conceptually, a CatScene script consists of a number of blocks, where each block contains one or more lines.
Blocks are not only used for skipping, they are also essential so how saving and loading works.
It is not possible to create a save state in the middle of a block, just between them.
When you save while a block is being executed and load the resulting save file, the entire block will start from the beginning.
When debug mode is enabled and you open the "Messages" window, what you are seeing is actually a list of script blocks you can jump to. So if a block contains multiple message lines (even if they are not consecutive), they will be displayed as one concatenated string.
While disassembling the script compiler (mc.exe), I've discovered some more facts:
You can terminate any line with a backslash to concatenate it with the next line.
This also works in the middle of a command, not just in messages (only one script line will be generated).
If the first character in a line is a backslash, the line will be treated as a message instead of a command.
The compiler supports several (case insensitive) command line flags, some of which are undocumented: -u or /u only overwrite scripts if the .txt file is newer than the .cst file -l or /l write source file and line number information to the .cst script -x or /x skips the compression step and writes an uncompressed .cst script -d or /d appears to do nothing
Flags only apply to file names specified after the flag.
The line type is actually just a single byte value, the byte before it is hardcoded to 0x01.
There are two more line types that are not currently listed on the wiki page;
ScriptName (0xF0) and LineNo (0xF1). They are only emitted when the -l flag is set.
The text was updated successfully, but these errors were encountered:
Hey, thanks for compiling all of this information in one place! It's been very useful.
I thought I'd share some of my own findings about the CST format, but unfortunately the wiki seems to be read-only.
What you call the "Input Offset Table" is actually the list of script blocks.
Conceptually, a CatScene script consists of a number of blocks, where each block contains one or more lines.
Blocks are not only used for skipping, they are also essential so how saving and loading works.
It is not possible to create a save state in the middle of a block, just between them.
When you save while a block is being executed and load the resulting save file, the entire block will start from the beginning.
When debug mode is enabled and you open the "Messages" window, what you are seeing is actually a list of script blocks you can jump to. So if a block contains multiple
message
lines (even if they are not consecutive), they will be displayed as one concatenated string.I've also created a a formal definition of the binary format:
https://github.com/AtomCrafty/TriggersTools.CatSystem2/wiki/cst.ksy
While disassembling the script compiler (
mc.exe
), I've discovered some more facts:You can terminate any line with a backslash to concatenate it with the next line.
This also works in the middle of a command, not just in messages (only one script line will be generated).
If the first character in a line is a backslash, the line will be treated as a message instead of a command.
The compiler supports several (case insensitive) command line flags, some of which are undocumented:
-u
or/u
only overwrite scripts if the .txt file is newer than the .cst file-l
or/l
write source file and line number information to the .cst script-x
or/x
skips the compression step and writes an uncompressed .cst script-d
or/d
appears to do nothingFlags only apply to file names specified after the flag.
The line type is actually just a single byte value, the byte before it is hardcoded to
0x01
.There are two more line types that are not currently listed on the wiki page;
ScriptName (
0xF0
) and LineNo (0xF1
). They are only emitted when the-l
flag is set.The text was updated successfully, but these errors were encountered: