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
 
Clarify player appearance API behavior
Line 32: Line 32:
* 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.
* This API writes the validated Mutable <code>Head</code> option and never accepts raw Unreal paths.
* A non-default head is rejected while a named full-body preset is active.
* To display an independent head, set the body to <code>default</code>. Named body presets retain their original head.
* 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.

Revision as of 21:43, 15 August 2026

setPlayerHead

Changes a player's independent Nameless Hero head option.

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

Select the second editable head:

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

Notes

  • Available only in server-side resource scripts.
  • This API writes the validated Mutable Head option and never accepts raw Unreal paths.
  • To display an independent head, set the body to default. Named body presets retain their original head.
  • The reliable state is replayed during relevance entry and late join.
  • This emits onPlayerHeadChange when accepted.