Manually setting Team ID in Lyra..?

I made the easy way by testing directly into the C++ file \Source\LyraGame\Teams\LyraTeamCreationComponent.cpp
and it works (1 human versus 3 bots)

void ULyraTeamCreationComponent::ServerChooseTeamForPlayer(ALyraPlayerState* PS)
{
	if (PS->IsOnlyASpectator())
	{
		PS->SetGenericTeamId(FGenericTeamId::NoTeam);
	}
	else
	{
		int32 SelectedTeamID;
		if (PS->IsABot()) { // If player is a bot then team red
			SelectedTeamID= 1;
		}
		else { // If player is a human then team blue
			SelectedTeamID= 0;
		}
		// const FGenericTeamId TeamID = IntegerToGenericTeamId(GetLeastPopulatedTeamID());
        const FGenericTeamId TeamID = IntegerToGenericTeamId(SelectedTeamID);
		PS->SetGenericTeamId(TeamID);
	}
}

But anyone know a better example and can describe the good practice for a new instance class based on lyra plugins ?

10 Likes