sc_spawn_service_v1.spawn_near_player
Spawns an entity class (a ship, a vehicle, an item) at offset metres from you, in your current zone’s frame. NULL on success with *out_id = the new entity id; else the reason. The id is final at once, but the entity streams in later: a few seconds, up to a minute for a big ship. entity_alive(id) answers 1 once it has. An entity spawned here belongs to no plugin: set_entity_transform refuses it. Use spawn_as for an entity you will move. Implementation initializes out_id to 0 before failure checks.
Signature
Section titled “Signature”const char *(*)(const char *, const double *, uint64_t *)Service and availability
Section titled “Service and availability”| Property | Value |
|---|---|
| Symbol | sc_spawn_service_v1.spawn_near_player |
| Record ID | sc-spawn-service-v1-spawn-near-player |
| Service | spawn.entities |
| Table | sc_spawn_service_v1 |
| Version macro | SC_SPAWN_SERVICE_VERSION |
| Packed table version | 65538 |
| Since / availability | size >= 16; 1.0 |
| Complete member extent (x64 bytes) | 16 |
| Table size (x64 bytes) | 64 |
Parameters and buffers
Section titled “Parameters and buffers”const char* (*spawn_near_player)(const char* entity_class, const double offset[3], uint64_t* out_id);
Spawns an entity class (a ship, a vehicle, an item) at offset metres from you, in your current zone’s frame. NULL on success with *out_id = the new entity id; else the reason. The id is final at once, but the entity streams in later: a few seconds, up to a minute for a big ship. entity_alive(id) answers 1 once it has. An entity spawned here belongs to no plugin: set_entity_transform refuses it. Use spawn_as for an entity you will move. Implementation initializes out_id to 0 before failure checks.
Results and failures
Section titled “Results and failures”Absent table: query_service NOT_FOUND; requires spawner rows (product gate spawn.ship). Wrong thread or missing readiness: 0 or borrowed reason string. Additional failures/output state unspecified unless described in the buffer contract.
Absent capability
Section titled “Absent capability”Absent table: query_service NOT_FOUND Wrong thread or missing readiness: 0 or borrowed reason string.
Ownership
Section titled “Ownership”Spawned entity belongs to no plugin; out ID caller-owned. Failure reason is borrowed; returned string lifetime unspecified; never free.
Thread affinity
Section titled “Thread affinity”Game thread only; recursive reentrancy unspecified.
Callback context
Section titled “Callback context”unspecified
Reentrancy
Section titled “Reentrancy”unspecified
Cleanup and cancellation
Section titled “Cleanup and cancellation”No cancellation entrypoint; asynchronous streaming is not cancelled by this table.
Language mappings
Section titled “Language mappings”Status labels are copied verbatim from the catalogue: direct is native access; typed-wrapper is wrapper-backed; restricted is a subset/adaptation; unsupported means no supported route is established. No status implies universal safety.
| Language | Catalogue status | Source evidence / wrapper tokens |
|---|---|---|
| c | direct | include/sc_spawn.h(*spawn_near_player) |
| cpp | direct | include/sc_spawn.h(*spawn_near_player) |
| csharp | unsupported | docs/sdk-csharp.mdThe host-owned services each have a class.docs/sdk-csharp.md | Class | Service | Does | |
| lua | unsupported | sdk/docs/lua.mdThe script sees only:sdk/docs/lua.md There is no plugins/lua/sco_lua_game.c if (!(actors || vehicles || world || entities || creative)) return; |
Examples
Section titled “Examples”None identified in the catalogue; this is not proof none can exist.
ABI pins prove layout, not semantic behavior or a live game session.