Skip to content

Entities

Every kind of thing The Warriors has at run time that a script can make, find or change: what the game calls it, how a script refers to it, how many there can be, when it comes and goes, and which reference lists and script bindings cover it. It is the map a script or mod author starts from, the part FiveM's entity, ped, object and vehicle pages play for GTA V. The evidence for each fact is on the research page it links; families of ids that have no list yet are under Still to list.

Kinds

Refer by is what a binding takes; limit is the most there can be at once. Image says how a list illustrates the kind: model render (Coney renders the model, as for characters), icon render (one 2D icon of at most 64 × 64 that Coney renders from the disc), swatch (a colour drawn by the docs) or none.

Kind What it is Made with Refer by Limit Lists Bindings Image
Human Every person, the player included (GTA's ped) HuCreate, a gang's spawner (GangAddSpawner, Spawner states) handle 60 Characters, Character models, Speed classes, Power classes, Warrior classes, Attack kinds and tables, Hat fittings, Anim ids, Speech Characters model render (done)
Brain A human's AI: goal stack, action queue, target with its human the human's handle 60 AI goal types AI none
Gang A group of humans with relations to other gangs GangCreate gang id, the slot 0-31 32 Gangs, Spawner states, Commands, Script events, Rumble roster Gangs none
World object Props, weapons, hats, pick-ups, doors, icons: one class, its kind a CfgObj type ObjSpawn, SpawnDoor; placed by the level handle; its type by name or ObjGetIndex 384 live Objects and weapons, Object groups, Doors, Object tints, Script enums World and objects model render (coming)
Car A parked car that can be damaged or wrecked CarSpawn handle 18 Cars World and objects model render: Coney must load the <type>_geo clump (chunk 0x47, no skin) and its dictionary through the Object List (Cars)
Glass pane A breakable window pane SpawnBreakableGlass handle 100 Glass types World and objects none
Particle system Fire, smoke, sparks, strobes SpawnParticle handle 1,400 Particle effects Effects and lighting icon render: cut the type's rectangle from its sheet record and fit it to 64 × 64 (sprite traced for 58 types; Particles)
Dynamic light A point, spot, directional or ambient light SetLight its own light handle not traced Lights Effects and lighting swatch (done)
Crime A reported offence the police answer: responders from a gang's dispatch spawner CrimeIsHappening, SpawnCustomCrime; the game itself crime type one crime scene Crime types Levels and game state, Configuration none
World flag A named point with a heading: spawn point, waypoint, objective AddFlag handle; FindFlag by name per level World flags World and objects none
Path A route of points AI humans follow AddPath a userdata 32 World and objects, AI none
Volume, turf and player boxes Trigger boxes; a gang's turf AddVolumeBox, GangAddTurfBox handle per level Volume boxes World and objects, Gangs none
Trigger sphere A radius around an object that reports entries TriggerSphereCfg its object's handle one per object World and objects none
Object zone A group of placed objects switched on and off together the level's placements zone number 255 Object zones World and objects, Script flow none
Camera Follow, locked, fixed, rail and scene cameras CameraCreateLocked, CameraCreateFixed, CameraCreateThird, ... handle one of each shared kind per player; fixed, locked, third-person and scene cameras not traced Camera types and switches Cameras none
Scene An in-engine cutscene or animation set ScenePreload scene id (index in the scene list scene_list.cnk) 12 loaded Scenes and movies Scenes and movies none
Movie A full-motion video PlayMovie name one at a time Scenes and movies Scenes and movies none
Sound and emitter A one-shot or looping sound; an ambient emitter SoundPlay, SoundPreLoad, AddAmbientSoundEmitter2 sound handle; emitter id not traced Sound and music, Speech Sound and music none
Radar blip A mark on the radar for a human, object or flag HUDAddRadarMissionObjective, HUDAddRadarHuman the marked thing's handle 128 per radar Radar icons and blips HUD and menus icon render: rectangle n of part_page0, fitted to 64 × 64 (GUI)
Spinning icon The marker over a target: a world object of class dyn_icon HuAttachSpinningIcon, GangAttachSpinningIcon through its human or gang one per human Objects (class dyn_icon) Characters, Gangs model render
Weather and screen effects Rain, fog, film grain, fades StartRain, StartFog, ScreenQueueEffect none (global) one manager per view Screen effects Effects and lighting none

Level scripts keep the handles they get in tables of their own, such as Objects.<name> and Lights.<name>; those are the scripts' names, not the game's.

Handles

A handle is a number: the low 16 bits a serial, the high 16 an index into one table of 2,816 entries that humans, cameras, flags, boxes, cars, glass, world objects and particle systems share (Tasks: handles). NilHandle is the global for no handle. When a thing is removed and its entry reused, the old handle stops resolving: bindings then do nothing or return their "none" value, so test with HuIsAlive or ObjIsAlive before using a handle kept across frames. How bindings read a handle from Lua is in the bindings' conventions.

Not handles: gang ids, scene ids, zone numbers, light and sound handles, emitter ids and path userdata, each private to its own bindings (table above). A brain is reached through its human.

Classes

Everything the game schedules shares one head (position, rotation, velocities, flags, update interval; the task object) and has its own class:

task head (Task_Init 0x003a15c0)
├── human            vtable 0x0053f088   stepped by Humans_Update at 30 Hz
├── world object     vtable 0x005453a0   on the wheel
├── particle system  vtable 0x00545660   on the wheel
├── scene            vtable 0x005458c8   on the wheel
├── car              vtable 0x00544c08   on the wheel
├── glass pane       vtable 0x00544ed0
└── light task       vtable 0x00545138
not scheduled: world flag (0x00545e68), box (0x00545c48: volume, turf, player), camera (0x00535510)

The four "on the wheel" are the classes seen updating at run time; doors, weapons, hats and pick-ups are world objects whose behaviour comes from their CfgObj class and type, not from subclasses (Tasks: task classes and pools).

Pools and limits

Thing Limit Set by
humans (and brains, per-player records, physics bodies) 60 fixed (Characters)
world objects alive 384 fixed
placed objects (spawn records) the level's count + 500 CfgSetDatabaseSizes
world flags the level's count + 4 CfgSetDatabaseSizes (World flags)
volume, turf and player boxes the level's counts CfgSetDatabaseSizes
particle systems 1,400 in play, 100 in the pause menu fixed
cars / glass panes / scenes / light tasks 18 / 100 / 12 / 28 fixed
gangs / formations / paths 32 / 41 / 32 fixed (AI: gangs)
AI goals / actions, all brains together 170 / 100 fixed (AI)
spawned characters 3-70 in the scripts SetSpawnMax
handles 2,816 fixed

Lifetime

  • Humans. HuCreate takes a free slot of the 60; when none is free the game removes corpses (CullCorpses) and tries once more, else returns NilHandle (Characters: creation). HuDelete frees the slot at once; CullCorpses clears the dead.
  • Placed objects are spawn records. Each frame the object manager spawns the objects of enabled zones within 70 m of a player and removes others (Tasks: the play tick; the removal rule is not traced). ObjSpawn adds a record, ObjDestroy removes an object, ObjEnableZone switches a zone.
  • Level pools (flags, boxes, spawn records) are made by CfgSetDatabaseSizes, the first call of every level script, and freed when the level unloads; nothing frees a single flag.
  • Everything else lasts until its remove binding (CarDestroy, KillParticle, CamDelete, SceneUnload, GangDelete, ...) or the level's end.

FiveM to Warriors

FiveM The Warriors Lists Bindings
Entity any handle; the task object behind it (Classes) Utilities
Ped human Characters Characters
Ped model character type (CfgChar id) and its model Characters, Character models SetCharacterModel
Player a human with a pad (player 1 or 2) Controls, Commands Characters, Pad input
Ped task, scenario the brain's goals and actions; a gang's tactic; world flags the AI uses AI
Relationship group gang (GangMakeEnemies, GangMakeFriends, GangSetNeutral) Gangs Gangs
Object world object Objects and weapons World and objects
Vehicle car, parked; trains and moving vehicles are world objects (ObjStartTrain) Cars World and objects
Weapon a world object of a weapon class, held (HuPlaceItemInHand, HuGiveWeapon) Objects and weapons Characters
Pickup a world object of class pickup_item or powerup_item; inventory items Objects and weapons, Inventory items Levels and game state
Door a world object (SpawnDoor, DoorOpen) Doors, Objects and weapons World and objects
Blip radar blip Radar icons and blips HUD and menus
Marker spinning icon; the HUD's tutorial arrow (HUDEnableInstArrow) Objects and weapons Characters, HUD and menus
Checkpoint (race) none; a trigger sphere or volume box does the job. A Warriors checkpoint is a restart point (SetCheckPoint) Level starts Levels and game state
Ptfx particle system Particle effects Effects and lighting
Zone object zone, turf box Object zones, Volume boxes World and objects
Interior none: a level or one of its streamed sections Levels Levels and game state
Camera camera Cameras
Cutscene scene, movie Scenes and movies Scenes and movies
Sound sound and emitter Sound and music, Speech Sound and music
Weather weather and screen effects Effects and lighting
HUD colour the CL colours HUD colours HUD and menus
Ped combat attributes a character type's power class, Warrior class and attack, damage and range tables Power classes, Warrior classes, Attack kinds and tables Configuration (Cfg), AI
Stat the mission score's categories and events; the unlockable records progress sets Statistics, Unlockables Levels and game state
Text label a string table key Text labels HUD and menus
Animation dictionary, clip anim ids and clips Anim ids, Animation clips Characters
Wanted level, dispatch crime: police responders from dispatch spawners Crime types, Spawner states Levels and game state
Network, multiplayer none: two players share one screen

Open questions

  • What spawns the light tasks, and the camera pool's size.
  • The radius at which a placed object is removed again.
  • Which bindings hand out serial-0 (spawn record) handles.