XPlor/definitions/cod/assetheader.xscript
njohnson 8430428a91 Fix XScript syntax errors in COD definitions
- Convert match() function calls to if-else chains (match keyword conflict)
- Remove unsupported bracket attributes [table=..., columns=...]
- Expand inline statement with bracket attributes to explicit if block

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

55 lines
2.2 KiB
Plaintext

type assetheader
{
u32 raw_type;
i32 asset_ptr;
ui("raw_type", "Raw Type");
ui("asset_ptr", "Asset Ptr");
// Lookup asset type name based on game/platform globals
asset_type = "UNKNOWN";
if (game == "COD4" && platform == "PC") {
// COD4 PC zone file asset type mapping
// Note: No pixelshader or vertexshader on PC
if (raw_type == 0x00) { asset_type = "xmodelpieces"; }
if (raw_type == 0x01) { asset_type = "physpreset"; }
if (raw_type == 0x02) { asset_type = "xanim"; }
if (raw_type == 0x03) { asset_type = "xmodel"; }
if (raw_type == 0x04) { asset_type = "material"; }
if (raw_type == 0x05) { asset_type = "techset"; }
if (raw_type == 0x06) { asset_type = "image"; }
if (raw_type == 0x07) { asset_type = "sound"; }
if (raw_type == 0x08) { asset_type = "sndcurve"; }
if (raw_type == 0x09) { asset_type = "loaded_sound"; }
if (raw_type == 0x0A) { asset_type = "col_map_sp"; }
if (raw_type == 0x0B) { asset_type = "col_map_mp"; }
if (raw_type == 0x0C) { asset_type = "com_map"; }
if (raw_type == 0x0D) { asset_type = "game_map_sp"; }
if (raw_type == 0x0E) { asset_type = "game_map_mp"; }
if (raw_type == 0x0F) { asset_type = "map_ents"; }
if (raw_type == 0x10) { asset_type = "gfx_map"; }
if (raw_type == 0x11) { asset_type = "lightdef"; }
if (raw_type == 0x12) { asset_type = "ui_map"; }
if (raw_type == 0x13) { asset_type = "font"; }
if (raw_type == 0x14) { asset_type = "menufile"; }
if (raw_type == 0x15) { asset_type = "menu"; }
if (raw_type == 0x16) { asset_type = "localize"; }
if (raw_type == 0x17) { asset_type = "weapon"; }
if (raw_type == 0x18) { asset_type = "snddriverglobals"; }
if (raw_type == 0x19) { asset_type = "fx"; }
if (raw_type == 0x1A) { asset_type = "impactfx"; }
if (raw_type == 0x1B) { asset_type = "aitype"; }
if (raw_type == 0x1C) { asset_type = "mptype"; }
if (raw_type == 0x1D) { asset_type = "character"; }
if (raw_type == 0x1E) { asset_type = "xmodelalias"; }
if (raw_type == 0x1F) { asset_type = "rawfile"; }
if (raw_type == 0x20) { asset_type = "stringtable"; }
}
ui("asset_type", "Asset Type");
// Set display name to asset type
set_name(asset_type);
}