SCRIPTS.LST File Format

scripts\scripts.lst is the indexed registry for compiled Fallout and Fallout 2 scripts. Each physical line names one INT bytecode file, and the zero-based line number is used by MAP records, PRO records, script message lookups, decompiler headers, and modding tools.

Although it looks like a normal LST file, scripts.lst has its own parser rules. It uses .int filenames, strips the extension before storing the script name, and can carry local_vars=N metadata after a # marker.

Format Properties

PropertyDescription
Locationscripts\scripts.lst, relative to master.dat, patch000.dat, or an unpacked data directory.
File typePlain text index table.
IndexingZero-based by physical line number. The first line is script index 0.
Entry valueA script filename containing .int. The engine stores the base name without the extension.
Script file lookupscripts\<base>.int.
Dialogue file lookuptext\<language>\dialog\<base>.msg.
MetadataOptional # local_vars=N text on the same line.
CompressionNone at the file level. The file may be stored inside a compressed DAT entry.

Example

arroyo.int        # local_vars=4
doorlook.int      # local_vars=0
v13door.int

Line 0 resolves to scripts\arroyo.int and, when script message list 1 is used, to dialog\arroyo.msg. Line 1 resolves to scripts\doorlook.int and message list 2. The message-list id is one-based, while the script-list index is zero-based.

Parser Behavior

Fallout 2 CE opens scripts.lst as text and reads it line by line into a 260-byte buffer. Each read line appends one entry to the script list before the parser extracts the name and local-variable metadata.

BehaviorConsequence
Every physical line becomes an entry.Blank or malformed lines still shift all following indexes. Avoid blank lines in production lists.
The parser searches for lowercase .int.Use lowercase extension text for best compatibility with the CE source path. Older tools may be more forgiving, but a portable list should not rely on that.
The stored name is the text before .int.The engine later appends .int again when building the runtime script filename.
Names longer than 13 characters before .int fail to load.Keep script base names at 13 characters or fewer.
The name is copied from the start of the line.Do not indent entries. Leading spaces become part of the copied base name.
# enables metadata scanning.The loader looks for local_vars= only if the line contains #.
local_vars= is parsed with atoi.Use plain decimal integers. Text after the number is ignored by atoi.
Missing local_vars defaults to zero.Scripts without script-local state do not need the metadata.

The loader does not use the semicolon comment convention described for many art lists. A semicolon can still appear in the text, but it has no special meaning to the scripts.lst parser. Use # local_vars=N when the line needs local-variable metadata.

Script Indexes

The zero-based index is the most important value in the file. It selects the compiled INT filename, the dialogue MSG filename, and the local-variable count for runtime script instances.

UseIndexing rule
Runtime INT pathscriptsGetFileName(index) returns <base>.int, and the script loader opens it below scripts\.
Dialogue message listmessage_str(listId, messageId) converts listId to index = listId - 1, then loads dialog\<base>.msg.
MAP script recordThe record's script_index field is a zero-based index into scripts.lst.
MAP header scriptThe map header stores a positive one-based script index; CE subtracts one when creating the system script record.
PRO script idObject prototypes store packed script ids whose low bits identify an entry in scripts.lst.
Local variablesThe runtime uses the script record's script_index to fetch the matching local_vars count from scripts.lst.

Because the list is an index namespace, sorting it alphabetically is destructive. Reordering a working scripts.lst can silently attach the wrong script code to objects and maps, and can make message_str load the wrong dialogue file.

Packed Script Ids

Two related values are easy to confuse:

ValueWhere usedMeaning
Script-list indexscripts.lst, MAP script records, message-list ids after subtracting one.Selects the script base name and metadata line.
Runtime script id (sid)MAP object records, MAP script records, queued events, live script lists.Identifies a live script instance by type and per-type runtime id.

The script type is stored in the high byte. Fallout 2 CE extracts it with SID_TYPE(value) = value >> 24. The known script types are:

ValueNameTypical role
0SystemMap/system scripts. The map script created from the MAP header uses this type.
1SpatialSpatial trigger scripts that fire when objects enter a tile or radius.
2TimedTimed script instances and queued timer callbacks.
3ItemItem, scenery, wall, and other object-use scripts.
4CritterCritter scripts.

Older format notes often write stored script references as 0x0Y00XXXX, where Y is the script type and XXXX is the scripts.lst index. That is a useful way to read many PRO and mapper-authored references. Runtime script ids in saved maps are different: CE allocates a per-type live id with scriptGetNewId(type) and combines it as type shifted left 24 bits plus the live id.

Special sentinel values are also common. 0xFFFFFFFF means no script. Fallout 2 CE also treats 0xCCCCCCCC as an unset/debug fill value and rejects it when resolving a live script pointer.

Local Variables

The local_vars=N suffix describes the number of script-local variables that should be backed by the current map's local-variable array. These are not the same as SSL procedure-local symbols, which are compiled into INT stack/register usage. They are persistent script locals accessed through script local-variable operations at runtime.

CE loads the count into a ScriptsListEntry.local_vars_num field. When a script instance first needs local variables and its count is zero, the engine looks up the script instance's script_index, copies the count from scripts.lst, and allocates a range in the MAP local-variable array if the count is greater than zero.

CaseBehavior
Clean mapper-authored mapLoaded script records have local_vars_count cleared when the saved-map flag is not set. Counts can be rediscovered from scripts.lst.
Saved map stateThe saved-map flag preserves script local-variable counts, offsets, and values from the MAP local-variable array.
System/map scriptCE rejects script local variables for system scripts and logs that system/map scripts are not allowed local vars.
Missing metadataThe script has a count of zero. Reads may return no useful value, and writes fail because no local range is allocated.

