Skip to content

XsGetTechAttribute

Read tech attribute from native game state.

XsGetTechAttribute(playerId, technology, attribute[, indexOrCost = 0])

Inputs: playerId, technology, and attribute are required integer IDs. indexOrCost is an optional integer attribute index or cost selector (default 0).

Output: value, available: integer when available is true; nil, false when unavailable.

Errors and unavailable states: Wrong numeric argument types raise a Lua argument error. Invalid IDs or an unavailable native query return nil, false; use the availability flag before reading the value.

See Low-level queries for related calls and usage notes.