Project X/Scheme file
From Worms Knowledge Base
A scheme file has scheme flags affecting general game behavior and contains one or more weapon tables. After this, attached files and scripts follow. A list of libraries can be found before the attached scheme file.
The data types are in C# notation.
The header provides general information about the scheme file details.
|0||12||raw string||Identification||"SCHM OF WAPX"||This string is not prefixed with an integer and also does not contain a terminating postfix.|
Scheme flags affect the general game behavior and are set as a group of 1-byte booleans.
|27||1||bool||Shoot doesn't end turn||0x00|
|28||1||bool||No loss of control||0x00|
|29||1||bool||Firing pauses timer||0x01|
|30||1||bool||Allow WA scheme to tweak power||0x01|
A scheme must contain at least 1 weapon table. Theoretically, up to 2^16 tables are possible. Each weapon table consists of 71 weapon entries (of which several are utilites and not literally "weapons"). The header tells how many weapon tables are available in the file, following one after another. Information on about how to parse a single weapon can be found here.
|31||4||int||Table Count||0x01||Cannot be zero.|
|35 (first)||diff.||Weapon||Weapon of table||Repeated 71 times for each table.|
The meaning of the following integer is most possibly a counter for a type of structure not implemented in the most recent Project X version. Thus, it is always zero.
|diff.||4||int||Unknown Structure Count||0x00000000||Always zero.|
Attached files follow. Again, an integer specifies how many files are attached.
A single attached file is described with the following structure, which of course repeats for the number of files in the scheme:
|diff.||4||int||Length||The length of the file data in bytes following without this describing structure.|
|diff.||s. Length||int||Data||The raw bytes of the attached file.|
Scripts are attached to the scheme as strings with an additional name. As you might have guessed, an integer reveals how many of the scripts are found.
For each script, the following structure follows:
|diff.||diff.||string||Script contents||The source code of the script.|
Libraries can be "attached" to a scheme. However, the library file contents are of course not copied into the scheme file, but referenced with the library file name, and so only the library file names are listed. Surprisingly, we have an integer giving the number of attached libraries (or, to say, the number of library file name strings following).
Repeated the times Library Count gave you:
|diff.||diff.||string||Library File Name||This is the file name including the extension ".pxl".|
Optionally, a typical WSC scheme can be included in the Project X scheme. A 1-byte boolean tells you if this is the case.
|diff.||1||byte||Scheme attached flag||If true, the following details about the scheme file exist.|
|diff.||4||int||Length||Length of data in bytes without this descriptive header|
|diff.||diff.||string||Name||Original file name of the scheme including the .wsc extension.|