MapEditor.CreateInteractiveObject

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 20:10, 18 October 2026 by QCherry (talk | contribs) (Document planned 0.1.9 item stats, armor, runes and experimental map-editor seats/lights; not a release)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

MapEditor.CreateInteractiveObject

AVAILABLE FROM UPDATE 0.1.9
Planned for 0.1.9; not yet publicly released. Not included in public 0.1.8. See the scope and validation notes below.

Creates an interactive-prefab entry and static editing preview inside the initialized map_editor client resource. This is an experimental editor helper, NOT a server multiplayer spawn API.

Syntax

id = MapEditor.CreateInteractiveObject(prefab, transform)

Parameters

Name Type Required Description
prefab string yes Exact ID from the Interactive prefab catalog, for example chair_01.
transform table no Optional x/y/z (metres), yaw/pitch/roll (degrees), sx/sy/sz. Defaults: position/rotation 0, scale 1. Only yaw rotation, unit scale and original collision are supported.

Returns

An editor ID string when the operation is queued, or false if rejected/busy. Native completion is asynchronous; a returned ID is not proof of a created native actor. Only successful completion updates the editor scene.

Examples

-- Inside the map_editor client resource, after session initialization:
local id = MapEditor.CreateInteractiveObject("chair_01", {
    x=12.0, y=24.0, z=2.0, yaw=90.0
})
if not id then
    outputDebugString("Placement not queued")
end

Notes

  • Planned for 0.1.9, not included in public 0.1.8. See Interactive map objects and Interactive prefab catalog.
  • Available only in the map_editor client Lua environment; not an engine-global function or an automatic cross-resource export.
  • pitch/roll must be 0 and sx/sy/sz must be 1. Prefab scale/collision restrictions preserve native interaction alignment.
  • Finish pending edits and any active local native test before changing the scene. Use Test native for local sit/stand or flame checks.
  • The optional table copies transform fields only, not arbitrary properties or game class paths. Set initial light state through the editor inspector.
  • Shared interaction authority and version-2 multiplayer deployment are not complete.