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–1if the first groupmate slot is empty, otherwise0. Nothing if there is no player object.
Details
- The result is a number, not a boolean. In Lua both
0and1are true values, soif IsPlayerSolo() thenis 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 )
