Skip to content

Missions: the script runtime ​

How the original runs the command lines of a MISSION.INI section (loaded by Mission_Load, see game-core.md), and how the port mirrors it. Addresses are virtual addresses in gta.exe.

Files ​

FileWhat
src/game/mission_run.c/hMission_Update 0x446fe0, the interpreter Mission_StepProcess 0x4471a0 with the opcodes it handles inline, the process and script object helpers 0x43cca0-0x43d2b0 and 0x43e280-0x43e870, Mission_OnBriefDone 0x445580, Mission_GetResultText 0x445670, the counters the frontend's results read
src/game/mission_ops.c/hthe opcodes that have their own function: MissionOp_* 0x43e980-0x4453c0
src/game/trigger.c/hthe runtime objects 0x473b90-0x4756ff (triggers, doors, cranes, timed bombs, sound sources, ranking, car triggers) and 0x479020-0x47bb10 (kill scoring, respawn, Mission_InitCityTables, Mission_UpdateTriggers, Door_Update, Trigger_Update, the respray cost)
src/game/mission_obj.c/hthe helpers 0x475700-0x479020: mission cars, block clearing, the PED_ON presets and AI changes, briefs, alarm sound slots, the car list
src/game/dummy.c/hthe DUMMY cars 0x473440-0x473b8f (state only)

The process model ​

