MapEditor helpers: Difference between revisions
Complete upcoming 0.1.9 documentation: weather, crafting UI, world removal, doors and ladders; preserve release status |
Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits |
||
| Line 23: | Line 23: | ||
<!-- upcoming019:start --> | <!-- upcoming019:start --> | ||
== New interactive helper ( | == New interactive helper (from 0.1.9) == | ||
[[MapEditor.CreateInteractiveObject]] creates a prefab editor entry/preview inside the map_editor client environment. It is not a global server function. Use a [[Interactive prefab catalog|known prefab ID]] and a position/yaw transform; original scale/collision are required. Completion is asynchronous. See [[Interactive map objects]] for the local test and export boundaries | [[MapEditor.CreateInteractiveObject]] creates a prefab editor entry/preview inside the map_editor client environment. It is not a global server function. Use a [[Interactive prefab catalog|known prefab ID]] and a position/yaw transform; original scale/collision are required. Completion is asynchronous. See [[Interactive map objects]] for the local test and export boundaries. | ||
<!-- upcoming019:end --> | <!-- upcoming019:end --> | ||
<!-- editor019complete:start --> | <!-- editor019complete:start --> | ||
== Expanded 0.1.9 catalog and deployment == | == Expanded 0.1.9 catalog and deployment == | ||
'''Available from 0.1.9 | '''Available from 0.1.9. Use matching updated clients and server.''' | ||
[[Interactive prefab catalog]] now has 94 entries including seven doors and 21 ladder sizes. The helper only queues editor entries/previews. [[Interactive map objects]] explains local testing versus shared door deployment, and [[World model removal]] explains original-world inspection/removal. Do not confuse deleting an editor entry with hiding an original world placement. | [[Interactive prefab catalog]] now has 94 entries including seven doors and 21 ladder sizes. The helper only queues editor entries/previews. [[Interactive map objects]] explains local testing versus shared door deployment, and [[World model removal]] explains original-world inspection/removal. Do not confuse deleting an editor entry with hiding an original world placement. | ||
<!-- editor019complete:end --> | <!-- editor019complete:end --> | ||
Latest revision as of 13:28, 20 October 2026
MapEditor helpers
Since 0.1.4. Client Lua helpers inside the map_editor resource only, not engine globals available to every resource.
Defined in map_editor/client/scene.lua. Use while the editor is active and ready. Generic gamemode scripts should use WorldObjects.request instead. These helpers update the editor document/history only after native acknowledgement.
| Helper | Contract |
|---|---|
MapEditor.CreateObject(meshPath, transform) |
Returns a reserved string ID or false if rejected locally. The ID is not confirmation that native creation succeeded. Defaults: position/rotation zero, scale 1, visible, unlocked, collision enabled. Optional table overrides defined object fields; preserve generated IDs and valid schema. Mesh must be in the editor catalog. |
MapEditor.DeleteObject(id) |
Returns request acceptance as boolean. Unknown/locked instances, busy/loading or uncertain native state reject. No other resource or original world actor can be deleted. |
MapEditor.SetTransform(id, transform) |
Boolean request acceptance. Partial table of x/y/z, pitch/yaw/roll, sx/sy/sz; omitted fields retain the current document values. Unlike the native update command, this helper fills the complete state. Unknown or locked instances reject. |
MapEditor.GetObjects() |
Deep-copy table keyed by object ID of current editor document records. Not a live engine query. Changing the returned copy does not change the scene; failed-to-render records retained after load can also appear here. |
Positions use metres, rotations degrees, scale is a multiplier. Creation/deletion/transform functions are asynchronous; do not chain dependent operations on a newly reserved ID before native completion. Editor UI status and its serialized operation flow report results. The helpers have no independent exported callback parameter.
There are no separate engine MapEditor.SetPosition/SetRotation/SetScale/CloneObject functions. Use SetTransform within the editor, its Duplicate action for GUI duplication, or explicit WorldObjects commands with your own document state in another resource. See Map editor for controls, save/load and limitations.
New interactive helper (from 0.1.9)
MapEditor.CreateInteractiveObject creates a prefab editor entry/preview inside the map_editor client environment. It is not a global server function. Use a known prefab ID and a position/yaw transform; original scale/collision are required. Completion is asynchronous. See Interactive map objects for the local test and export boundaries.
Expanded 0.1.9 catalog and deployment
Available from 0.1.9. Use matching updated clients and server.
Interactive prefab catalog now has 94 entries including seven doors and 21 ladder sizes. The helper only queues editor entries/previews. Interactive map objects explains local testing versus shared door deployment, and World model removal explains original-world inspection/removal. Do not confuse deleting an editor entry with hiding an original world placement.