UE2 - UT2kX Changing team sizes via Mutator. Again.

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

bBb

New Member
Jul 29, 2008
3
0
0
First off, I've searched the Wiki, the web, and these forums, and I've not found a definitive answer...


Anyway. I would like to create a mutator that simply changes team sizes. At the moment, I'm extending Mutator, and I've tried overriding StartingMatch, Pre- and PostBeginPlay, and SetInitialState amongst others. I've tried writing to TeamGame.Teams[].size and TeamGame.EnemyRoster.size, and DesiredTeamSize for both.

Nothing works. The team sizes remain at whatever the user has set in Game Rules.

So, can anyone suggest how I might do this? Is there a tutorial that covers this? Initially, I'd like to simply set Team0 size to x, and Team1 size to y. Once I get that working, I'll move on.

Any clues, anyone?
 

Jrubzjeknf

Registered Coder
Mar 12, 2004
1,276
0
36
36
The Netherlands
Read the code. You say that it holds on to the setting configured by the user. Find the name of that setting and search in which classes it is used. In those classes, you can find out how that setting is used to maintain a certain team size and thus if and how you can influence it.

Trying sometimes work, but it's not gonna help you in this case.
 

bBb

New Member
Jul 29, 2008
3
0
0
Um... I'm afraid I'm going to need another nudge.

Following the trail from the config GUI, it seems I want to override DeathMatch's PostBeginPlay(), but then I'd be creating a new gametype, and I don't want to do that.

Am I even heading in the right direction? Should I be extending a GameInfo or TeamInfo? Or should I just be poking the fields from a subclass of Mutator?
 
Last edited:

bBb

New Member
Jul 29, 2008
3
0
0
Aha. Some progress. I dug into BotMixer and found a method that appears to work :

I set a 1.5 timer in PostBeginPlay(), and inside Timer(), I write to InitialBots in DeathMatch, and Teams[] in TeamGame. However, this doesn't strike me as a very clean way to do it. Is this the recommended method?



Bonus question!

From experimentation, for a single-player game, the player is in Team[0]. Is this always true? If not, how can I find which team the player is in? TeamGame.StandalonePlayer.GetTeamNum() appears to return the other team index.