Blitz3D+ Command Reference

SaveWorldDocumentSet(document,resources,revision,project_directory$,world_file$="",expected_destination_revision$="")

Requires Extended mode.

Saves a world and up to 255 resource drafts as one validated, journalled set. resources is a JSON array of objects with document (ResourceDocument handle) and revision (ResourceDocumentRevision). revision is the expected WorldDocumentRevision. Every destination must be below project_directory. Optional world_file selects the first world destination or saves the workspace to a different world file; that operation rebases references and starts a new history. Replacing a different existing world file requires its observed SHA-256 in expected_destination_revision. The original world is retained. Returns true on success; inspect WorldDocumentError and WorldDocumentDiagnostics on failure. New and embedded drafts can include their selected scope as worldEdit/publish entries and a prepared preview. Simple document/revision entries validate the source graph without runtime preparation. An open workspace contributes its staged dirty dependency closure, including new files created by extract or reference moves. Supplied external drafts are committed together in workspace history. Unchanged consumers are validated and guarded without being rewritten. A successful save clears world and published-file dirty flags and advances saved file revisions. Embedded/instance drafts keep their authoring handles; editor baselines are refreshed after success. If supplied drafts change workspace sources, WorldDocumentRevision also advances.

See Saving and exporting resource projects for the plan format, recovery commands, limits and the complete courtyard example.

Entries may also contain publish (default true), preview (ready resource preview world) and worldEdit (a complete world-document-edit transaction). publish=false saves only embedded definitions or instance bindings from worldEdit. Binding edits require preview. Transactions share the supplied world revision; independent changes merge by stable entity/component/slot IDs, while competing values fail before publication. Named entries publish their existing resource paths. Embedded document paths are not written. All proposed sources validate as one graph before the recovery journal is published.