pub struct Ifo {Show 56 fields
pub is_save_game: bool,
pub is_nwm_file: bool,
pub nwm_res_name: String,
pub module_id: Vec<u8>,
pub creator_id: i32,
pub version: u32,
pub tag: String,
pub name: GffLocalizedString,
pub description: GffLocalizedString,
pub start_movie: ResRef,
pub entry_area: ResRef,
pub entry_x: f32,
pub entry_y: f32,
pub entry_z: f32,
pub entry_dir_x: f32,
pub entry_dir_y: f32,
pub min_per_hour: u8,
pub dawn_hour: u8,
pub dusk_hour: u8,
pub xp_scale: u8,
pub start_year: u32,
pub start_month: u8,
pub start_day: u8,
pub start_hour: u8,
pub start_minute: u16,
pub start_second: u16,
pub start_millisecond: u16,
pub transition: u32,
pub pause_time: u32,
pub pause_day: u32,
pub effect_next_id: u64,
pub next_char_id_0: u32,
pub next_char_id_1: u32,
pub next_obj_id_0: u32,
pub next_obj_id_1: u32,
pub hak: String,
pub on_heartbeat: ResRef,
pub on_user_defined: ResRef,
pub on_mod_load: ResRef,
pub on_mod_start: ResRef,
pub on_client_enter: ResRef,
pub on_client_leave: ResRef,
pub on_activate_item: ResRef,
pub on_acquire_item: ResRef,
pub on_unacquire_item: ResRef,
pub on_player_death: ResRef,
pub on_player_dying: ResRef,
pub on_spawn_btn_down: ResRef,
pub on_player_rest: ResRef,
pub on_player_level_up: ResRef,
pub on_equip_item: ResRef,
pub areas: Vec<IfoArea>,
pub expansion_list: Vec<IfoExpansion>,
pub cutscene_list: Vec<IfoCutScene>,
pub player_list: Vec<IfoPlayer>,
pub tokens: Vec<IfoToken>,
}Expand description
Typed IFO model built from/to [Gff] data.
Fields§
§is_save_game: boolWhether this is a save game (Mod_IsSaveGame).
is_nwm_file: boolWhether this is an NWM file (Mod_IsNWMFile).
nwm_res_name: StringNWM resource name, only meaningful when is_nwm_file is true (Mod_NWMResName). If empty when flagged as NWM, execution becomes unstable.
module_id: Vec<u8>Module ID blob (Mod_ID), kept at whatever length the file carries.
Vanilla module.ifo carries 16 bytes; every savegame module.ifo
carries 32. The difference is an engine artefact rather than a format
rule: the loader reads this into a fixed 32-byte buffer it never
zeroes, and the writer always emits all 32 back, so a vanilla module
widens to 32 the first time the game saves it and the upper half is
whatever was in that memory.
Do not pad short values to 32 bytes to match. That reproduces the engine’s own bug, and it is the tempting move for anyone who checks only savegames, where 32 looks canonical. Reading 16 and writing 16 leaves the file exactly as its author wrote it. The engine never consumes or compares this value, so neither behaviour affects play.
creator_id: i32Creator ID (Mod_Creator_ID).
version: u32Module version (Mod_Version).
tag: StringModule tag (Mod_Tag).
name: GffLocalizedStringLocalized module name (Mod_Name).
description: GffLocalizedStringLocalized module description (Mod_Description).
start_movie: ResRefIntroductory movie (Mod_StartMovie).
entry_area: ResRefEntry area resref (Mod_Entry_Area).
entry_x: f32Entry X coordinate (Mod_Entry_X).
entry_y: f32Entry Y coordinate (Mod_Entry_Y).
entry_z: f32Entry Z coordinate (Mod_Entry_Z).
entry_dir_x: f32Entry facing direction X (Mod_Entry_Dir_X). If X and Y are both 0.0, engine locks spawn facing east (1.0, 0.0).
entry_dir_y: f32Entry facing direction Y (Mod_Entry_Dir_Y). If X and Y are both 0.0, engine locks spawn facing east (1.0, 0.0).
min_per_hour: u8Minutes per game hour (Mod_MinPerHour). If missing, defaults to 2.
dawn_hour: u8Dawn hour (Mod_DawnHour). If equal to dusk hour, module is locked into perpetual daylight. If missing, defaults to 6.
dusk_hour: u8Dusk hour (Mod_DuskHour). If equal to dawn hour, module is locked into perpetual daylight. If missing, defaults to 18. Engine derives a continuous day/night state flag from dawn_hour, dusk_hour, and the current hour: 1 = Day, 2 = Night, 3 = Dawn, 4 = Dusk.
xp_scale: u8XP scale multiplier (Mod_XPScale). Setting to 0 completely halts localized XP acquisition. If missing, defaults to 10.
start_year: u32Game calendar year (Mod_StartYear, save-only, default 1340).
start_month: u8Calendar month (Mod_StartMonth, save-only, default 6).
start_day: u8Calendar day (Mod_StartDay, save-only, default 1).
start_hour: u8Calendar hour (Mod_StartHour, save-only, default 23).
start_minute: u16Calendar minute (Mod_StartMinute, save-only, default 0).
start_second: u16Calendar second (Mod_StartSecond, save-only, default 0).
start_millisecond: u16Calendar millisecond (Mod_StartMiliSec, save-only, default 0).
transition: u32Transition state (Mod_Transition, save-only, default 0).
pause_time: u32Paused time-of-day in milliseconds (Mod_PauseTime, save-only, default 0).
pause_day: u32Paused calendar day (Mod_PauseDay, save-only, default 0).
effect_next_id: u64Next effect ID counter (Mod_Effect_NxtId, save-only).
next_char_id_0: u32Next character ID low word (Mod_NextCharId0, save-only).
next_char_id_1: u32Next character ID high word (Mod_NextCharId1, save-only).
next_obj_id_0: u32Next object ID low word (Mod_NextObjId0, save-only).
next_obj_id_1: u32Next object ID high word (Mod_NextObjId1, save-only).
hak: StringHak pack name (Mod_Hak, save-only). The save routine writes this string into save-games as a leftover NWN legacy artifact, but LoadModuleStart completely ignores it - cannot be used to hook custom override archives.
on_heartbeat: ResRefOn-heartbeat script (Mod_OnHeartbeat).
on_user_defined: ResRefOn-user-defined script (Mod_OnUsrDefined).
on_mod_load: ResRefOn-module-load script (Mod_OnModLoad).
on_mod_start: ResRefOn-module-start script (Mod_OnModStart).
on_client_enter: ResRefOn-client-enter script (Mod_OnClientEntr).
on_client_leave: ResRefOn-client-leave script (Mod_OnClientLeav).
on_activate_item: ResRefOn-activate-item script (Mod_OnActvtItem).
on_acquire_item: ResRefOn-acquire-item script (Mod_OnAcquirItem).
on_unacquire_item: ResRefOn-unacquire-item script (Mod_OnUnAqreItem).
on_player_death: ResRefOn-player-death script (Mod_OnPlrDeath).
on_player_dying: ResRefOn-player-dying script (Mod_OnPlrDying).
on_spawn_btn_down: ResRefOn-spawn-button-down script (Mod_OnSpawnBtnDn).
on_player_rest: ResRefOn-player-rest script (Mod_OnPlrRest).
on_player_level_up: ResRefOn-player-level-up script (Mod_OnPlrLvlUp).
on_equip_item: ResRefOn-equip-item script (Mod_OnEquipItem). Asymmetric I/O: the engine loads this during LoadModuleStart but entirely omits it from SaveModuleIFOStart save-game serialization.
areas: Vec<IfoArea>Module areas (Mod_Area_list). An empty list will fault the engine load cycle. The format technically supports multiple entries (NWN legacy), but the KOTOR engine strictly enforces a single active area boundary per module.
expansion_list: Vec<IfoExpansion>Expansion list (Mod_Expan_List).
cutscene_list: Vec<IfoCutScene>Cutscene list (Mod_CutSceneList).
player_list: Vec<IfoPlayer>Player list (Mod_PlayerList, save-only).
tokens: Vec<IfoToken>Token list (Mod_Tokens).