Interactive map objects: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document planned 0.1.9 item stats, armor, runes and experimental map-editor seats/lights; not a release
 
Document upcoming 0.1.9 custom native keys, shared doors, server Lua callbacks and persistence; not a release
Line 61: Line 61:
[[Category:Lua API]]
[[Category:Lua API]]
[[Category:Experimental Lua API]]
[[Category:Experimental Lua API]]
<!-- customkeys019:start -->
'''Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated server and clients.'''
== Shared placed-door path ==
The new server [[setWorldDoors]] path deploys approved doors with shared mechanism state, join-time replay and optional [[Custom keys|server-authoritative custom-key access]]. It is distinct from local editor native tests and static map_scene deployment. Use [[World door prefab catalog]] and [[Custom keys]] for the exact placement/API contract. This door-specific addition does not turn every seat/light/ladder preview or version-2 document into a shared deployed interaction.
<!-- customkeys019:end -->

Revision as of 20:00, 19 October 2026

Interactive map objects

Planned for G1R:MP 0.1.9 — experimental, not yet publicly released. This page describes the implemented map-editor catalogue, placement and local native testing. It does not announce finished multiplayer interaction support for newly placed furniture or lights. Public 0.1.8 does not include this extension.

What was added

  • Separate searchable categories for 18 seat variants and 48 light/flame variants. See the complete Interactive prefab catalog for IDs and names.
  • Seats include chairs, stools, benches, boxes and a throne. Lights include torches, braziers, candles, chandeliers, lanterns and mine lamps.
  • Placement, selection, move, yaw rotation, duplicate, undo/redo, hierarchy and saved prefab identity are integrated with Map editor.
  • A local Test native action temporarily replaces the editing representation with the real native object for interaction checks.
  • A saved Initial fire: ON/OFF property for light prefabs.
  • Preview placement now accounts for the model's original local offset and rotation. This addresses benches/seats visibly rotating or shifting when entering native testing and returning to editing.
  • Cleanup waits for native release and the exit animation, instead of forcibly interrupting a seated character. The local seat-test clearance is 1 metre.

The catalogue is curated; it is not an arbitrary game-class spawner. Beds, crafting/workshop stations, quest objects and general mechanisms are not enabled merely because their models exist.

Editing and local testing

  1. Open the authorized Map editor session and select the seat or light category in the model browser.
  2. Search by name, select a prefab and place it using the editor's normal placement workflow.
  3. Set position in metres and yaw in degrees. Native prefabs require pitch=0, roll=0, scale 1 on every axis and collision enabled. These restrictions do not change ordinary static-object editing.
  4. Wait for pending edits to finish. Select a visible interactive object, then click Test native. The editing proxy is temporarily hidden and non-colliding.
  5. For a seat, use the game's ordinary approach/sit/stand interaction. For lights, F6 requests on and F7 requests off. Verify the actual animation or light effect, not only an accepted-command message.
  6. Stand up normally and move at least 1 metre away from a seat. Press F8 to finish. If cleanup is pending, allow the native exit/release to complete. The editor returns only after the temporary object has been removed and the editing proxy restored.
  7. Save the map and wait for confirmation before exporting.

Only one local native test is active at a time. The movable object shown while editing is deliberately a static preview, not a shared, usable seat. Some compound light prefabs show extra pieces/effects only during the native test. Hiding/locking/duplicating an editor entry does not create multiplayer seat reservations.

F6/F7 affect the temporary test object, not the saved initial light setting. Change Initial fire: ON/OFF in the editor inspector and save if that setting should persist in the document.

The ordinary chair (chair_01), stool (chair_stool) and wooden bench (chair_woodbench) have confirmed single-instance sit/stand/cleanup tests. Other catalogue entries still require individual in-game verification. Catalogue presence is not a guarantee that every interaction variant or visual has been verified.

Lua helper

MapEditor.CreateInteractiveObject is a client-side helper inside the map_editor resource, not an engine-global server spawn function and not an export automatically available to unrelated resources.

-- Inside an initialized map_editor client session:
local id = MapEditor.CreateInteractiveObject("chair_01", {
    x = 12.0, y = 24.0, z = 2.0, yaw = 90.0
})
if not id then
    outputDebugString("Editor placement was not queued")
end

Coordinates are illustrative; use a clear, suitable location in your map. The returned ID means the operation was queued. Native completion is asynchronous: wait for the editor's success/error before relying on the scene state. The helper creates an editor entry/preview, not a usable multiplayer actor.

Save, open and export

Document/export Behavior
Static-only map Retains the existing version-1 map format.
Map containing interactive entries Uses version 2, retaining prefab ID, transform and initial light state through save/open and Lua export.
Legacy JSON export Rejects interactive entries because the legacy format cannot preserve their behavior. It does not silently turn them into static objects.
Existing static-only map_scene deployment Cannot deploy version-2 interactive maps. Do not remove the version check or rename the file to bypass this restriction.

Saving or exporting a version-2 document is not deployment of synchronized native interactions. Keep a backup and use Map scene deployment only for supported static documents until a shared interactive runtime is available.

Remaining multiplayer work

Multiple independent native instances, server-owned interaction/reservation rules, occupied-object editing/removal, disconnect cleanup, synchronization of newly placed flames, dimension handling and late-join replay are not complete. Remote sitting animations alone do not provide these guarantees. Original world seats and the already-existing world-torch synchronization are separate systems and are not replaced by this local test feature.

Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated server and clients.

Shared placed-door path

The new server setWorldDoors path deploys approved doors with shared mechanism state, join-time replay and optional server-authoritative custom-key access. It is distinct from local editor native tests and static map_scene deployment. Use World door prefab catalog and Custom keys for the exact placement/API contract. This door-specific addition does not turn every seat/light/ladder preview or version-2 document into a shared deployed interaction.