Interactive map objects: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document upcoming 0.1.9 custom native keys, shared doors, server Lua callbacks and persistence; not a release
Complete upcoming 0.1.9 documentation: weather, crafting UI, world removal, doors and ladders; preserve release status
Line 1: Line 1:
= Interactive map objects =
= 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.
'''Available from G1R:MP 0.1.9 (upcoming; not yet publicly released).''' This page covers placement, local native tests and the separate server-owned deployment path for doors. Public 0.1.8 does not include this extension. Seats, lights and placed ladders still require local qualification; shared door support does not enable their shared runtime.


== What was added ==
== 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.
* Four searchable categories: '''18 seats, 48 lights/flames, 7 doors and 21 ladder sizes''' (94 entries). See [[Interactive prefab catalog]] for all IDs and names.
* Seats include chairs, stools, benches, boxes and a throne. Lights include torches, braziers, candles, chandeliers, lanterns and mine lamps.
* 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]].
* Placement, selection, move, yaw rotation, duplicate, undo/redo, hierarchy and saved prefab identity are integrated with [[Map editor]].
Line 14: Line 14:


== Editing and local testing ==
== Editing and local testing ==
# Open the authorized [[Map editor]] session and select the seat or light category in the model browser.
# Open the authorized [[Map editor]] session and select the seat, light, door or ladder category in the model browser.
# Search by name, select a prefab and place it using the editor's normal placement workflow.
# Search by name, select a prefab and place it using the editor's normal placement workflow.
# Set position in metres and <code>yaw</code> in degrees. Native prefabs require <code>pitch=0</code>, <code>roll=0</code>, scale 1 on every axis and collision enabled. These restrictions do not change ordinary static-object editing.
# Set position in metres and <code>yaw</code> in degrees. Native prefabs require <code>pitch=0</code>, <code>roll=0</code>, scale 1 on every axis and collision enabled. These restrictions do not change ordinary static-object editing.
# Wait for pending edits to finish. Select a visible interactive object, then click '''Test native'''. The editing proxy is temporarily hidden and non-colliding.
# Wait for pending edits to finish. Select a visible interactive object, then click '''Test native'''. The editing proxy is temporarily hidden and non-colliding.
# 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.
# For a seat, use the game's ordinary approach/sit/stand interaction. For lights, '''F6''' requests on and '''F7''' requests off. For doors, verify both the character interaction and moving door leaf/collision. For ladders, check bottom/top entry, climb and exit at suitable surrounding geometry. Verify the actual effect, not only an accepted-command message.
# 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.
# Finish the native interaction normally and move at least '''1 metre''' away. 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.
# Save the map and wait for confirmation before exporting.
# Save the map and wait for confirmation before exporting.


Line 48: Line 48:
| Static-only map || Retains the existing version-1 map format.
| 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.
| Map containing interactive entries || Uses version 2, or version 3 when original-world removals are also present; retains prefab identity and supported properties.
|-
|-
| Legacy JSON export || Rejects interactive entries because the legacy format cannot preserve their behavior. It does not silently turn them into static objects.
| 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.
| Updated map_scene from 0.1.9 || Supports static objects, approved server-owned doors and compatible original-world removals. Rejects seats/lights/ladders as shared interactive deployments. Use the complete updated manifest and both loaders.
|}
|}
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.
Saving or exporting is not itself deployment. Keep a backup and follow [[Map scene deployment]]. An unsupported interactive category is rejected, not silently converted to a static model.


== Remaining multiplayer work ==
== Shared doors and live publication ==
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.
Save a map containing supported doors, then confirm '''Apply removals + doors LIVE'''. This replaces the editor resource's saved door/removal set for all players and closes local previews. Static additions still use Export Lua / map_scene. '''Test native is always local''' and is not the multiplayer deployment button.
 
The server controls placed-door definitions, interaction leases, open/closed state and join-time replay through [[setWorldDoors]]. Identical definitions preserve the current session state; moving/replacing/removing a door creates a new incarnation and rejects stale requests. Removing a busy door waits for native release. Resource/server restart restores saved placements but starts doors closed. [[Custom keys]] adds server-validated key requirements and callbacks; editor placement alone does not create a key binding.
 
Doors stream near players (create within 120 metres, retire beyond 180 metres); native construction is paced to at most one per 150 ms. First-use asset loading can still hitch. This is not networked rigid-body physics, a dimension-specific map instance or a promise of no loading cost. Test actual door motion, collision, both sides, simultaneous attempts and another player/late join.
 
== Ladder lengths ==
Choose a catalog size rather than scaling a ladder. The 21 sizes use 7 through 25 steps, plus 28 and 30. <code>ladder_base</code> remains the original 12-step entry; other IDs are listed in [[Interactive prefab catalog]]. Approximate top-anchor heights range from 2.26 to 9.52 metres. These are segment-count variants of the native ladder, not 21 different materials or arbitrary scaling. Surrounding platforms/landing space are the author's responsibility. Placed ladders remain local native tests, not shared deployed interactions.
 
== Remaining scope ==
Shared seat reservations, newly placed flame state and placed-ladder lifecycle are not enabled by the door runtime. Remote animations alone do not make these local previews shared gameplay objects. Original world seats/torches/ladders and their existing synchronization are separate systems. [[World model removal]] covers hiding original objects; it is not deletion of newly created editor entries.
 
Local chair/stool/bench and selected door motion have been reported working. Every prefab, ladder entry/exit, identity combination, concurrent use and observer/late-join case still needs relevant in-game qualification. Server acceptance is not a rendered-state acknowledgement.


[[Category:Lua API]]
[[Category:Lua API]]
Line 63: Line 75:


<!-- customkeys019:start -->
<!-- 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.'''
'''Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8. Use matching updated clients and server.'''


