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