StopCameraMovement: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document scripted camera API and events available from G1R:MP 0.1.3
 
Update 0.1.3 camera world placement, streaming safety and far camera test
 
Line 37: Line 37:
* Stop does not return the view to the player and does not release ownership. Call [[resetCameraPos]] for that.
* Stop does not return the view to the player and does not release ownership. Call [[resetCameraPos]] for that.
* Only the owning resource may change an already controlled camera. Server and client ownership are distinct, even when resource names match; use one side consistently for a camera sequence.
* Only the owning resource may change an already controlled camera. Server and client ownership are distinct, even when resource names match; use one side consistently for a camera sequence.
* Camera positions and complete paths/orbits must stay within 100 metres of the local character. Camera control does not move the character, change replication distance, freeze input, or enable remote-player spectating.
* Camera positions, paths and orbits have no distance limit relative to the local character. All world coordinates must remain finite and within -1,000,000 to 1,000,000 metres; the complete orbit extent is validated too. Camera control does not move the character, change replication distance, freeze input, or enable remote-player spectating.
* Use [[resetCameraPos]] to restore gameplay view. Resource stop, disconnect and world/character changes release camera ownership; see [[onClientCameraReset]].
* Use [[resetCameraPos]] to restore gameplay view. Resource stop, disconnect and world/character changes release camera ownership; see [[onClientCameraReset]].
* An applied acknowledgement confirms command handling, not that the resulting view has rendered. For a fresh read-back, request state after another frame or a short timer. See [[Scripted camera]] for lifecycle, acknowledgement and state-cache details.
* An applied acknowledgement confirms command handling, not rendering or completion of world streaming. For a fresh read-back, request state after another frame or a short timer. See [[Scripted camera]] for distant scenes, lifecycle, acknowledgement and state-cache details.


[[Category:Lua Functions]]
[[Category:Lua Functions]]
[[Category:Shared Functions]]
[[Category:Shared Functions]]
[[Category:Camera Functions]]
[[Category:Camera Functions]]

Latest revision as of 00:07, 9 September 2026

stopCameraMovement

AVAILABLE FROM UPDATE 0.1.3
This function is available in G1R:MP 0.1.3 and later. The contract below includes the compatibility guarantees introduced in that update.

Stops the current scripted movement, path or orbit while retaining the camera at its current scripted pose.

Syntax

-- Client-side
number|false stopCameraMovement()
-- Server-side
bool stopCameraMovement(int playerId)

Parameters

Name Type Required Description
playerId int yes Server-side only: the connected player whose local camera receives the command.

Returns

Client-side: a positive requestId, or false when validation or queuing fails. Wait for onClientCameraCommandResult to learn the execution result. Server-side: true only means validated and queued for the connected player; false means rejected. A server return value is not a client acknowledgement.

Examples

Client-side example; wait for the indicated acknowledgement phase.

local request = stopCameraMovement()
if not request then outputDebugString("Camera stop was not queued", 2) end

Notes

  • Available in client-side and server-side resource scripts. Equivalent PascalCase spelling: StopCameraMovement.
  • Client success phase: applied. An interrupted movement may also receive cancelled for its earlier requestId.
  • Stop does not return the view to the player and does not release ownership. Call resetCameraPos for that.
  • Only the owning resource may change an already controlled camera. Server and client ownership are distinct, even when resource names match; use one side consistently for a camera sequence.
  • Camera positions, paths and orbits have no distance limit relative to the local character. All world coordinates must remain finite and within -1,000,000 to 1,000,000 metres; the complete orbit extent is validated too. Camera control does not move the character, change replication distance, freeze input, or enable remote-player spectating.
  • Use resetCameraPos to restore gameplay view. Resource stop, disconnect and world/character changes release camera ownership; see onClientCameraReset.
  • An applied acknowledgement confirms command handling, not rendering or completion of world streaming. For a fresh read-back, request state after another frame or a short timer. See Scripted camera for distant scenes, lifecycle, acknowledgement and state-cache details.