SetPlayerDimension: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document upcoming 0.1.8 character dimensions: six server APIs, three events and creator guide; not a release announcement
 
Release 0.1.8 / BUILD210 / Protocol 40: dimensions API availability, loading and UI fixes
 
Line 33: Line 33:


== Notes ==
== Notes ==
* Available from 0.1.8 / Protocol 40, currently in testing and not yet publicly released. Not included in public 0.1.7. Both client and server must update together.
* Available since 0.1.8 / Protocol 40. Both client and server must update together.
* Server-side only. See [[Character dimensions]] for the complete scope, transition rules and character-creator example.
* Server-side only. See [[Character dimensions]] for the complete scope, transition rules and character-creator example.
* Dimension 0 is the default; the ordinary streaming distance still applies. World objects, doors, gates and items remain shared.
* Dimension 0 is the default; the ordinary streaming distance still applies. World objects, doors, gates and items remain shared.

Latest revision as of 21:03, 11 October 2026

setPlayerDimension

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

Changes the server-authoritative dimension of a player.

Syntax

ok = setPlayerDimension(playerId, dimension)

Parameters

Name Type Required Description
playerId number yes Numeric ID of the connected player.
dimension number yes Integer 0..2147483647. Strings, negative/fractional/non-finite values are rejected.

Returns

true when accepted (also for an unchanged dimension); false when invalid, unavailable, busy or not permitted.

Examples

local ok = setPlayerDimension(playerId, 100)
if not ok then
    outputDebugString("Dimension change rejected")
end

Notes

  • Available since 0.1.8 / Protocol 40. Both client and server must update together.
  • Server-side only. See Character dimensions for the complete scope, transition rules and character-creator example.
  • Dimension 0 is the default; the ordinary streaming distance still applies. World objects, doors, gates and items remain shared.
  • Use these exact lower-camel names; there is no client-side setter.
  • An unchanged dimension returns true without emitting a change event or rebuilding characters.
  • Server acceptance is not a client rendering acknowledgement. Re-entry/late join uses the existing complete character appearance/state replay.
  • A pending transition/authoritative position change, active interaction/climb or owned mount lease can reject a change. Finish the activity, remove the owned mount if needed, and retry from your gamemode state machine.
  • Does not reconnect, teleport, replace the local avatar or reset inventory/mana/ammunition. Old character attacks/projectiles are retired.
  • Your gamemode owns creator-session allocation and restoration. Resource stop does not automatically restore player dimensions; reconnect starts at 0.