SetPlayerArmorUpgrades: Difference between revisions

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search
Document armor catalogs and eight armor-upgrade Lua APIs from upcoming 0.1.9; public release unchanged
 
Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits
 
Line 2: Line 2:
<div style="background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;">
<div style="background:#fff5f5; border:1px solid #d13b3b; border-left:5px solid #d13b3b; color:#111111; padding:0.85rem 1rem; margin:0.75rem 0 1rem;">
<div style="color:#111111; font-weight:bold; letter-spacing:0.04em;">AVAILABLE FROM UPDATE 0.1.9</div>
<div style="color:#111111; font-weight:bold; letter-spacing:0.04em;">AVAILABLE FROM UPDATE 0.1.9</div>
<div style="color:#111111; margin-top:0.25rem;">Available from 0.1.9 (upcoming; not yet publicly released). Not included in public 0.1.8.</div>
<div style="color:#111111; margin-top:0.25rem;">Available from 0.1.9.</div>
</div>
</div>


Line 34: Line 34:


== Notes ==
== Notes ==
* Server-side only; available from 0.1.9, not yet publicly released. Not included in public 0.1.8.
* Server-side only; available from 0.1.9.
* See [[Armor upgrades]], [[Armor catalog]] and [[Armor upgrade catalog]].
* See [[Armor upgrades]], [[Armor catalog]] and [[Armor upgrade catalog]].
* The player must own the equipped base and every selected part, and satisfy the server equipment requirements. No items or attributes are granted.
* The player must own the equipped base and every selected part, and satisfy the server equipment requirements. No items or attributes are granted.

Latest revision as of 13:29, 20 October 2026

setPlayerArmorUpgrades

AVAILABLE FROM UPDATE 0.1.9
Available from 0.1.9.

Replaces all three selected armor-upgrade slots for a player.

Syntax

accepted = setPlayerArmorUpgrades(playerId, parts)

Parameters

Name Type Required Description
playerId number yes Existing connected player ID: finite integer 1..4294967295, not a numeric string.
parts table yes String keys top/mid/bottom only, with compatible part-key string values. Omitted slots, empty strings or none clear a slot. {} clears all parts.

Returns

Boolean: true when accepted; false for invalid arguments/selection, unavailable character, wrong family/slot, or failed ownership/requirements. Invalid selections are rejected before equipment mutation.

Examples

local presets = getArmorUpgradePresets("mercenary")
if presets and presets.heavy_2 then
    -- Player already wears mercenary and owns these parts.
    assert(setPlayerArmorUpgrades(playerId, presets.heavy_2))
end

Notes

  • Server-side only; available from 0.1.9.
  • See Armor upgrades, Armor catalog and Armor upgrade catalog.
  • The player must own the equipped base and every selected part, and satisfy the server equipment requirements. No items or attributes are granted.
  • Uses the already equipped base; never selects a different base. The part must match its family and slot.
  • true confirms server acceptance, not completed native rendering. No automatic healing/refill or database save.
  • Treat remote requests as untrusted; authorize the action in your server resource.
  • This is replacement, NOT a partial patch. Read the current table and modify one field to preserve the other slots. Values are keys, not item IDs; unknown table fields and non-string values reject the request.
  • Equivalent alias: SetPlayerArmorUpgrades.