Simply exposes the variable r_splitscreen
, the variable keeping track of the amount of display players on screen at any point, not just on regular splitscreen/replay splitscreen views, to the lua interface.
As of currently, there is no general good way of getting the amount of display players on the screen without atleast exposing this. I've tried numerous solutions, including:
splitscreen
(only works with local player splitscreen, and not for replay splitscreen)displayplayers
via displayplayers.iterate
(causes a notorious freeze with displayplayers
being filled with copies of display player 1)displayplayers
via normal for-loop (prevents the freeze, but will return 4 due to the copies of display player 1)c.pnum
(You can switch the view numbers at any time, so this will stay at 4 even if you switch to 2 views after having 4 views previously...)