Balancing Players During the Game
7. Balancing Players During the Game
When a new player joins the game, they need to be balanced asymmetrically onto the right team. If that team happens to be the Infiltrators, they also need to have an instance of OnInfiltratorDamaged() associated with them.
When a new player joins the game, they need to be balanced asymmetrically onto the right team. If that team happens to be the Infiltrators, they also need to have an instance of OnInfiltratorDamaged() associated with them.
Follow the steps below to learn how to balance players to the correct team when they join the game in progress.
Setting Up Player Join Functions
- Add a new function,
OnInfiltratorJoined(), to theinvisibility_managerclass definition. This function takes an agent and spawns an instance ofOnInfiltratorDamaged()with the given agent. Add thespecifier to this function, since you'll be calling it fromtriad_infiltration_game.| | # Spawns an OnInfiltratorDamaged function when a new infiltrator joins the game | | --- | --- | | | OnInfiltratorJoined<public>(InAgent:agent):void= | | | spawn{OnInfiltratorDamaged(InAgent)} |
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.