SetPlayerBody: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Clarify player appearance API behavior
Document Protocol 23 voice and player presentation APIs
Line 1: Line 1:
<!-- This page is generated automatically from the function definition: setPlayerBody. -->
<!-- This page is generated automatically from the function definition: setPlayerBody. -->
= setPlayerBody =
= setPlayerBody =
Changes a player's authoritative full-body identity preset.
Deprecated compatibility API that changes a player's authoritative legacy face profile.


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


== Returns ==
== Returns ==
Returns <code>true</code> when the compatible preset is accepted and replicated; otherwise returns <code>false</code>.
Returns <code>true</code> when the validated profile is accepted and replicated; otherwise returns <code>false</code>.


== Examples ==
== Examples ==
Use Milten's complete character appearance:
Apply Milten's GTO face profile through the compatibility API:
<syntaxhighlight lang="lua" line>
<syntaxhighlight lang="lua" line>
if not setPlayerBody(playerId, "milten") then
if not setPlayerBody(playerId, "milten") then
     outputChatBox("The body preset could not be applied.", playerId)
     outputChatBox("The face profile could not be applied.", playerId)
end
end
</syntaxhighlight>
</syntaxhighlight>
Line 30: Line 30:
== Notes ==
== Notes ==
* Available only in server-side resource scripts.
* Available only in server-side resource scripts.
* A named body includes the character's original body, head and outfit or armor appearance.
* Deprecated: use <code>setPlayerIdentity</code> for complete character identities or <code>setPlayerFace</code> for face-only changes.
* Set the body to <code>default</code> before selecting an independent head or displaying separately equipped armor.
* This is a compatibility alias for <code>setPlayerFace</code>.
* The profile controls GTO skin traits, proportions and mimic data. Head/hair and armor remain independent.
* The reliable state is replayed during relevance entry and late join.
* The reliable state is replayed during relevance entry and late join.
* This emits <code>onPlayerBodyChange</code> when accepted.
* This emits both <code>onPlayerBodyChange</code> and <code>onPlayerFaceChange</code> when accepted.


[[Category:Lua Functions]]
[[Category:Lua Functions]]
Line 39: Line 40:
[[Category:Player Functions]]
[[Category:Player Functions]]
[[Category:Appearance Functions]]
[[Category:Appearance Functions]]
[[Category:Deprecated Lua API]]

Revision as of 06:13, 24 August 2026

setPlayerBody

Deprecated compatibility API that changes a player's authoritative legacy face profile.

Syntax

bool setPlayerBody(int playerId, string bodyKey)

Parameters

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

Returns

Returns true when the validated profile is accepted and replicated; otherwise returns false.

Examples

Apply Milten's GTO face profile through the compatibility API:

if not setPlayerBody(playerId, "milten") then
    outputChatBox("The face profile could not be applied.", playerId)
end

Notes

  • Available only in server-side resource scripts.
  • Deprecated: use setPlayerIdentity for complete character identities or setPlayerFace for face-only changes.
  • This is a compatibility alias for setPlayerFace.
  • The profile controls GTO skin traits, proportions and mimic data. Head/hair and armor remain independent.
  • The reliable state is replayed during relevance entry and late join.
  • This emits both onPlayerBodyChange and onPlayerFaceChange when accepted.