commit_level_instance
Commit or discard in-place edits to a Level Instance, save the sub-level .umap, and close edit mode. Safe to call even if no edit is open.
Instructions
Closes the in-place edit opened by edit_level_instance: the engine commits (or discards) the edits, saves the sub-level .umap back to disk, and re-collapses the streaming level into the instanced ALevelInstance. Canonical headless path: resolve the ALevelInstance by label/name, then ULevelInstanceSubsystem::CanCommitLevelInstance (gate) -> CommitLevelInstance. When the instance is NOT being edited, CanCommitLevelInstance returns false with reason "not currently being edited" — that is reported honestly as { committed:false, was_editing:false } and is a SUCCESS (a no-op close), NOT an error, so this is safe to call unconditionally to guarantee no dangling edit-mode. CommitLevelInstance returns whether the sub-level package save succeeded (committed:false on an honest save failure). Optional discard (default false) throws the edits away instead of saving. Requires the editor (GEditor); CommitLevelInstance touches GEditor->Trans / selection unguarded. Under -unattended the commit's save dialogs do not block.
Returns: { actor_name: string, committed: bool, was_editing: bool, discarded: bool, note: string }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| discard | No | Optional, default false. When true, discard the in-place edits instead of saving them back to the sub-level .umap. | |
| actor_name | Yes | Required. Label or name of the ALevelInstance actor whose edit to commit (matched via GetActorNameOrLabel). |