Its a unique data type in the sense that its 2 parts, part one is the data type part 2 is the number of bytes in the script
Code Snip It, includes the next items DataType
Code: Select all
Lets break that code down to better understand a StructItemScript
000F2C00 - this is the DataType, 0x00000F00; Falls perfectly in place with all other structure item DataTypes the only difference is the last 2 bytes are actually the script size. 2C00 = 44 bytes
DB162E35 - The script name - Disqualify_Script
34C30000 - The offset to the start of the script
60C30000 - The offset to the next DataType after the script
The next byte is the start of the script and this is where our byte count starts. These scripts are constructed like THPS3/4 where a new instruction starts with byte 0x02 and is followed by a 4 byte value. The value for a StructItemScript is actually a total item count of the entire script.
02 F0080000 - new instruction + item count
16 0B9D3383 - Translates to: SetPart
16 398FF0B6 07 16 4DF45724 - Translates to: part = body
16 4E08B24B 07 16 1F31FA28 - Translates to: desc_id = MaleBody
02 F1080000 - new instruction + item count
24 - Translates to: endfunction
02 F2080000 - new instruction + item count; This is the count for the next DataType.
00 - padding, all pak scripts are padded by %4 meaning the end of the data ends at either byte 0, 4, 8, C. This is the last byte in our script, byte 44.
001B0000 - New DataType which equals StructItemQbKey