There are 32 processes (script threads). Per process (Mission, mission.h): active flag 0x6761c0, pc 0x676620 (a command index), wait counter 0x676280, step 0x6560b8 (1 on entry to a command; the waiting commands count their timers in it), linked trigger 0x6b3de8 (disarmed when the process stops), owner 0x676348, kind 0x676200 (0 normal, 1 KEEP_THIS_PROC, 2 KF_PROCESS: RESET spares those), the trigger that started it 0x6762c8 and the result it ended with 0x6b3b30.

  • Mission_Load starts one process per player at command 0 (owner -1); processes 0-3 belong to the players, the rest are free.
  • Triggers and KICKSTART / NEXT_KICK start new ones (Mission_StartProcess 0x43cca0: the first free from 4, step 1, the pc of a label, owned by a player). The owner chain is followed to its root to find the player a process works for (0x676608, "current player") and its ped (0x5f30e0).
  • Mission_Update (each game frame, from Game_Update): Mission_UpdateTriggers, then every active process gets one Mission_StepProcess in index order (0x6b3b70 is the running one), then per player: when the player is dead (and not in a wrecked car / the model car), a countdown 0x5fdffc runs: Player_Wasted (no life left: the player's process stops with result 3) and 0x57 frames later on foot (0x64 in a car) Player_Respawn. When none of the four players' processes is active any more the level end is scheduled once (0x6b3b7e): 1 frame with result 1 for a success of the local player, else 0x5a frames with its result.
  • Mission_StepProcess: loads the process's pc and wait counter, dispatches on the command's opcode (anything past 0x95 is fatal -0xb6); the handler leaves the next pc in 0x655e58. A reached TARGET_SCORE ends every process with result 8. The pc and wait counter are written back to the running process (0x6b3b70: END moves it up the owner chain, so its pc goes to the root's slot).

Branches and score ​

A command is {op, a, b, c, d, e}: a is usually an object line, b the success label, c the fail label, d a parameter, e a score. Branching (Mission_BranchSuccess 0x43e310 / Mission_BranchFail 0x43e3b0) through b or c: 0 is the next command, -1 kills the process (Mission_KillProcess: disarm its trigger, clear everything), any other value a label; a negative value also clears the active flag; the step goes back to 1. Most commands add e (if positive) to the owner player's score with Player_AddScore(n, e, 100, 100, 100, 0) before branching (Mission_AwardScore 0x43e450). A command that does neither stays: the process retries it next frame.

Script objects at run time ​

Commands address entities through the line's script object: the handle (a car, ped, object, trigger, door or crane id, or a counter's value), the parameter, the coordinates. Mission_GetObjectPos 0x43e680 gives pixel coordinates: cars, peds and objects where their sprite is, the block-placed kinds (triggers, doors, DUMMY, FUTURECAR, BLOCK_INFO...) their block's corner (block * 64), TARGET its coordinates and parameter, the rest the stored values. Mission_GetObjectHealth 0x43e870: 100 - damage of a car (0 for a free slot), a ped's health (0 if carried or in states 5, 0x17, 0x18), else 100. Type 100 marks a process list (KICKSTART), 0x65 a removed object.

RESET ​

RESET / RESET_WITH_BRIEFS stop every other process from 3 (but kinds 1 and 2 and processes waiting in an MPHONE), clean up the lists the loader built of non-persistent cars, peds and objects (off-screen cars and objects are deleted; peds nobody saw recently are removed, the others wander off), make every non-persistent trigger off (state 4) and close and lock the non-persistent doors, and switch the arrow and the sound sources off. The car and object list compaction keeps a quirk: an entry already in place moves past itself, so the lists drift up by one slot per RESET.

Opcodes ​

Inline in Mission_StepProcess unless an address is given. "award" = award score then branch b; "fail" = branch c.

#NameSemantics
0x04SURVIVEd frames (counted down in the command's own c field, a quirk), then award
0x05HUNTONthe car of line a hunts the car of line d (mode c), award
0x06HUNTOFFstops the hunt of line a, award
0x07DRIVEONno handler: the process stays on it
0x08DUMMYONthe car of line a becomes a traffic dummy with its driver sitting in it, award
0x0aENDthe process and every owner up the chain stop with result a
0x0cEXPLODEan explosion at the block of line a, direction d, scored to the player; award
0x0dOBTAINan object (type = line a's handle, angle d) carried by the player's ped (+0x18 = 4), award
0x0eTHROWthrows the object of line a at the car of line d, award
0x0fBRIEFsubtitle brief e for d frames (c >= 0: c into 0x693b20, else -c into 0x693b24), branch b
0x11DONOWTno handler: waits forever
0x12DISABLEthe trigger of line a off (state 4), unlinks this process's trigger, award
0x13ENABLEre-arms the object of line a (Mission_EnableObject 0x43e4f0) and, for non-doors, disarms its trigger (state 1), award
0x14DECCOUNTcounter of line a - 1: above 0 fail, else award
0x18SETBOMBcar of line a gets bomb kind d, award
0x19ESCORTthe car of line a follows the DUMMY of line d (its script line = a), award
0x1aARROWthe HUD arrow to line a (a block corner points at its centre); a = -1 switches it off; award
0x1b / 0x1cLOCK_DOOR / UNLOCK_DOORthe car of line a's doors held (+0x248), award
0x1dEXPL_LASTwrecks the car the player's ped is in or was last in (not on a train), award
0x1eDROP_ONobject (type = handle) at the block centre of line a, angle d, award
0x20KILL_DROPdeletes the object of line a (none: fail), award
0x22 / 0x23ARMEDMESS / DISARMMESSthe zone text bomb_on / bomb_off, award
0x24ARROW_OFFaward
0x25P_BRIEFpager brief (kind 0) like BRIEF, branch b
0x27WAIT_FOR_PEDuntil the ped of line d is on the block of line a, award
0x28PED_BACKthe ped of line d walks back to the car of line a (dead: fail), award
0x29SETUP_REPOline a's parameter = d, branch b
0x2bKILL_OBJremoves the object of line a, award
0x2cDO_GTAthe car list of line a: step 1 records this pc and arms the crane slot, step 2 waits until the list is complete, branch b
0x2dMISSION_ENDscore e, multiplier + 1, branch b
0x2eEXPLODE_CARwrecks the car of line a, award
0x32KILL_CARremoves the car of line a if nobody is in it (clears an ambulance request and the cleanup entry), award
0x33 / 0x34ARROWPED / ARROWCARthe arrow to an object / car, award
0x35 / 0x36REMAP_PED / REMAP_CARnew remap d (no entity: fail), award
0x37ARE_BOTH_ONSCREENboth cars of lines a and d on screen: award, else fail
0x38THROW_TO_POINTthe object of line a thrown at line d, award
0x3cSTARTUPonce per level: voice event 0x14 in 10 frames, the trigger of line a to state 3, branch b
0x3dCHECK_PEDBACKuntil the ped of line a is in state 6 (dead: fail), award
0x3eSTART_HIRED_ESCthe ped of line a hunts the block of line d (full: retry), award
0x3fDUMMY_OFFcar +0xc0 = 1 (no car: fail), award
0x40POWERUP_ONa power-up (type = handle, value = param) at line a, branch b
0x41PLAIN_EXPL_BUILDINGthe explosion with two fires, award
0x42CHANGE_BLOCKthe block of line a gets the BLOCK_INFO's packed info, award
0x43CHANGE_TYPEa block face (handle) gets tile (param), award
0x44P_BRIEF_TIMEDpager brief with countdown d frames, branch b
0x46 / 0x47DOOR_ON / DOOR_OFFuntil the door can be unlocked / locked, award
0x48WRECK_CURR_TRAINcrashes the train the player rides (none: fail), award
0x49 / 0x4aOPEN_DOOR / CLOSE_DOOR(no door: fail), award
0x4cBANK_ROBBERY+1000 wanted points, wanted level 4, a crime report (9) at line a, award
0x4dDELAY_CRIMEa timed bomb on the car / created ped of line a (who c, frames d), award
0x50 / 0x51BANK_ALARM_ON / OFFa positional alarm source at line d (slot in its param) / off, branch b / award
0x52GARAGE_SENDthe ped of line a hunts the block of line d (retry when full), award
0x54PLAYER_ARE_BOTH_ONSCREENthe player (car on screen or ped seen) and the car of line a: award, else fail
0x55CHECK_CARthe player drives the car of line a (and its remap is d, if d >= 0): award, else fail
0x56WAIT_FOR_PLAYERwaits while the player is near line a (d blocks); quirk: the test is x >= bx-r && (x <= bx+r || y >= by-r) && y <= by+r
0x57EXPL_PEDexplodes the ped of line a (in a car: wrecks it), award
0x58PARKED_ONcreates the car of line a (model = handle, heading = param, remap d) on its block, clears the block, award; no slot: fail
0x59KICKSTARTstarts a process at label a (0: next command, same kind); a process-list object (type 100, the last free record) holds it; the command's d / e get that object and this process; branch b
0x5aIS_PED_IN_CARthe ped of line a in a car (of model d if d >= 0): award, else fail
0x5bCANCEL_BRIEFINGthe alarm loop off and the pager countdown of the brief at label a removed, award
0x5c / 0x5d / 0x5eFREEZE_TIMED / FREEZE_ENTER / UNFREEZE_ENTERplayer +0x18c = a / +0x189 = 1 / 0, award
0x5fEXPL_NO_FIREthe explosion only, award
0x60KILL_PROCESSstops every process in the list of the KICKSTART at label a and clears its e, award
0x61NEXT_KICKstarts a process at label a into the list of the KICKSTART at label d, branch b
0x62KILL_SIDE_PROClike KILL_PROCESS, keeping e
0x63SET_KILLTRIGthe trigger of line a gets field e - 1 of the list of the KICKSTART at label d, branch b
0x64POWERUP_OFFaward
0x65KILL_SPEC_PROCstops list field d (1..4) of the KICKSTART at label a (else clears its e), award
0x66SCORE_CHECKscore >= a: flag +1 of the player, award; else fail
0x67 / 0x68FRENZY_SET / FRENZY_CHECKstores the score in the FRENZY_CHECK at label a / a points scored since: voice 4, award, else fail
0x69IS_GOAL_DEADline a dead (and, for d > 0 and a created ped, killed by the ped of line d): award, else fail
0x6aGENERAL_ONSCREENline a in the player's view rectangle: award, else fail
0x6bGET_CAR_INFOthe car the ped of line a is in becomes the CAR of line d (in a car: fail otherwise); quirk: it's added to the cleanup list only when the object is persistent
0x6cSTART_CHOPPERthe helicopter from line a to line d, branch b
0x6dLOCATEthe player on foot within e pixels of line a: branch b; with d > 0 the step counts d frames down to fail
0x6e / 0x6fSPEECH_BRIEF / MOBILE_BRIEFbriefs of kinds 4 / 3 with text e, branch b
0x70PIXEL_CAR_ONlike PARKED_ON at pixel coordinates, with its driver sitting in it (models 0x29 and 3 get a visible driver, 0x2f bomb kind 3)
0x71 / 0x83SET_NO_COLLIDE / SET_COLLIDEcar +0x128 = 99 / 1, award
0x72PED_WEAPONped weapon d, award
0x73FREEUP_CARthe car is no longer a script car (+0x134 = -1, +0x139 = 1), award
0x74MESSAGE_BRIEFthe big message with the FXT key "e" (the number as text), branch b
0x75PARKED_PIXELS_ONlike PIXEL_CAR_ON without the driver; no slot: retry
0x76PED_POLICEthe ped of line a becomes a cop, award
0x77DROP_WANTED_LEVELnot arrested and +0xfc = 0: wanted points and level cleared, award
0x78IS_PED_ARRESTEDped in state 9: award, else fail
0x79HELL_ONa gang car (model 3) with a driver (remap 0x21) at line a, award; no slot: fail
0x7a / 0x7bXXXXno handler
0x7cSET_PED_SPEEDped byte +8 = d, award
0x7dIS_PLAYER_ON_TRAINthe train into line a's handle (not on a train: fail), award
0x7eWRECK_A_TRAINcrashes the train of line a, award
0x7fINCCOUNTcounter of line a + 1: reaching d awards, else (or d < 0) fail
0x80COMPAREline a's handle == d: award, else fail
0x81RESETsee above, award
0x82KEEP_THIS_PROCkind 1, award
0x84DEAD_ARRESTEDthe ped of line a arrested or dead: award, else fail
0x86STOP_FRENZYthe frenzy weapon ends, award
0x8dKF_PROCESSthe kill frenzy cars with a script line are held, kind 2, award
0x91RESET_WITH_BRIEFSRESET, and the subtitle and pager cleared (the alarm slots stay), award

Opcodes with their own handler (mission_ops.c) ​

"Timed" waits: on entry the step becomes d + 5 (0 when d < 1: wait forever); each frame without success counts it down, and reaching 5 takes the fail branch.

#NameHandlerSemantics
0x00LOCATE_STOPPED0x43e980the player's ped within e pixels of line a, standing, not in a car: branch b; timed
0x01DESTROY0x43ed90line a's health 0: award; timed
0x02ANSWER0x43ef80phone a rings (state 2, alarm) for d frames, toggling every 50; walking up answers (b, or c when e = 0), ringing out fails. Quirk: e is only tested on the toggle frames
0x03STEAL0x43f360the player drives car a: voice 0x11, award; timed
0x09SENDTO0x43f760DUMMY car a drives to line d (its controller into a's param), when the shared path search is free
0x0bMAKEOBJ0x43f950creates object a (type = handle, angle d); type 0x58 gets +0x12 = 1
0x10MPHONE0x43fb20c phones on lines a.. ring within 15 blocks (0x7710f4 set); answering phone i kills the other processes, clears the mission and branches to b + i, sets the phone flag and schedules event 0 with player + 0x32 in 250 frames
0x15GOTO0x43eb50what the player controls is on line a's block: award; timed
0x16CRANE0x440040crane a takes the player's car at line d's block; refusals (police car, too long, bomb, no room...) show crane0..5 and fail; delivered: a car-list delivery, or value x (100 - damage) / 100 / (same models + 1), at least 1000, award
0x17PARK0x4407c0park into the garage door a from direction d: the car is taken over and driven in, the driver leaves at the exit point, the door closes, the car is deleted by event (car + 200, 10 frames)
0x1fPED_ON0x441600creates the FUTUREPED of line a with its sub-type preset (target = line e, remap d), branch b; nothing created: fail. Quirk: sub-types 0xd and 0x1b-0x28 create nothing
0x21CAR_ON0x441cd0creates the FUTURECAR of line a with its driver seated (models 0x29 / 3 a visible one, 0x2f bomb 3), clears the block; no slot: fail
0x26PED_SENDTO0x441fd0ped d walks to line a
0x2aDO_REPO0x4421a0waits for the player to drive car a; after d frames its owner comes back
0x2f / 0x30 / 0x31START_MODEL / DO_MODEL / RETURN_CONTROL0x4423f0 / 0x4427c0 / 0x442ca0the RC car: the player's car is swapped for model 0x2f (the real one kept in a type-100 object, e models); run until the player dies, the model is wrecked (next model or fail) or target d dies (award); the real car back
0x39GOTO_DROPOFF0x442fc0every 8th frame d counts down (0: fail); the ped near line a: award
0x3aMODEL_HUNT0x4431d0d parked cars on lines a.. hunt the player; the process stays pruning wrecked hunters, a new one continues
0x3bMODEL_FUTURE0x443440a parked model car at line a (quirk: pixel coordinates to a block spawner)
0x45CHANGE_PED_TYPE0x443690live ped a gets AI preset d (target line e), branch b
0x4bPED_OUT_OF_CAR0x443a90the driver of car a (or created ped a) leaves its car
0x4eGET_DRIVER_INFO0x443f20line d becomes car a's driver (a created PED, +0x8b = 1)
0x4fKILL_PED0x4445d0removes created ped a, cancels its ambulance, unlists it
0x53DUMMY_DRIVE_ON0x43f580once car a's driver sits in it, it drives off at speed 5
0x85IS_POWERUP_DONE0x4448a0the power-up at line a taken: award; still there: fail (now, or when timer d runs out)
0x87FRENZY_BRIEF0x444180brief kind 5 (e), branch b
0x88ADD_A_LIFE0x4442b0Player_AddLife
0x89 / 0x8aKF_BRIEF_TIMED / KF_CANCEL_BRIEFING0x4443d0 / 0x4444b0player timer +0x1ae = d x 25, voice 3 / off
0x8b / 0x8cKF_BRIEF_GENERAL / KF_CANCEL_GENERAL0x444b60 / 0x444c40timer +0x1b0 = d x 25 / off
0x8eRESET_KF0x444d60releases the kill frenzy cars, kills the other kind-2 processes
0x8fWAIT_FOR_PLAYERS0x444f30Mission_AllPlayersBelow(handle a): b, else c
0x90 / 0x92RED_ARROW / RED_ARROW_OFF0x441320 / 0x4414e0the local player's red arrow (quirk: a = -1 turns the normal arrow off)
0x93IS_A_TRAIN_WRECKED0x4450f0any train wrecked: b, else c
0x94INC_HEADS0x445290Player_SetStatByCity(player, a)
0x95IS_PED_STUNNED0x4453c0ped a in anim 0x2b: b, else c

Triggers (trigger.c) ​

A trigger (0x771628, 210 x 0x20): state +0 (0 fire, 1 armed, 2 delayed, 3 running, 4 off), kind +4, a +8 (a label, door, colour or car), d +0xc (the watched car / ped or a linked trigger), block x, y, z +0x10 (bytes), radius b +0x14 (blocks), c +0x18 (arming delay or a frame counter), the process to kill when it fires +0x1c, persistent +0x1d. Trigger_Create 0x4744a0 moves c into d for kinds 10, 0xb, 0xe, 0xf, 0x10, 0x13, 0x15, 0x18, 0x19, 0x1b-0x1e, 0x21.

Each frame (Trigger_Update 0x47a3a0, from Mission_UpdateTriggers 0x479e00) per player not on a train: the position of the player's car or ped (or the watched one) is "in" when within ±b blocks in x and y (z is never tested). Armed and in: fire, or delayed when c > 0 (event 4 resets it to fire after c frames). Firing runs the kind:

KindObject typeAction
0 / 1 / 2door triggersopen / close / toggle door a
3SPRAYrespray (in a car): emergency cars and the model car refused; a script car gets colour a, a wanted car is cleaned for Garage_ResprayCost, repaired, wanted level and points cleared
4TRIGGERstarts a process at label a
8BOMBSHOPfits a bomb (kind 1) for BOMBSHOP_COST; model car, tank and emergency cars (but squad cars 4 / 0x20) refused
9CARTRIGGERa car with script line b anywhere: process, state 3
10ONETRIGGERtoggles door a when the player is in car d in the area
0xbMOVING_TRIGthe player within b of car a: car a hunts the player (mode d)
0xcMPHONESafter one arming update: a process when no phone rings (0x7710f4) and the player's phone flag is clear
0xdPHONE_TOGGleaving the ±3 square (within b) re-arms running trigger a
0xeDUM_MISSION_TRIGcar d (not a player's) in the area, control != 1: process
0xf / 0x10CORRECT_MOD_TRIG / CORRECT_CAR_TRIGthe player's car model / id is d: process, state 3
0x11 / 0x12CLOCK_START / CLOCK_STOParms its CLOCK_STOP / kills trigger a and itself
0x13 / 0x14MIDPOINT_MULTI / FINAL_MULTIrace checkpoints (the next one armed, texts 1st_over_checkpoint, second_checkpoint) / the finish (win_race, lost_race)
0x15DUM_PED_BLOCK_TRIGthe watched ped (not a player) in the area: process
0x16MOVING_TRIG_HIREDcar a drives to the trigger's block
0x17takes a fitted bomb off (bomb_off), off
0x18CARBOMB_TRIGcar d has a bomb: process, off
0x19 / 0x21DAMAGE_TRIG / ALT_DAMAGE_TRIGremembers the first car in the area; when it's wrecked: process, off (0x21 keeps the +0x1c process)
0x1a / 0x1bGUN_TRIG / GUN_SCREEN_TRIGon foot, armed, firing in the area / with ped d on screen: process
0x1cCARDESTROY_TRIGcar d wrecked in the area: process
0x1dCARWAIT_TRIGcar d stopped on screen 65 frames (400 in some cases): process
0x1ePEDCAR_TRIGped d in car a: process at label b, off
0x1fCANNON_STARTvoice 0xe, off
0x20CARSTUCK_TRIGcar d stopped on an air block and on screen > 64 frames: process
5, 6, 7nothing

Respray cost (Garage_ResprayCost 0x47ba30): ((W + value x 1000 x damage / 100) x (100 + multiplier)) / 100 with W = 0 unwanted, else 1000 x 2^(level - 1), value = car info +0x6e; 500 when both are 0.

Doors (0x773220, 64 x 0x28): animation slot +0, state +4 (0 open, 1 closed, 2 opening, 3 closing), locked +8, range +0xc, orientation +0x10, block +0x14, tile +0x18, frames +0x1c, condition +0x20 (0 any car, 1 emergency car / 0x2c / tank, 2 a car id and remap, 3 the viewed car's model, 5 a bomb car), car / model / line +0x22, remap +0x24, face slot +0x26, persistent +0x27. Door_Update 0x479f00 opens a door when a player is within range in front of it and the condition holds. Cranes (0x773130, 4 x 0x3c): state +0, object +4, position +8, direction +0x14, the car moved +0x18, stacked count +0x1c, stack[6] +0x20, car-list slot +0x38. Timed bombs (0x7715d8, 4 x 0x10): id, kind (0 car, 1 ped), who, state, frames.

Quirks kept: Door_OnClosed / Door_OnOpened are swapped by name; Door_SetOpenAny marks a door locked but counts it unlocked; Crane_CheckSpace reads crane 0's stack; the race ranking's distance uses the trigger x in the y term; Player_ChooseRespawnPoint's second sort writes the wrong array.

Helpers (mission_obj.c) and DUMMY cars (dummy.c) ​

PED_ON presets (Mission_PedCreate_* 0x4773f0-0x477b50; Ped_Create at z - 2 pixels, graphic 0, +0x8b = 1; "armed" = weapon 1): 0 state 3 action 8; 1 armed, state 3, objective 0x18, target; 4 state 3, speed 1; 5 state 4 action 2 target; 6 state 2 objective 0x24 action 5; 7 state 1 action 5 target; 8 armed state 4 objective 0x1c target; 9 state 3 objective 0x22; 10 state 2 objective 0x23 speed 3; 0xb armed state 4 objective 0x31; 0xc armed state 3 objective 0x30; 0xd state 4 objective 0x39 action 2; the typed codes 0x15-0x1a / 0x29-0x2e armed with objectives 0x18, 0x1a, 0x1b, 0x1c-0x1e, 0x29, 0x2c, 0x2e, 0x2b, 0x2d, 0x2f; the guard state 3 objective 0x38. The AI changes (Mission_PedSetObj_*) refuse dead peds and states 0xc, 0x15, 0x17, 0x18; a driving ped leaves its car first.

The car list (GTA_DEMAND, 0x771110: 10 x 16 bytes {line p1, model (-1 any), remap (-1 any), target, ..., delivered +0xa, the DO_GTA pc +0xc}), the four alarm sound slots 0x773c24, and the DUMMY convoys (0x771080: 8 groups of a count and four AI controllers). A DUMMY car gets an AI controller of kind 9 (state byte +0x1b): 0xfa start a path search to the destination, 2 wait for it (failed: 0x27), 5 search again from the nearest road, 1 arrived (the group is released), 100-103 every car of the group hunts player n. Sentinel_DriveCar drives them along the route (Police, path finding: Traffic).

Mission_OnBriefDone 0x445580 (delayed event type 0) ​

Clears 0x6765e8, then by code: <= 0 a car (-code) whose bomb kind is 3 explodes (if not already wrecked); 1 ends the game (result 1); 9 and 10 set 0x6765e8; 0x14 voice 0; 0x32-0x35 clear the phone flag of player code - 0x32; 200-600 delete car code - 200 if it's in use.

Results ​

g_game.result (0x513230) is set from the local player's process result when the end event fires: 1 success, 2 failed, 3 dead, 4 arrested, 5 time out, 6 time over (multiplayer), 8 target score, 10 cannon, 11 demo. Mission_GetResultText appends the FXT text (m22success, m22failed, m22dead, m22arrest, m22timeout, m22timeover with the best two players, m22score, m22cannon, m22demo, otherwise m22incomplete) and returns the local player's score. The counters: Mission_GetMissionTotal 0x43d1d0 (MISSION_TOTAL or 0), Mission_GetSecretTotal 0x43d1e0, Mission_GetCounterRemaining 0x43d1f0 / Mission_GetSecretRemaining 0x43d220 (the counter object's parameter minus its handle), Mission_GetTargetScore 0x43d1c0.

Port deviations ​

  • Handles of -1 and undefined lines read a record of -1s where the original reads before its tables; a process whose pc leaves the command table is fatal.
  • Mission_StartProcess / KICKSTART copy the owner's ped into 0x656180[process] for every process; past the four players that's unused bss in the original; the port derives the ped from the owner.
  • With no free process, KICKSTART / NEXT_KICK write the slot before each table in the original; the port skips those writes.

OpenGTA is released under the GPL-3.0. Grand Theft Auto is © 1997 DMA Design / Rockstar Games. OpenGTA contains no original code or assets and is not affiliated with them: it runs the game from your own copy. It runs on gasm.