In multiplayer, how do I get individual player controllers for a turn based system?

So I’m thinking in terms of like a turn-based game, where every player takes a turn at the same time, then all enemies take their turn at the same time.

Where each player has their own class they can choose like Warrior or Healer.

In my head, I’m thinking that:

  • For 2 players, you have some function where when you take an action, it sends a signal to the gamemode saying that player is ready.
  • Once all players are ready, execute actions, end turn, swap to enemy turn.

my question is, how would I go about setting up the conditions for this? I’m assuming I need to be watching variables related to the player controllers, since every post login creates a new player controller. I’ve seen examples of people creating and adding to a player controller array executed off a OnPostLogin. But I’m not sure how to check individual player controllers/who is using them.

I know the first player is always controller 0, and second player is always controller 1. But if I want to create a widget display of their class abilities, or display ally classes/icons on a HUD, how would I go about getting which controller they are?

i wouldnt use a list of player controllers for 2 reasons.

  1. they cant share info to each other directly, for instance maybe a team name or a turn progress.
  2. if you expand with an AI team it wont work

i used an actor component to handle my teams, i put it on the player state so it replicates to all or on the gamestate if its an AI team. the component can keep track of its owning controller so you have a ref to it for HUD etc