SetPlayerFace: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document Protocol 23 voice and player presentation APIs
 
Document 0.1a Lua API, identities, moderation and synchronized spells
 
Line 1: Line 1:
<!-- This page is generated automatically from the function definition: setPlayerFace. -->
= setPlayerFace =
= setPlayerFace =
Changes a player's authoritative GTO face profile without replacing head/hair or armor.
Deprecated compatibility API retained for legacy resources. It is unsupported for player appearance selection in G1R:MP 0.1.


== Syntax ==
== Syntax ==
Line 18: Line 17:


== Returns ==
== Returns ==
Returns <code>true</code> when the validated profile is accepted and replicated; otherwise returns <code>false</code>.
Returns <code>true</code> when the server accepts the legacy state; this does not guarantee a supported visual result in G1R:MP 0.1. Returns <code>false</code> when validation fails.


== Examples ==
== Examples ==
Change only the GTO face shape and mimic profile:
Migrate a legacy face call to the supported identity setter:
<syntaxhighlight lang="lua" line>
<syntaxhighlight lang="lua" line>
if not setPlayerFace(playerId, "milten") then
-- Deprecated: setPlayerFace(playerId, "milten")
    outputChatBox("The face profile could not be applied.", playerId)
setPlayerIdentity(playerId, "milten")
end
</syntaxhighlight>
</syntaxhighlight>


== Notes ==
== Notes ==
* Available only in server-side resource scripts.
* Available only in server-side resource scripts.
* The reliable state is replayed during relevance entry and late join.
* Deprecated and unsupported for appearance selection in G1R:MP 0.1. Use <code>setPlayerIdentity</code>; it is the only supported complete identity setter.
* The server may retain and replay the legacy state for protocol compatibility, but resources must not rely on a visible face-only change.
* This emits both <code>onPlayerFaceChange</code> and the legacy <code>onPlayerBodyChange</code> event.
* This emits both <code>onPlayerFaceChange</code> and the legacy <code>onPlayerBodyChange</code> event.


Line 37: Line 36:
[[Category:Player Functions]]
[[Category:Player Functions]]
[[Category:Appearance Functions]]
[[Category:Appearance Functions]]
[[Category:Deprecated Lua API]]

Latest revision as of 11:36, 27 August 2026

setPlayerFace

Deprecated compatibility API retained for legacy resources. It is unsupported for player appearance selection in G1R:MP 0.1.

Syntax

bool setPlayerFace(int playerId, string faceKey)

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
faceKey string yes A stable key returned by getPlayerFaceNames.

Returns

Returns true when the server accepts the legacy state; this does not guarantee a supported visual result in G1R:MP 0.1. Returns false when validation fails.

Examples

Migrate a legacy face call to the supported identity setter:

-- Deprecated: setPlayerFace(playerId, "milten")
setPlayerIdentity(playerId, "milten")

Notes

  • Available only in server-side resource scripts.
  • Deprecated and unsupported for appearance selection in G1R:MP 0.1. Use setPlayerIdentity; it is the only supported complete identity setter.
  • The server may retain and replay the legacy state for protocol compatibility, but resources must not rely on a visible face-only change.
  • This emits both onPlayerFaceChange and the legacy onPlayerBodyChange event.