SetPlayerHead: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document player skin, body and head appearance API
 
Document Protocol 23 voice and player presentation APIs
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<!-- This page is generated automatically from the function definition: setPlayerHead. -->
<!-- This page is generated automatically from the function definition: setPlayerHead. -->
= setPlayerHead =
= setPlayerHead =
Changes a player's independent Nameless Hero head option.
Deprecated compatibility API that changes a player's legacy head layer.


== Syntax ==
== Syntax ==
Line 21: Line 21:


== Examples ==
== Examples ==
Select the second editable head:
Use Milten's head and hair without replacing equipped armor:
<syntaxhighlight lang="lua" line>
<syntaxhighlight lang="lua" line>
setPlayerBody(playerId, "default")
if not setPlayerHead(playerId, "milten") then
if not setPlayerHead(playerId, "head_02") then
     outputChatBox("The head option could not be applied.", playerId)
     outputChatBox("The head option could not be applied.", playerId)
end
end
Line 31: Line 30:
== Notes ==
== Notes ==
* Available only in server-side resource scripts.
* Available only in server-side resource scripts.
* This API writes the validated Mutable <code>Head</code> option and never accepts raw Unreal paths.
* Deprecated: use <code>setPlayerIdentity</code> to apply a complete supported identity atomically.
* A non-default head is rejected while a named full-body preset is active.
* This API accepts only catalog keys and never accepts raw Unreal paths.
* Named entries are composed with the current GTO face geometry and authoritative armor.
* 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>onPlayerHeadChange</code> when accepted.
* This emits <code>onPlayerHeadChange</code> when accepted.
Line 40: Line 40:
[[Category:Player Functions]]
[[Category:Player Functions]]
[[Category:Appearance Functions]]
[[Category:Appearance Functions]]
[[Category:Deprecated Lua API]]

Latest revision as of 06:13, 24 August 2026

setPlayerHead

Deprecated compatibility API that changes a player's legacy head layer.

Syntax

bool setPlayerHead(int playerId, string headKey)

Parameters

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

Returns

Returns true when the compatible head is accepted and replicated; otherwise returns false.

Examples

Use Milten's head and hair without replacing equipped armor:

if not setPlayerHead(playerId, "milten") then
    outputChatBox("The head option could not be applied.", playerId)
end

Notes

  • Available only in server-side resource scripts.
  • Deprecated: use setPlayerIdentity to apply a complete supported identity atomically.
  • This API accepts only catalog keys and never accepts raw Unreal paths.
  • Named entries are composed with the current GTO face geometry and authoritative armor.
  • The reliable state is replayed during relevance entry and late join.
  • This emits onPlayerHeadChange when accepted.