Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetSiegeWeaponUsersData

From RoR Wiki

UI Lua API · RvR functions
Version: WAR 1.4.8

Returns the players currently using (or building) the client's active siege weapon.

users = GetSiegeWeaponUsersData()

Arguments

None.

Returns

users
table – Array of user tables, indexed from 1. Nothing if there is no player object.

Each user table has these fields:

Key Type Meaning
objectNum number World object number of the user.
name wstring Character name.
level number Character level. For the local player this is the player's own rank.

Details

  • The list comes from the siege weapon's world object. If the client has no data for that object, an empty table is returned.
  • Users the client cannot resolve to a known world object are skipped, but the remaining entries keep their original positions, so the array can have gaps. The stock UI counts users with #.
  • A new table is built on every call.

Errors

None.

Example

From default/ea_siegeweaponwindow/source/siegeweaponcontrolwindow.lua:

SiegeWeaponControlWindow.currentUsers = GetSiegeWeaponUsersData()

local numUsers = # SiegeWeaponControlWindow.currentUsers
...
local userData = SiegeWeaponControlWindow.currentUsers[index]
local text  = GetFormatStringFromTable( "SiegeStrings", StringTables.Siege.LABEL_SIEGE_USER_AND_RANK, { userData.name, L""..userData.level } )

See also