SetNpcSkinColor: Difference between revisions
Jump to navigation
Jump to search
Document new NPC/player-mode API and events available from 0.1.5 |
Release G1R:MP 0.1.5 BUILD144 / Protocol 37; update availability and migration |
||
| Line 35: | Line 35: | ||
== Notes == | == Notes == | ||
* Server-side only. Mutations require the resource that owns this NPC; getters do not grant control. | * Server-side only. Mutations require the resource that owns this NPC; getters do not grant control. | ||
* Available from update 0.1.5 | * Available from update 0.1.5. See [[NPC scripting#NPC appearance since 0.1.5]]. | ||
* The authoritative state is replayed for relevance entry/late join. Rendering is asynchronous; acceptance does not mean the mesh has finished rebuilding. | * The authoritative state is replayed for relevance entry/late join. Rendering is asynchronous; acceptance does not mean the mesh has finished rebuilding. | ||
* Does not change authoritative HP, weapons, armor, routes or combat configuration. No automatic persistent database storage. | * Does not change authoritative HP, weapons, armor, routes or combat configuration. No automatic persistent database storage. | ||
Latest revision as of 07:34, 26 September 2026
setNpcSkinColor
AVAILABLE FROM UPDATE 0.1.5
This function is available in G1R:MP 0.1.5 and later. The contract below includes the compatibility guarantees introduced in that update.
Sets an independent NPC skin-color override.
Syntax
setNpcSkinColor(npcId, r, g, b)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
npcId |
int |
yes | NPC ID returned by spawnNpc; not a player ID. |
r |
int |
yes | Red sRGB channel, integer 0..255. |
g |
int |
yes | Green sRGB channel, integer 0..255. |
b |
int |
yes | Blue sRGB channel, integer 0..255. |
Returns
true when accepted, false when invalid, unavailable or owned by another resource.
Examples
setNpcSkinColor(npcId, 90, 60, 40)
Notes
- Server-side only. Mutations require the resource that owns this NPC; getters do not grant control.
- Available from update 0.1.5. See NPC scripting#NPC appearance since 0.1.5.
- The authoritative state is replayed for relevance entry/late join. Rendering is asynchronous; acceptance does not mean the mesh has finished rebuilding.
- Does not change authoritative HP, weapons, armor, routes or combat configuration. No automatic persistent database storage.
- Upper-initial alias SetNpcSkinColor is also supported.
- Rejects fractions, NaN, infinity, numeric strings and channels outside 0..255. Preserves identity, tattoo and armor. Values are converted from sRGB to linear material color by the client.