XPlor/definitions/cod/zonefile.xscript
njohnson f3bca6871e Update COD XScript definitions with new syntax
- Migrate from set_global/get_global to ctx_set/ctx_get
- Replace if-else chains with match() expressions
- Update inline pointer handling patterns
- Improve GfxWorld and asset parsing structures
- Clean up redundant code across 60+ definition files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 12:09:57 -05:00

36 lines
996 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("content_len", "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("header_kind", "Header Kind"); // 0 = non-COD5
repeat(10) { u32 header_dw; }
content_len_total = content_len_raw + 44;
ui("content_len_total", "Computed Total Size");
} else {
header_kind = 1;
ui("header_kind", "Header Kind"); // 1 = COD5-like
repeat(8) { u32 header_dw; }
content_len_total = content_len_raw + 36;
ui("content_len_total", "Computed Total Size");
}
assetlist_obj = parse_here("assetlist");
}