Spawning a visible, skinnable dead-animal carcass: use jo.entity.create (networked) + APPLY_DAMAGE_TO_PED — raw CreatePed renders invisible and SetEntityHealth(0) doesn't kill
Context
Script-spawning a dead animal (e.g. a_c_deer_01) for a player to skin (onboarding/tutorial "here's a carcass"). Three independent traps, all verified live on build 1491 via ch-debug introspection (visible/dead/health/net flags).
Trap 1 — raw CreatePed spawns the animal INVISIBLE / not networked
CreatePed(model, x,y,z, h, isNetwork=true, scriptHostPed, ...) returned an entity that exists + has collision but NETWORK_GET_ENTITY_IS_NETWORKED = false and the mesh never renders (no amount of SET_RANDOM_OUTFIT_VARIATION / _UPDATE_PED_VARIATION / SET_ENTITY_ALPHA fixed it). The render path that WORKS is the jo_libs helper jo.entity.create(model, vector3(x,y,z), heading, networked) with networked=true (4th arg). It handles model load + render + net registration the way other working resources do. After it, NETWORK_GET_ENTITY_IS_NETWORKED = 1 and the animal is visibly there. (Same lesson as the s_m_m_* shopkeeper invisibility, but bScriptHostPed=true alone was NOT enough for an animal — go through jo.entity.create / the framework ped helper.)
Trap 2 — SetEntityHealth(ped, 0) does NOT kill a freshly spawned animal
Right after spawn the deer read IsEntityDead=false, health=150 even after SetEntityHealth(ped,0). Fresh RDR3 ped full health is 600 (not 100/200). To actually drop it into a skinnable carcass, make it damageable then deal lethal damage:
SetEntityCanBeDamaged(ped, true)
SetEntityHealth(ped, 0)
Citizen.InvokeNative(0x697157CED63F18D4, ped, 1000, false, 0, ped) -- APPLY_DAMAGE_TO_PED(ped, amount, armour, boneId, killer)
SetEntityCanBeDamaged(ped, false)
After this: IsEntityDead=1, health=0, and the carcass stays VISIBLE (killing it does not un-render it) and shows the vanilla skin prompt.
Trap 3 — GET_ENTITY_ALPHA (0x5A47B3B5E63E94C6) returns a BOOLEAN in the Lua runtime
While debugging "is it invisible", GET_ENTITY_ALPHA kept returning false, which looks like "alpha 0 = invisible" but is actually just the native returning a bool instead of the 0-255 int. Do NOT use it as an invisibility signal — trust IsEntityVisible + your own eyes / GET_ENTITY_ALPHA is unreliable here.
Set the skin quality BEFORE killing
_SET_PED_QUALITY(ped, quality) (0xCE6B874286D640BB; PQ_LOW=0/MEDIUM=1/HIGH=2) set before the kill makes _GET_PED_QUALITY read that grade when the player skins it (drives RDR2-style pelt grade).
Debugging method that cracked it
Leaked local test peds (failed earlier spawns that weren't deleted) kept polluting a "nearest ped" probe and made fixes look like no-ops. Add a delete every non-player ped in radius dev command and clear the field between each spawn attempt, or you'll chase ghosts.
Linked natives
APPLY_DAMAGE_TO_PED(0x697157CED63F18D4)_SET_PED_QUALITY(0xCE6B874286D640BB)
Tags: ped, carcass, hunting, invisible, createped, skinning, jo_libs, rdr3
Category: natives
Source: scandi_onboarding hunt step
Created: 2026-06-04T16:01:50.586Z