Swap Offense Defense Teams

Is there a way to swap an entire team from Offense to Defense? Like in Assault Game modes for example.

TLDR;
What im trying to do is create a game where, for example, both teams get a chance to attack & defend. Well simple enough, you set game options to competitive, and thus both teams get a chance to Attack & Defend. BUT, once both teams have played both roles (And assuming the game doesn’t go into OT because both teams scored) the game ends. What i want is for the game to “restart”, without actually restarting. As in, swap Offense/Defense, and go again. And repeat this over n over (Until whenever/whatever is achieved and the match Officially Ends.).

What I DO know: Via scripts, you can; Disable Build-IN game Mode completion | Disable Build-In Game Mode Scoring | Go TO Assemble Heroes | Restart Match | Start Game Mode

Disabling Completion, simply makes it so the match doesn’t end, regardless if you run out of time OR cap both points. So the only way to end the match at this point is Via scripts. BUT all you can do (as far as i know of) is Either end the game by Declare Match Victory/Draw, which will boot you back to Lobby OR Go to Assemble Heroes, which Does restart the match, but Doesn’t swap teams. So both teams are Attacking/Defending again…

Restart Match does the same is hitting the Restart Match button via Show Lobby menu. The map reloads & all variables are reset. THUS, any game where players build up their stats impossible to play, well at least more then 1 games worth…

Congrats! you’ve read everything up to this point…you really must be board… But in all seriousness, Any suggestions?

im pretty sure you can swap teams with an action or condition, type in Swap in the search bar for actions and conditions, im gonna be home later so ill let you know at that time

There IS a Move player to Team action. But as far as i can tell, you can only move 1 player at a time (and that’s assuming there a slot available on the other team to move to, else said player get’s kicked to spectating) & for whatever reason, this action causes my game to crash. Server load goes to 255, & after a few seconds, game crashes. So idk how to use this properly, or another script of mine goes into an endless Loop once the player is transitioning from team to team. Either way, it’s not seamless like how the game normally swaps teams in between rounds.

just tried it, i myself can only move 1 player but when i did it it restarted the match due to server overload. devs might need to relook at the command, sorry :frowning:

Ya it’s unfortunate it doesn’t work. I mean, is Has worked a few times for me, but in a blank workshop w/ no other scripts. In my game w/ 180+ scripts. Using that action is a death sentence.

1 Like

One solution could be to use global variable to keep track of the score you actually want for your gamemode, use competitive settings, and force the in-game score to always be tied. When your win condition is reached, you can use your variables to set the actual score so it displays who won correctly.

Not sure how feasible this is or if it would even work, but its the best idea I got

thx for the input…but i already tried it & i couldn’t get it to work… Regardless if you change the games actual score (Team scores) the game still functions as how it would normally.
For example, the attacking team Doesn’t Cap 1st point, when the game switches sides, the now-on-attack team only has to get that 33% Cap & then they win. Game ends & boots back to lobby. OR, even if they Don’t cap, game ends in a draw.
I can’t get the game to THEN swap teams a 2nd time… Only way it seems to work is…well how it normally works…Both teams cap’d both pts & game goes into the OT loop…

oh yeah that’s quite the predicament. The last idea I can think of is using Tatianna’s suggestion but adding “wait” in between each swap team action since that will reduce the server load. Not sure if it’ll work but it’s worth a shot

Swap functionality will break your game. Both manual and script swapping is broken.

Something can’t be broken if it never worked.
The Swap Player action in the “Show Lobby” Menu has had the same issue ever since the addition of Workshop–
That’s also why with most (not all) larger Scripts to move a player from Team to Team you need to move them to spectator first and then into a Player Slot, since the Script would overload the server otherwise.