serialize_actor_state
Save an actor's transform and explicitly named properties to a SaveGame slot keyed by your stable key, then restore them with that same key.
Instructions
Save an actor's transform plus an EXPLICIT set of properties into a SaveGame slot, keyed by an identity YOU choose (stable_key, defaulting to actor_name). Nothing is captured implicitly: name the properties you want in property_names or you get the transform and only the transform. Idempotent -- re-serializing the same key overwrites that slot, it never duplicates. Pair with restore_actor_state, which takes the same key.
Returns: { slot_id: string, saved: bool, property_count: int }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| actor_name | Yes | Required. Object name or editor label of the actor to serialize (resolved via mcp_common::FindActorByName). | |
| stable_key | No | Optional. Identity used as the persistence key; defaults to actor_name. The caller owns this key on purpose: AActor::GetActorGuid() is editor-only and not documented as stable across level reloads, so no GUID key is auto-generated for you. | |
| property_names | No | Optional array of UPROPERTY names to capture in addition to the transform. If omitted, ONLY the transform is saved -- it never silently saves "everything" via CPF_SaveGame, which no native property here sets and which, on a Blueprint variable, depends on whether that Blueprint ticked the SaveGame checkbox (get_blueprint_variable_detailed_info reports it): a filter this command cannot assume for you. |