saints row iv · missions & scripts

Saints Row IV Missions & Mission Scripts

How missions are defined, how mission scripts run, and what happens when a mission ends.

Missions & Scripts14 rows
TopicHow it worksWhere
Where missions come from
Mission list_objectives.xtbl: each mission/quest with name, contact, priority, prerequisites, tutorials, story flags.xtbl_load_objectives 006466d0
In the worldEach mission has a mission_info object at its start point. Flags at +0x7A: bit 0 = unlocked, bit 2 = complete.world_find_mission_info 00636270
Current missionGlobal pointer to the running mission.g_current_mission 01810030
Checkpointsmission_checkpoints.xtbl: named restart points per mission.xtbl_load_mission_checkpoints 0084df20
How mission scripts run
LanguageLua 5.1 in the 'game play' engine. Globals are sandboxed so scripts can't accidentally create globals.script_sandbox_globals 01148ab0
ThreadsScripts run as cooperative threads: thread_new starts one, thread_yield pauses it until next frame.script_thread_create 01147d90
Every frameAll script threads are resumed once per frame (step #9 of the in-game frame). Spare frame time is used for Lua garbage collection.script_system_frame 011497b0 -> script_threads_run 011483d0
Typical flowunlock -> player reaches the start trigger -> script spawns people/cars and sets objectives -> mission_end_success / failure.1,900+ Lua commands
Ending a mission
WhoOnly the co-op host can end a mission.mission_end 00849760
FailureStores the failure text and the player's state for the retry.
Success / cancelCan warp the player between two navpoints to a safe place.
Activities and diversions
Activitiesactivity_types.xtbl: each activity and what it turns off while running (roadblocks, helicopters, HUD...). _activity_goals.xtbl: score goals and bonus tiers.xtbl_load_activity_types 0077ba40
Co-opEvery activity is a host + participant class pair so both players share it.
Diversions29 always-on side systems (mugging, stunts, hitman, streaking, collectibles...).

Built from SR4_Game_Explained.xlsx (650 KB), if you'd rather filter it in Excel. SaintsRowIV.exe v1.0.6.1 (Steam). Names are ours unless they're Volition's own Lua or C++ class names.