GetPlayerIdentity: Difference between revisions
Jump to navigation
Jump to search
Document 0.1a Lua API, identities, moderation and synchronized spells |
Document skin color and tattoos available from 0.1.3; identity/armor improvements |
||
| Line 1: | Line 1: | ||
= getPlayerIdentity = | = getPlayerIdentity = | ||
Returns the player's | <div style="background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;"> | ||
<div style="color:#111111; font-weight:bold; letter-spacing:0.04em;">IMPROVED FROM UPDATE 0.1.3</div> | |||
<div style="color:#111111; margin-top:0.25rem;">This function is available in earlier releases and has corrected or expanded behavior in G1R:MP 0.1.3 and later. The contract below describes the updated behavior.</div> | |||
</div> | |||
Returns the canonical head/face identity key when the player's legacy identity layers agree. | |||
== Syntax == | == Syntax == | ||
| Line 15: | Line 20: | ||
== Returns == | == Returns == | ||
Returns the stable identity key, or <code>false</code> when the player is invalid or the | Returns the stable identity key, or <code>false</code> when the player is invalid, a required legacy layer is unavailable, or the legacy face/body and head layers use different keys. | ||
== Examples == | == Examples == | ||
Read the current | Read the current canonical head/face identity: | ||
<syntaxhighlight lang="lua" line> | <syntaxhighlight lang="lua" line> | ||
local identityKey = getPlayerIdentity(playerId) | local identityKey = getPlayerIdentity(playerId) | ||
| Line 28: | Line 33: | ||
== Notes == | == Notes == | ||
* Available only in server-side resource scripts. | * Available only in server-side resource scripts. | ||
* | * This existing getter is marked improved in 0.1.3, not introduced in that release. It reads server-authoritative state; it does not inspect or acknowledge the client's rendered image. | ||
* | * The compatibility check still requires matching legacy face/body and head keys. A mixed legacy configuration returns <code>false</code>; use <code>setPlayerIdentity</code> for one supported identity selection. | ||
* In the updated renderer, identity is head-only. The current game body, equipped armor, skin-color override and tattoo override remain independent and preserved; the legacy body key does not mean the full NPC body replaces the player's body. | |||
* Reliable identity state is replayed on relevance entry and late join. Asset loading and visual reconstruction are asynchronous; a returned key does not guarantee that every material, armor and LOD combination has finished rendering correctly. | |||
* See [[Player customization]] and [[Player identity catalog]] for the current appearance contract and supported keys. | |||
[[Category:Lua Functions]] | [[Category:Lua Functions]] | ||
Latest revision as of 02:32, 9 September 2026
getPlayerIdentity
IMPROVED FROM UPDATE 0.1.3
This function is available in earlier releases and has corrected or expanded behavior in G1R:MP 0.1.3 and later. The contract below describes the updated behavior.
Returns the canonical head/face identity key when the player's legacy identity layers agree.
Syntax
string|false getPlayerIdentity(int playerId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
playerId |
int |
yes | The connected player identifier. |
Returns
Returns the stable identity key, or false when the player is invalid, a required legacy layer is unavailable, or the legacy face/body and head layers use different keys.
Examples
Read the current canonical head/face identity:
local identityKey = getPlayerIdentity(playerId)
if identityKey then
outputDebugString("Identity: " .. identityKey)
end
Notes
- Available only in server-side resource scripts.
- This existing getter is marked improved in 0.1.3, not introduced in that release. It reads server-authoritative state; it does not inspect or acknowledge the client's rendered image.
- The compatibility check still requires matching legacy face/body and head keys. A mixed legacy configuration returns
false; usesetPlayerIdentityfor one supported identity selection. - In the updated renderer, identity is head-only. The current game body, equipped armor, skin-color override and tattoo override remain independent and preserved; the legacy body key does not mean the full NPC body replaces the player's body.
- Reliable identity state is replayed on relevance entry and late join. Asset loading and visual reconstruction are asynchronous; a returned key does not guarantee that every material, armor and LOD combination has finished rendering correctly.
- See Player customization and Player identity catalog for the current appearance contract and supported keys.