Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:IsPlayerSolo

From RoR Wiki

UI Lua API · Group functions
Version: WAR 1.4.8

Returns whether the player has no groupmates, as the number 1 or 0.

solo = IsPlayerSolo()

Arguments

None.

Returns

solo
number – 1 if the first groupmate slot is empty, otherwise 0. Nothing if there is no player object.

Details

  • The result is a number, not a boolean. In Lua both 0 and 1 are true values, so if IsPlayerSolo() then is always taken. Compare with == 1, as the stock UI does.
  • Only the first groupmate slot is tested: the slot counts as empty when its stored level is 0.
  • Warband membership is not looked at separately.

Errors

None.

Example

From default/ea_playerassist/source/ea_playerassist.lua:

local isPlayerSolo = ( IsPlayerSolo() == 1 )

WindowSetShowing( WINDOW_NAME, not isPlayerSolo )

See also