People spawn on team 5
People can select teams 1-4 with mutators (Max size is 4) (mutators disable after player counter reaches 4)
When a timer ends →
Put them in team 1, 2, 3 or 4
BUT
if a team is full, DO NOT PUT THEM THERE
if a team has members, DO NOT PUT THEM THERE, put them in a team that has no members
if all team has members, put them in a team that is not full
Hey OM krouger! how is it going?
Let me see if I understood your issue! You already did the part of the mutators and the timer with random assignment of teams, right?
What you need is to know how to balance the teams under the conditions you listed, is that correct?
To help you, first I need to know if you are using Creative or UEFN!
I’ll be waiting for your answer!
Hello! I’ve written a verse code for it, now the part i need is working fine.
However, i need help with ending the game when only one team has alive players,
meaning when theres 1 team left
The most simple way you could go about doing it is saving a number of how many teams are alive and update it by checking all player’s fort_character.IsActive[]
and then when a team is empty subtract 1 from the teams alive and trigger a game end when there are less than or equal to 1 teams alive.
Also you could try doing this with different ways like checking the agents inside a mutator zone
Can you help me write a function for that?
I’d really apprecaite it
CheckIfFinished()<transacts>:logic=
TeamColl:=GetPlayspace().GetTeamCollection()
var TeamsAlive:int=0
for(Team:TeamColl.GetTeams()):
var IsTeamAlive:logic=false
for(TeamMember:TeamColl.GetAgents[Team]):
if(TeamMember.GetFortCharacter[].IsActive[]):
set IsTeamAlive=true
if(IsTeamAlive?). set TeamsAlive=TeamsAlive+1
if(TeamsAlive<=1). return true
else. return false
so this function checks if there is an alive member in the team?
which team does it check?
How should i call the function so it listens to whenever teams alive is 1 or less
It checks for all the teams that are in the game and if it finds only 1 team with an active fort_charactet it returns true
do i need to call the function every time i want to check?
if i want it to check continously until it returns true, how can i put it in a loop?
loop:
Sleep(1.0)
If(CheckIfFinished()?):
TeamSettings.EndRound()
Does if(CheckIfFinished()?): means if the function returns true?
and i put the loop into OnBegin?
Also, which team’s TeamSettings & Inventory Device I call to end round?
Can you help me put this function together, where i have 4 teams, and end the round when 1 team is left?
I have a team settings device that’s for all teams