GetPlayerDimension: 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 31: Line 31:


== 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

getPlayerDimension

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.

Reads the server-authoritative dimension of a player.

Syntax

dimension = getPlayerDimension(playerId)

Parameters

Name Type Required Description
playerId number yes Numeric ID of the connected player.

Returns

The integer dimension, including 0, or false for an invalid/missing entity.

Examples

local dimension = getPlayerDimension(playerId)
if dimension ~= false then
    outputDebugString("Dimension: " .. dimension)
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.
  • Getters do not grant mutation permission or change visibility. A valid dimension can be 0; test explicitly against false for missing entities.