Oblivion Mod:Save File Format/QUST
Contents
A QUST Change Record (change record type 59) describes changes to the game's quests (QUST mod file records). It can contain the following subrecords (with their corresponding byte in the overall Flags), in order of appearance:
- Quest Flags (2)
- Quest Stages (28)
- Quest Script (27)
The relative positions of the subrecords and their contents (as far as they are understood) are based on actual save files.
Quest Flags[edit]
The Quest Flags subrecord is present when bit 2 (0x00000004) is set in a QUST record's overall Flags. Its length is a constant 1 byte. The meaning of the data contained in the Quest Flags subrecord is unknown.
Name | Type/Size | Info |
---|---|---|
unknown | ubyte[1] | Constant length of observed change records. |
Quest Stages[edit]
The Quest Flags subrecord is present when bit 28 (0x10000000) is set in a QUST record's overall Flags. Its length is variable. The parameters controlling the subrecord length are well-understood, although the meaning of all the data contained in the Quest Stages subrecord is unknown.
Name | Type/Size | Info |
---|---|---|
stageNum | ubyte | Number of stages in the Quest Stages subrecord. It is also the number of defined stages for this quest (specifically, the number of INDX values in the mod file for this quest) |
stage | struct[stageNum] | |
|
ubyte | The value of INDX (e.g., 0, 10, 100) for this quest stage. |
|
ubyte | 0x01 indicates stage done. |
|
ubyte | Number of entries for this quest stage |
|
struct[stageEntryNum] | A 5-byte structure |
|
ubyte | The number of this entry in the overall Quest Stages subrecord (i.e., it does not reset to zero for each new stage) |
|
short | Stage completion day of the year (e.g. 0xF7 = 247 is 4th of Heartfire). Zero if this stage entry was not completed. |
|
short | Stage completion year (e.g. 0x1B1 = 433 is the year 3E 433). Zero if this stage entry was not completed. |
Quest Script[edit]
The Quest Script subrecord is present when bit 27 (0x08000000) is set in a QUST record's overall Flags. Its length is variable (minimum 3), and the parameters controlling the subrecord length are only partially understood. The meaning of the data in the subrecord is unknown.
The structure provided below for the Quest Script subrecord is the best description possible at this time, and works for the majority (>90%) of subrecords. The pattern of data in the subrecord supports the 12-byte segments (each segment starts with 0x00 value bytes and ends with multiple consecutive non-zero bytes). However, exceptions exist, where this subrecord is shorter than predicted by the provided structure (4-12 bytes shorter in analyzed cases). No pattern has been recognized yet for predicting these exceptions. In the meantime, care must be taken to not read past the end of the QUST change record when processing the Quest Script subrecord.
Name | Type/Size | Info |
---|---|---|
dataNum | ushort | Number of data segments |
unknown | ubyte | |
data | struct[dataNum] | |
|
byte[12] | Length is occasionally less than 12 bytes for unknown reasons (see notes above). |