How to set up teams using blueprint?

Context:
I have an FPS. I want to have two teams of 5, named attackers and defenders. When a player joins the session, they will join the Spectators and they can choose either of the two teams: attackers or defenders. When they choose a team, they spawn in the respective team spawn point as an FPS character. How do I go about doing all this, at least starting it?

If you’re using AI as well, you can add a “Sense” and instantiate two stimuli, one for each team. Then, you assign the enemy sense so that each side senses the other side as an enemy.

The blueprints don’t have all the team functions like the C++ side of things has. So, instead of using the incomplete function sets, it’s generally recommended to create your own methods for tracking these things.

In multiplayer, with humans, create a wrapper, “PlayerParentActor”, and create multiple subcomponents that deal with gameplay. One of these components should contain a struct variable that tracks which team they are on. This part is for their need to know. Don’t let the game trust the player’s data, in multiplayer-- once your components are made, you can use a more global blueprint that the server or “AuthorityPlayer” will use to do all of the gameplay tasks. Add these new components, that track the player’s data, to the “trusted” blueprint so that the server is the authority on who is on whose team without players being able to get away with manipulating the data on their end. These component instances, one for each player, should be referenced as an array so you can easily add a new instance to the array.

If you’re only having two types of teams, it’s easy to make things called, “Team1”, and, “Team2”, but it’s best to just modularize things.

So, on the “trusted” blueprint, you can create components that have to do with general team information; color, “Attack”/“Defense”, name, array of members, etc. Then, add another set of components that inherit from this team information component and make them more specific to the “Attack” and “Defense” team information, if they differ. If not, then just create an instance for each team, adding them to the array on the “trusted” blueprint. From there, add the instances of the players’ information to the array in the instance of their respected team. Your gameplay blueprint can then automatically track who is on whose team by which instance of the team information they belong to.

What is a wrapper?

It’s basically a “template” of sorts that is setup will general data structures that are non-specific and can be reused for multiple purposes. It’s generally a term used for a primitive, generic structure of variables and simple functions that classes can inherit from in order to have a consistent “wrapper” as a basis for classes that are more specific to your long-term goals.

But what is it in context of using blueprints in Unreal Engine 4?
And what do you mean by components? Could you be a little bit more specific?

Yes that answer (while appreciated) is presented as if the person asking the question already has knowledge of blueprints and UE4 that is far above novice. And ultimately leaves a person more confused than they were originally.

I think what the OP and probably many others including myself are looking for is a thorough step by step breakdown of implementing teams and scoring systems.

I’m actually quite shocked to discover that this kind of tutorial has not been made available long ago.

I have given them a breakdown of the logic behind it. If they have further questions, they can reply or do a little research on the given keywords.

If you have a question, please stay your own topic.

I have successfully solved my problem. Thank you for your great effort in helping me solve it.

I would wholly appreciate a good video/tutorial of such a breakdown. Zakku’s great knowledge in UE4 and his ability to be such in depth with his answers would be well appreciated in some tutorials.