XPlor/definitions/cod/zonefile.xscript
2026-01-01 22:18:40 -05:00

25 lines
980 B
Plaintext

type zonefile [display="Zone File"]
{
// Access global variables set by fastfile
// game_name = game; // Example: access the global 'game' variable
// platform_id = platform; // Example: access the global 'platform' variable
content_len = u32at(pos()) [ui, readonly, display="Content Length"]; // peek-style
u32 content_len_raw; // actually consume it
remaining_after_len = size() - pos();
// If we can afford 10 dwords, assume "non-COD5 header layout"
if (remaining_after_len >= (10 * 4)) {
header_kind = 0 [ui, readonly, display="Header Kind"]; // 0 = non-COD5
repeat(10) { u32 header_dw; }
content_len_total = content_len_raw + 44 [ui, readonly, display="Computed Total Size"];
} else {
header_kind = 1 [ui, readonly, display="Header Kind"]; // 1 = COD5-like
repeat(8) { u32 header_dw; }
content_len_total = content_len_raw + 36 [ui, readonly, display="Computed Total Size"];
}
assetlist_obj = parse_here("assetlist");
}