GetNpcDimension

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 14:37, 11 October 2026 by QCherry (talk | contribs) (Document upcoming 0.1.8 character dimensions: six server APIs, three events and creator guide; not a release announcement)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

getNpcDimension

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 human NPC.

Syntax

dimension = getNpcDimension(npcId)

Parameters

Name Type Required Description
npcId number yes Numeric NPC ID returned by spawnNpc; not a player ID.

Returns

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

Examples

local dimension = getNpcDimension(npcId)
if dimension ~= false then
    outputDebugString("Dimension: " .. dimension)
end

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.
  • 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.