Skip to content

sc_entities_v1.keep

1.1. Releases your ownership of an entity you spawned here (see Keeping above): the host no longer despawns it when your plugin unloads or crashes, and set_transform and despawn by you are refused from now on, as for any entity you don’t own. The entity itself is untouched. SCO_OK, once. SCO_BAD_ARG: a null or released self, id 0. SCO_NOT_FOUND: not an entity you spawned here and still own (kept or despawned already, or spawned another way), with a reason for last_error. SCO_UNAVAILABLE: no “game.entities.spawn”. Call it right after spawn succeeds: the id is final at once, the entity needn’t have streamed in. SCO_FAILED: a game.owned retained build cannot relinquish ownership; use remove_build for undo/clear and ordinary unload cleanup.

sco_result (*)(sco_plugin *, uint64_t)

Service index

Property Value
Symbol sc_entities_v1.keep
Record ID sc-entities-v1-keep
Service game.entities
Table sc_entities_v1
Version macro SC_ENTITIES_VERSION_1_1
Packed table version 65537
Since / availability size >= 96; 1.1
Complete member extent (x64 bytes) 96
Table size (x64 bytes) 96

Header source

sco_result (*keep)(sco_plugin* self, uint64_t entity_id);
1.1. Releases your ownership of an entity you spawned here (see Keeping above): the host no longer despawns it when your plugin unloads or crashes, and set_transform and despawn by you are refused from now on, as for any entity you don’t own. The entity itself is untouched. SCO_OK, once. SCO_BAD_ARG: a null or released self, id 0. SCO_NOT_FOUND: not an entity you spawned here and still own (kept or despawned already, or spawned another way), with a reason for last_error. SCO_UNAVAILABLE: no “game.entities.spawn”. Call it right after spawn succeeds: the id is final at once, the entity needn’t have streamed in. SCO_FAILED: a game.owned retained build cannot relinquish ownership; use remove_build for undo/clear and ordinary unload cleanup.

Absent table: query_service NOT_FOUND; missing operation capability: UNAVAILABLE (alive: 0); invalid/released self: BAD_ARG. Additional failures/output state unspecified unless described in the buffer contract.

Absent table: query_service NOT_FOUND

Relinquishes own game.entities spawn; no allocation transfer. Entity survives unload/crash, no longer counts against ownership quota; no longer movable/despawnable by this ownership.

Game thread only (WRONG_THREAD elsewhere, alive returns 0); last_error any thread. Recursive reentrancy unspecified except unwatch in callback.

unspecified

unspecified

For unretained legacy keep only: entity untouched and survives unload; no SDK undo/removal authority. Retained builds refuse keep and use game.owned removal/unload instead.

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_entities.h
(*keep)
cpp typed-wrapper include/scosdk/game/entities.hpp
return t_->keep(self_, id);
csharp typed-wrapper sdk/csharp/Sco.Sdk/Game/Entities.cs
!Covers(88) || _t->keep == null ? ScoResult.Unavailable : _t->keep(Self, id);
lua unsupported sdk/docs/lua.md
Read-only: a Lua plugin owns no entities, so there is no spawn, despawn, move or watch.
plugins/lua/sco_lua_game.c
{ “alive”, L_ent_alive }, { “class_of”, L_ent_class_of }, { “get_transform”, L_ent_get_transform },

None identified in the catalogue; this is not proof none can exist.

ABI pins prove layout, not semantic behavior or a live game session.