Skip to content

sco_datacore_v1.add_instance

A new instance of struct type, copied from clone_record’s clone_field (NULL or “”: the record’s root) or zero-filled (clone_record NULL). out_instance: its id, usable in this patch’s SCO_DC_INSTANCE values and set_pointer. Implementation initializes out_instance to 0 on failure.

sco_result (*)(uint64_t, const char *, const char *, const char *, uint64_t *)

Service index

Property Value
Symbol sco_datacore_v1.add_instance
Record ID sco-datacore-v1-add-instance
Service sco.datacore
Table sco_datacore_v1
Version macro SCO_DATACORE_VERSION_1_1
Packed table version 65537
Since / availability size >= 40; 1.0
Complete member extent (x64 bytes) 40
Table size (x64 bytes) 88

Header source

sco_result (*add_instance)(uint64_t patch, const char* type, const char* clone_record, const char* clone_field, uint64_t* out_instance);
A new instance of struct type, copied from clone_record’s clone_field (NULL or “”: the record’s root) or zero-filled (clone_record NULL). out_instance: its id, usable in this patch’s SCO_DC_INSTANCE values and set_pointer. Implementation initializes out_instance to 0 on failure.

Absent table: query_service NOT_FOUND; stopped operations: UNAVAILABLE. Unknown/released patch: NOT_FOUND; closed patch: BAD_ARG; operation cap: TOO_MANY. Additional failures/output state unspecified unless described in the buffer contract.

Absent table: query_service NOT_FOUND

Strings/values copied; host owns patches and instances; IDs, not allocations, cross the ABI. Internal allocation/failure guarantee unspecified.

Any thread; short locks, no wait for game load. Recursive/concurrent same-patch reentrancy unspecified.

unspecified

unspecified

No in-flight cancellation; discard drops open/queued patch, not applied or saved effects. Unload forgets owned patches.

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/sco_datacore.h
(*add_instance)
cpp typed-wrapper include/scosdk/datacore.hpp
const sco_result r = t_->add_instance(id_, ty.c_str(), cr.empty() ? nullptr : cr.c_str(), cf.empty() ? nullptr : cf.c_str(), &id);
csharp typed-wrapper sdk/csharp/Sco.Sdk/DataCore.cs
r = t->add_instance(Id, ty, cr, cf, &id);
lua typed-wrapper plugins/lua/sco_lua_game.c
const sco_result r = dc->add_instance(p->id, type, cloneRecord, cloneField, &id);

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

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