Skip to main content

load_dbtable_configs

Function load_dbtable_configs 

Source
pub fn load_dbtable_configs(
    registry: &mut SymbolRegistry,
    files: &[PathBuf],
    dbtable_ids: &HashMap<String, u16>,
)
Expand description

Scan .dbtable files under scripts_dir and register each column as a compound entity ID table:column → packed int, mirroring 2004scape’s runescript lookup.

Packed format: (tableId << 12) | (colIdx << 4) | tupleNibble where tupleNibble is 0 for the whole tuple and N+1 for slot N.

Also populates registry.dbcolumn_types so db_find(music:playbutton, ...) emits the correct BaseVarType ordinal.

dbtable_ids is the pre-loaded name→id mapping from dbtable.pack — the same IDs the runtime uses when indexing rows.