== Shared placed-door path ==
== 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.
Approved doors support server-owned placement, interaction state and late-join replay through [[setWorldDoors]], including the updated editor/map_scene deployment workflow. [[Custom keys]] documents independent native key types, copies, drop/pickup, key access and lifecycle callbacks; [[World door prefab catalog]] lists the door-only aliases. Seats, lights and placed ladders remain outside this shared door runtime.
<!-- customkeys019:end -->
<!-- customkeys019:end -->

Revision as of 20:56, 19 October 2026

Interactive map objects

Available from G1R:MP 0.1.9 (upcoming; not yet publicly released). This page covers placement, local native tests and the separate server-owned deployment path for doors. Public 0.1.8 does not include this extension. Seats, lights and placed ladders still require local qualification; shared door support does not enable their shared runtime.

What was added

  • Four searchable categories: 18 seats, 48 lights/flames, 7 doors and 21 ladder sizes (94 entries). See Interactive prefab catalog for all 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, light, door or ladder 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. For doors, verify both the character interaction and moving door leaf/collision. For ladders, check bottom/top entry, climb and exit at suitable surrounding geometry. Verify the actual effect, not only an accepted-command message.
  6. Finish the native interaction normally and move at least 1 metre away. 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, or version 3 when original-world removals are also present; retains prefab identity and supported properties.
Legacy JSON export Rejects interactive entries because the legacy format cannot preserve their behavior. It does not silently turn them into static objects.
Updated map_scene from 0.1.9 Supports static objects, approved server-owned doors and compatible original-world removals. Rejects seats/lights/ladders as shared interactive deployments. Use the complete updated manifest and both loaders.

Saving or exporting is not itself deployment. Keep a backup and follow Map scene deployment. An unsupported interactive category is rejected, not silently converted to a static model.

Shared doors and live publication

Save a map containing supported doors, then confirm Apply removals + doors LIVE. This replaces the editor resource's saved door/removal set for all players and closes local previews. Static additions still use Export Lua / map_scene. Test native is always local and is not the multiplayer deployment button.

The server controls placed-door definitions, interaction leases, open/closed state and join-time replay through setWorldDoors. Identical definitions preserve the current session state; moving/replacing/removing a door creates a new incarnation and rejects stale requests. Removing a busy door waits for native release. Resource/server restart restores saved placements but starts doors closed. Custom keys adds server-validated key requirements and callbacks; editor placement alone does not create a key binding.

Doors stream near players (create within 120 metres, retire beyond 180 metres); native construction is paced to at most one per 150 ms. First-use asset loading can still hitch. This is not networked rigid-body physics, a dimension-specific map instance or a promise of no loading cost. Test actual door motion, collision, both sides, simultaneous attempts and another player/late join.

Ladder lengths

Choose a catalog size rather than scaling a ladder. The 21 sizes use 7 through 25 steps, plus 28 and 30. ladder_base remains the original 12-step entry; other IDs are listed in Interactive prefab catalog. Approximate top-anchor heights range from 2.26 to 9.52 metres. These are segment-count variants of the native ladder, not 21 different materials or arbitrary scaling. Surrounding platforms/landing space are the author's responsibility. Placed ladders remain local native tests, not shared deployed interactions.

Remaining scope

Shared seat reservations, newly placed flame state and placed-ladder lifecycle are not enabled by the door runtime. Remote animations alone do not make these local previews shared gameplay objects. Original world seats/torches/ladders and their existing synchronization are separate systems. World model removal covers hiding original objects; it is not deletion of newly created editor entries.

Local chair/stool/bench and selected door motion have been reported working. Every prefab, ladder entry/exit, identity combination, concurrent use and observer/late-join case still needs relevant in-game qualification. Server acceptance is not a rendered-state acknowledgement.

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

Shared placed-door path

Approved doors support server-owned placement, interaction state and late-join replay through setWorldDoors, including the updated editor/map_scene deployment workflow. Custom keys documents independent native key types, copies, drop/pickup, key access and lifecycle callbacks; World door prefab catalog lists the door-only aliases. Seats, lights and placed ladders remain outside this shared door runtime.