SetNpcDimension: Difference between revisions
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 | * 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
setNpcDimension
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 human NPC.
Syntax
ok = setNpcDimension(npcId, dimension)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
npcId |
number |
yes | Numeric NPC ID returned by spawnNpc; not a player ID. |
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 = setNpcDimension(npcId, 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.
- Only the calling resource's own actors may be changed. Getters do not grant ownership.
- Clears the previous combat target/attack while preserving stats, appearance, equipment and authored route/movement configuration.
- For a new actor, pass options.dimension to spawnNpc to avoid a temporary dimension-0 spawn.