GetItemStatDefinitions

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 13:27, 20 October 2026 by QCherry (talk | contribs) (Release 0.1.9 / BUILD264 / Protocol42: availability and download setup; preserve experimental limits)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

getItemStatDefinitions

AVAILABLE FROM UPDATE 0.1.9
Available from 0.1.9. See the scope and validation notes below.

Describes which properties a type accepts and how to validate them.

Syntax

definitions = getItemStatDefinitions(item)

Parameters

Name Type Required Description
item string yes Known canonical item key or recognized alias; this is not an inventory-instance ID.

Returns

nil for an unknown type; otherwise a map keyed by applicable property name. Each row contains writable, reason, minimum, maximum, integer, defaultKnown and nativeDefaultKnown. reason is empty for writable fields. A field outside the item family may be absent entirely.

Examples

local defs = getItemStatDefinitions("mercenary")
local field = defs and defs.resistanceEdge
if field and field.writable then
    local ok, why = setItemStats("mercenary", {resistanceEdge=80})
    assert(ok, why)
end

Notes

  • Available from G1R:MP 0.1.9. This documents the implemented API and its current limits. See Item type stats for scope and remaining in-game validation.
  • Server-side only. Profiles affect every copy of the same type on this server, across dimensions; not individual item instances.
  • Use matching supported client and server builds. Server acceptance and a client application report do not prove the native gameplay effect.
  • writable describes the implemented capability, not proof of a successful in-game effect or refreshed native tooltip.