Managing Party Players
Initializing Players
All players including the party host will have a KronosPartyClient
beacon created when they join the party. This is the main class that can be used to interact with the party. It's basically the equivalent of the PlayerController
in the Unreal game framework.
ServerInitPlayer:
Server side player initialization. If you have a backend service this is a good place to read the player's skill rating, fetch cosmetics, etc.ClientInitPlayer:
Client side player initialization.
Party Player Data
The KronosPartyPlayerState
includes a Player Data framework that automatically replicates an integer array to all players. This makes it very easy to advertise data about each player, such as their profile level, the banner that they are using, or the character / class they are going to play.
Note that BeaconPlayerStates
don't have RPC capabilities, so the player data can only be changed through their owning KronosPartyClient
class instead.
Use the KronosPartyClient
class to change player data:
SetPlayerData
: Used to set the player data. Overrides previous player data entirely.GetPlayerData
: Used to read the player data using theKronosPartyPlayerState
.Player data can be initialized during the
ServerInitPlayer
andClientInitPlayer
events.
Party Player Skill Rating
The KronosPartyPlayerState
stores the player's skill rating.
Note that BeaconPlayerStates
don't have RPC capabilities, so the skill rating can only be changed through their owning KronosPartyClient
class instead.
Use the KronosPartyClient
class to change player skill rating:
SetPlayerElo
: Used to set the player's skill rating.GetPlayerElo
: Used to read the player's skill rating using theKronosPartyPlayerState
.Skill rating can be initialized during the
ServerInitPlayer
andClientInitPlayer
events.
Party Player Ready State
The party system has a built-in ready up feature. Each party player has a ready state which can be toggled using the TogglePlayerIsReady
function of the KronosPartyClient
. The ready state of the player is stored in the client's KronosPartyPlayerState
.
To check whether a player is ready or not, you can use the GetPlayerIsReady
function available in both the KronosPartyClient
and KronosPartyPlayerState
classes.
By default the ready state of players doesn't affect anything, however you can easily build systems on top of this (e.g. only enable the matchmaking button if all party players are ready). To do this you can get all KronosPartyPlayerStates
from the KronosPartyState
, loop through them and check if everyone is ready.
Last updated