Download

UE4 Multiplayer Template - Implementing Team Spawning.

Hi all. So, I followed the UE4 Multiplayer template off of Youtube and everything works fine. However, at the moment it is more like a free for all game mode and I would like to implement a team based game mode.

Currently the team spawning does not work. Within 0_base class I have added a integer variable called TeamID. For the player I want to spawn at certain playerstarts I hae set the TeamID variable to 0 and the others I have set to 1.

I have created two new player start classes, one for each team. Within in GameplayGM (I think it is called this), where is says respawn I have but it a branch and the condition is, if TeamID = 0 use this playerstart class to spawn and if TeamID = 1, then use this playerstart class to spawn. It does not work. From my testing it seems as if it will either spawn the players at one of the other spawn location and not both.

I have scoured the internet and I cannot find any information which would help me with this type of problem, sure there are videos on Youtube but they don’t relate to what I am trying to do. I was wondering if anyone else has had this problem and what solution they used to overcome it. This is the initial post and I can, in further posts, post the project file. I will this afternoon be able to post screenshots of the blueprints.

Cheers.

I think I know what the problem is but it would be nice for a little feedback. I am using a base character 0_base, of which the game characters are child classes. When I do the check to see if the teamID is either 0 or 1, it is resorting to the 0_base teamID, this is always over riding the other child classes teamID. I am going to try and implement this tomorrow. I will update, just in case anyone else has had this problem.

This what I am trying at the moment. I am checking if the players teamid is either 0 or 1. If it is 0 it should use UTAMASpawn and if it is 1 it should use CultSpawn. But it is not working. It just uses UTAMA one. Here is a screenshot.

I keep trying but nothing is working. Every now and again it works and then it doesn’t. I have uploaded the file, hopefully, someone can take a look?
The file is on my Google Drive: SteamProject - 2 Team Classes - Google Drive

Not sure if you’ve worked out your problem yet (hopefully so!), but looking at your Character Select graph, you’re only assigning Team IDs to your Utama player characters and leaving Cult player characters with unassigned values for their Team IDs (which your GameplayGM doesn’t know what to do with since you’re trying to check for both 0 and 1 Team IDs.)