The RedM developer’s field guide

Know the native.
Build the world.

Engine functions, framework docs, and game assets.
One reference. From the first lookup to the last line.

Explore / RedM

Documentation

02 / REFERENCE
CURRENT VIEWlearnings

learnings

PAGE 1 · 40 ENTRIES

Fully clean a ped (dirt + blood + wound decals + facial blood) without doing a character reload

learning:1
1 section

WEAPON_MOONSHINEJUG_MP auto-removes from the ped when emptied — `ammo == 0` check alone is racy, watch weapon-presence too

learning:10
1 section

Walkstyles split into two systems: Blackboard (MP_Style_*, network-syncs) vs Locomotion archetypes (war_veteran@normal, local-only). Wrong native = silent no-op

learning:11
1 section

GTA-V-ported RedM script: fake Citizen.returnResultAnyway + wrong BLIP_ADD_FOR_COORDS hash + nonexistent SetBlipAsShortRange/BeginTextCommandSetBlipName crash thread before spawn code runs

learning:115
1 section

OPEN_SEQUENCE_TASK / TASK_PERFORM_SEQUENCE: pass `0` as ped inside the sequence, capture the return as the sequence ID, then OPEN→CLOSE→PERFORM→CLEAR

learning:12
1 section

Static NPCs: never spawn networked peds from far away — OneSync streams the first copy then the client creates a second

learning:120
1 section

BLIP_ADD_FOR_COORDS style hash: don't assume an unrecognized decimal is garbage — it may be a real name you just haven't tried, or a sprite hash misapplied to the style slot

learning:121
1 section

CEF (RedM's CEF): mask-composite: intersect + autoprefixer silently kills the whole CSS mask, not just the fade zone

learning:122
1 section

RedM native data comes from rdr3natives.com (VORPCORE/RDR3natives); client pool-size limits are in guides/pool_size_limits.md

learning:123
1 section

JS/TS: Citizen.resultAsVector() returns an ARRAY [x,y,z], not {x,y,z} — reading .x gives NaN coords and crashes the game

learning:124
1 section

_GET_TASK_FISHING (0xF3735ACD11ACD500) crashes the client even on read-only DataView access — avoid it

learning:125
1 section

_SET_FISHING_BAIT spawns the hook/bobber as real entities — you do NOT need _SET_TASK_FISHING for bobber and line

learning:126
1 section

Refreshing a ped after component changes is a 3-native combo, not just _UPDATE_PED_VARIATION — outfits silently fail to apply if you only call one

learning:13
1 section

mech_loco_m@* and other LOCO clipsets cannot be played with TASK_PLAY_ANIM — they are clipsets, not regular anim dicts

learning:14
1 section

Anim dict suffix is NOT the anim name — `mech_pickup@loot@cash_register@open_grab` contains `enter_picklockoxxo_*`, not `open_grab`

learning:15
1 section

`p_safebla01x` is a bank-vault DOOR, not a freestanding safe — for shop safes use `s_safe01x` (mission safe with open anim)

learning:16
1 section

`Citizen.InvokeNative` for Vector3-returning natives drops y/z — returns just x as a number. Use the global Lua wrapper or `Citizen.ResultAsVector()`

learning:17
1 section

`PLACE_OBJECT_ON_GROUND_PROPERLY` removes Z-tuning hell — set heading first, then place, then freeze

learning:18
1 section

Citizen.InvokeNative drops Y/Z for Vector3-returning natives — must use the Lua wrapper

learning:19
1 section

turbineboat cabin door bones do not respond like standard vehicle doors

learning:2
1 section

jo.entity.getEntityInCrosshair default flag 16 = vegetation only — pass -1 to hit peds

learning:20
1 section

Swap player weapon to explosive ammo: _SET_AMMO_TYPE_FOR_PED_WEAPON + SET_PED_AMMO_BY_TYPE

learning:21
1 section

Player-ped velocity overrides need PRF_ForcePedToStrafe (reset flag 10) — DISABLE_CONTROL_ACTION on movement isn't enough

learning:23
1 section

Citizen.InvokeNative returns BOOLEAN for control/velocity natives in RedM Lua — use Lua wrappers

learning:24
1 section

GetEntityVelocity on player ped reads ~0 mid-flight — track velocity in Lua state for momentum-based flight

learning:25
1 section

_ENABLE_ATTRIBUTE_CORE_OVERPOWER value arg is not seconds/ms/0-1 — only 5000.0 (on) and 0.0 (off) work; needs core at 100 + paired non-core native

learning:26
1 section

Two _OVERPOWER_SECONDS_LEFT natives — core vs attribute — easy to mismatch with the setter; pair them by coreIndex variant

learning:27
1 section

_GET_ENTITIES_NEAR_POINT (0x59B57C4B06531E1E) p5 is entityType (1=ped, 2=vehicle, 3=object), not a bitmask

learning:28
1 section

IsPedCarryingSomething works for human/carcass carry, but sprint is impossible while carrying

learning:29
1 section

Citizen.InvokeNative vector returns may need coercion in RedM Lua

learning:3
1 section

Use _DISABLE_COMBAT_ACTION_AGAINST_OTHERS (ADF_TACKLE flag 33) to block player tackling — DisableControlAction does NOT work

learning:30
1 section

INPUT_MELEE_GRAPPLE_ATTACK (0xADEAF48C) fires on every regular F press, not just during a grapple

learning:31
1 section

Don't pass lua table keys or `lines N-M` as `heading` to `get_document` on big discoveries .lua files — they are preview-only

learning:32
1 section

Street musicians (trumpet/banjo/fiddle) are ambient townfolk using scenarios, not dedicated musician ped models

learning:33
1 section

jo.menu live preview on scroll needs GLOBAL jo.menu.onChange, not item-level onChange

learning:34
1 section

Diverting a player-driven train at switches: CFX junction API fails on replace_traintrack_file maps; brute-force SetTrainTrackJunctionSwitch over ALL indices is what works

learning:35
1 section

_CREATE_MISSION_TRAIN with conductor=true spawns an NPC in the driver seat — delete it before TaskWarpPedIntoVehicle or the player can't drive

learning:36
1 section

_SET_TRAIN_MAX_SPEED at exactly 30.0 breaks the train — cap at 29.9 (the documented "max 30.0" is exclusive in practice)

learning:37
1 section

Some RDR3 track junctions auto-switch and pull trains onto a wrong parallel track (e.g. Thieves' Landing) — force them with SetTrainTrackJunctionSwitch continuously, no player toggle

learning:38
1 section

A mission train drives itself on cruise speed alone — no conductor ped needed; conductor=true is unreliable for AI. Spawn conductor=false + SetTrainCruiseSpeed + persist

learning:39
1 section

A living reference. Documentation coverage varies by native and source.