Changing local_vars=N after maps have shipped is a save-compatibility risk. Clean maps can recover from the list, but saved maps may already contain offsets and values laid out according to the previous count.

Dialogue MSG Binding

Normal dialogue string lookup uses scripts.lst as an indirect filename table. message_str(listId, messageId) uses listId - 1 as a script-list index, appends .int, strips the extension again, and loads dialog\<base>.msg.

scripts.lst line 12:  artemple.int
SSL/INT lookup:      message_str(13, 100)
Runtime MSG file:    text\english\dialog\artemple.msg

This is why script-name constants in SSL headers are usually one-based message-list ids, not raw zero-based scripts.lst indexes. A mismatch can be subtle: the INT script runs correctly, but its dialogue calls display another script's text or fail to load a message file.

Procedure Dispatch

scripts.lst does not list procedures. Procedure names are stored inside each compiled INT file, and the engine maps known procedure names to built-in script events.

IndexProcedure nameTypical event
1startScript initialization/start pass.
2spatial_p_procSpatial trigger entered.
3description_p_procDescription request.
4pickup_p_procPickup event.
5drop_p_procDrop event.
6use_p_procUse event.
7use_obj_on_p_procUse object on object.
8use_skill_on_p_procUse skill on object.
11talk_p_procDialogue start.
12critter_p_procCritter update.
13combat_p_procCombat behavior.
14damage_p_procDamage event.
15map_enter_p_procMap enter.
16map_exit_p_procMap exit.
17create_p_procObject/script creation.
18destroy_p_procObject/script destruction.
21look_at_p_procLook-at event.
22timed_event_p_procQueued/timed event.
23map_update_p_procPeriodic map update.
24push_p_procPush event.
25is_dropping_p_procDrop query.
26combat_is_starting_p_procCombat start notification.
27combat_is_over_p_procCombat end notification.

Indexes 9, 10, 19, and 20 are represented as unused or bad procedure slots in the CE procedure-name table, although historical comments associate them with old use-ad/use-disad and barter hooks. A documentation tool should keep these slots reserved instead of renumbering later procedure ids.

Runtime Script Instances

When the engine creates a live script, it stores both a runtime sid and a script_index. The sid identifies the live instance, while script_index selects the entry in scripts.lst that names the INT program.

Script kindRuntime notes
Map/system scriptCreated from the MAP header's one-based script index when the value is greater than zero.
Object scriptCreated from PRO or MAP object script information and owned by the placed object.
Spatial scriptStores a packed built tile and radius. CE fires matching spatial scripts only for visible, non-flat objects and temporarily disables spatial recursion while dispatching.
Timed scriptCan be scheduled through queued events. The queued event stores the live sid and a fixed parameter.
sfall global scriptCE/sfall can run global-script update hooks before normal map update script dispatch. Those hooks are related to scripting, but not every sfall global-script configuration is a plain scripts.lst line.

Script records are serialized in MAP saves in five fixed type lists: system, spatial, timed, item, and critter. The live lists and their saved records are runtime state; scripts.lst remains the static table that resolves the program name and metadata for those records.

Inter-file Dependencies

FileDependency
SSLSource headers usually define script constants that must match scripts.lst line numbers or one-based message-list ids.
INTThe compiled program loaded for a line is scripts\<base>.int.
MSGDialogue text for a script is normally dialog\<base>.msg; message_str selects it through the script-list index.
PROPrototype script fields store packed references that ultimately select scripts.lst entries.
MAPMap headers, object records, and script records store script indexes or runtime SIDs that must line up with this list.
GAMGlobal variable indexes used by scripts are documented separately, but script behavior often depends on both scripts.lst and global/map variable tables.
DATPacked archives provide the actual scripts.lst, *.int, and dialog\*.msg files loaded by the engine.

Editing Guidance

Treat scripts.lst as append-only whenever possible. Adding a new script at the end preserves existing script references, dialogue list ids, and local-variable metadata indexes. Inserting a line in the middle should be treated as a migration that requires auditing every PRO, MAP, SSL header constant, dialogue message-list constant, and saved-map compatibility expectation.

EditRisk
Rename an entryRequires renaming the INT file and usually the matching dialogue MSG file. Existing MAP/PRO references still point to the same index but now run different code.
Move an entryBreaks all index-based references unless every dependent file and header constant is updated.
Delete an entryShifts all following indexes. Use a harmless placeholder instead if the index must remain reserved.
Change local_varsCan affect local-variable allocation and saved-map compatibility.
Change caseMay affect unpacked installs or tools on case-sensitive filesystems. Preserve original case unless the target engine normalizes it.

Validation Checklist

Source Code Notes

The behavior above is backed by Fallout 2 CE source. Important functions and structures include:

Source symbolWhat it shows
ScriptsListEntryStores name[16] and local_vars_num.
scriptsLoadScriptsListReads scripts.lst, strips .int, rejects names longer than 13 characters, and parses local_vars=.
scriptsGetFileNameReconstructs <base>.int from a script-list index.
scriptsGetMessageListConverts a one-based script message-list id into dialog\<base>.msg.
ScriptTypeDefines system, spatial, timed, item, and critter script type values.
scriptGetNewIdBuilds runtime SIDs from a script type and per-type live id.
scriptGetLocalVar / scriptSetLocalVarShows how local_vars metadata is applied and why system/map scripts reject local vars.
gScriptProcNamesLists the engine-recognized built-in procedure names.

References

History

2026-05-07 - Added dedicated scripts.lst documentation from Fallout 2 CE source and the existing MAP, PRO, INT, SSL, and MSG notes.