SetPlayerArmor: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document 0.1a Lua API, identities, moderation and synchronized spells
Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits
 
(One intermediate revision by the same user not shown)
Line 45: Line 45:
[[Category:Inventory Functions]]
[[Category:Inventory Functions]]
[[Category:Equipment Functions]]
[[Category:Equipment Functions]]
<!-- armor019:start -->
== Armor parts (from 0.1.9) ==
Available from 0.1.9. [[Armor catalog]] lists the 26 bases; [[Armor upgrade catalog]] lists all 84 pieces. This existing function/guide is not newly introduced in 0.1.9. The new [[Armor upgrades|upgrade system]] adds per-character top/mid/bottom selections, full presets and separate player/NPC setters. A different base clears the old parts; choosing the same base keeps compatible selections. Identity, skin tint and tattoos remain separate. See the guide for requirements, safe replacement and synchronization validation.
<!-- armor019:end -->

Latest revision as of 13:29, 20 October 2026

setPlayerArmor

Equips or clears a player's authoritative armor slot.

Syntax

bool setPlayerArmor(int playerId, string itemKey)

Parameters

Name Type Required Description
playerId int yes The connected player identifier.
itemKey string yes A key returned by getPlayerArmorNames, or "none" to clear the slot.

Returns

Returns true when the equipment change is accepted and replicated; otherwise returns false.

Examples

Example 1

Give an item and equip it in the armor slot:

local itemKey = "water_robe"
if givePlayerItem(playerId, itemKey) then
    setPlayerArmor(playerId, itemKey)
end

Example 2

Clear the armor slot:

setPlayerArmor(playerId, "none")

Notes

  • Available only in server-side resource scripts.
  • The player must own at least one copy of a non-empty item before it can be equipped.
  • The selected appearance is reliably synchronized and included in late-join state.
  • Gothic Remake character variants have identity-specific armor support. Not every identity/armor combination exists or renders correctly; test every combination exposed by a resource.

Armor parts (from 0.1.9)

Available from 0.1.9. Armor catalog lists the 26 bases; Armor upgrade catalog lists all 84 pieces. This existing function/guide is not newly introduced in 0.1.9. The new upgrade system adds per-character top/mid/bottom selections, full presets and separate player/NPC setters. A different base clears the old parts; choosing the same base keeps compatible selections. Identity, skin tint and tattoos remain separate. See the guide for requirements, safe replacement and synchronization validation.