Plugins used
- Other5 built in
Set it up
- Make a Blueprint class with Other5 Game Coordinator as its parent.
- Place one in your map.
- Override the events you need (below). They run on every machine. Wrap game rules, such as spawning or scoring, in a Branch on Runs Game, which is true on the server or in single player.
Events
- On Coordinator Started and On Coordinator Stopped: set up and clean up.
- On Player Joined and On Player Left: for example, spawn a room for each new player.
- On Player Pawn Changed (Player, New, Old): fires on spawn, respawn and death. Use it to heal, reset or give gear.
- On Streaming Level Shown and On Streaming Level Hidden (Level Name): a part of your map has loaded or unloaded.
- On Area Added and On Area Removed (Actor): fire when you call Notify Area Added or Notify Area Removed as you spawn or remove rooms or tiles. Other Blueprints can then react in one place.
Useful nodes
- Get Tracked Players: everyone the coordinator knows about.
- Get Local Player Controller, Is Coordinator Running and Check Players (check for joins and leaves right now).
- Player Check Seconds (0.25 by default) sets how often it checks for players. Include Persistent Level makes the main map count as a streaming level too.
Good to know
- Use one coordinator per map. It's the place for your game's rules, so other Blueprints don't each need to watch for players.
- CubeEscape's director is built on this class.