Change Teams Button,,,how to get it back.

  • 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.

Ryan_Griffiths

New Member
Mar 13, 2005
12
0
0
Ive just started coding in unreal script. ive followed various tutorials from Wiki and other places and have managed to make my own game type. The teams work, so does the scoring. The Hud has been modified and the Scoreboard has too. (i have programmed in a few languages before, so things are easy to pick up)

BUT...

i can't seem to get that blasted Change Teams button back. You know, the one on the in-game menu when you press escape.

I do believe this is the code in the GUI2K4.UT2K4MidGameMenu class that checks to see if the button should be drawn.

if (PC.GameReplicationInfo == None || !PC.GameReplicationInfo.bTeamGame || PC.GameReplicationInfo.bNoTeamChanges )
RemoveComponent(bChangeTeam);

basically this says "something OR bTeamGame=False or bNoTeamChanges is True

im not too sure about that first one, i think it is the problem.

i found the point in my code where i should write


GameReplicationInfo.bNoTeamChanges = False;
GameReplicationInfo.bTeamGame = True;

its in my PreBeginPlay event.
(i think thats where it should go)

but for some reason the button doesnt appear.

I then searched for several hours through all the invasion source code to try and find something that relates to this button but i found nothing.

can anyone shed any light on this?

Thanks.

Rye
 

Bonehed316

New Member
Oct 15, 2001
208
0
0
41
Florida
Visit site
Do a log at some point (if you can do it in a tick or wherever, that would be okay) to log the PlayerController.GameReplicationInfo.Class. Make sure its not none. There might be an easier way, but I usually just log. If its not none, and bTeamGame is true, and bNoTeamChanges is false, it should work.

Do you get an accessed none warning while trying to set the bNoTeamChanges and bTeamGame? If you do, then its None, and that is your problem.

Have you set the GameReplicationInfoClass to something in your gametype? That should avoid it being none.
 

Ryan_Griffiths

New Member
Mar 13, 2005
12
0
0
i get alot of errors in my log, most of them are the same thing being repeated.

Warning: TI_ScoreBoard DM-RYE-Storage.TI_ScoreBoard (Function TeamINV.TI_ScoreBoard.GetTitleString:0034) Accessed None 'GRI'
Warning: TI_ScoreBoard DM-RYE-Storage.TI_ScoreBoard (Function TeamINV.TI_ScoreBoard.GetTitleString:0069) Accessed None 'GRI'

thats repeated about 100 times, then i get the start match log followed by this:...

Warning: TeamINV DM-RYE-Storage.TeamINV (Function SkaarjPack.Invasion.MatchInProgress.BeginState:001D) Accessed None 'GameReplicationInfo'
Warning: TeamINV DM-RYE-Storage.TeamINV (Function SkaarjPack.Invasion.MatchInProgress.BeginState:0025) Attempt to assign variable through None

then comes the log i set up in the pre begin play which says that GameReplicationInfo doesnt equal None. I used log(GameReplicationInfo), here is what it says.

ScriptLog: ________________________________________________________________________
ScriptLog: ________________________________________________________________________
ScriptLog: DM-RYE-Storage.TeamINVGameReplicationInfo
ScriptLog: ________________________________________________________________________
ScriptLog: ________________________________________________________________________
ScriptLog: running

but after that it gives more errors...

Warning: TeamINV DM-RYE-Storage.TeamINV (Function SkaarjPack.Invasion.PreBeginPlay:001D) Accessed None 'GameReplicationInfo'
Warning: TeamINV DM-RYE-Storage.TeamINV (Function SkaarjPack.Invasion.PreBeginPlay:0025) Attempt to assign variable through None
Warning: TeamINV DM-RYE-Storage.TeamINV (Function SkaarjPack.Invasion.PreBeginPlay:0038) Accessed None 'GameReplicationInfo'
Warning: TeamINV DM-RYE-Storage.TeamINV (Function SkaarjPack.Invasion.PreBeginPlay:0040) Attempt to assign variable through None

so obviously ive done something wrong somewhere. any ideas?
 

Bonehed316

New Member
Oct 15, 2001
208
0
0
41
Florida
Visit site
Hm. Well, it wasn't none, obviously, but then it becomes none. You'll need to post code for further help, or look for a place where the variable is destroyed or set to none.
 

Ryan_Griffiths

New Member
Mar 13, 2005
12
0
0
Ive got rid of most the errors and narrowed down the problem a little.
here is the relevant part of my log now.

Log: Bringing Level DM-RYE-Storage.myLevel up for play (0) appSeconds: 25.367000...
Log: (Karma): Autodetecting CPU for SSE
Log: (Karma): Using SSE Optimizations
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.InitGame:0012) Accessed None 'GameReplicationInfo'
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.InitGame:0023) Accessed None 'GameReplicationInfo'
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.InitGame:0034) Accessed None 'GameReplicationInfo'
ScriptLog: _____________________init1______________________
ScriptLog: None
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.InitGame:0084) Accessed None 'GameReplicationInfo'
ScriptLog: False
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.InitGame:0097) Accessed None 'GameReplicationInfo'
ScriptLog: False
ScriptLog: _______________________________________________
ScriptLog: GameInfo::InitGame : bEnableStatLogging False
ScriptLog: _____________________init2______________________
ScriptLog: None
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.InitGame:012A) Accessed None 'GameReplicationInfo'
ScriptLog: False
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.InitGame:013D) Accessed None 'GameReplicationInfo'
ScriptLog: False
ScriptLog: _______________________________________________
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.InitGame:018C) Accessed None 'GameReplicationInfo'
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.InitGame:019D) Accessed None 'GameReplicationInfo'
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.InitGame:01AE) Accessed None 'GameReplicationInfo'
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.PreBeginPlay:001D) Accessed None 'GameReplicationInfo'
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.PreBeginPlay:0025) Attempt to assign variable through None
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.PreBeginPlay:0038) Accessed None 'GameReplicationInfo'
Warning: TeamINV DM-RYE-Storage.TeamINV (Function TeamINV.TeamINV.PreBeginPlay:0040) Attempt to assign variable through None
ScriptLog: running
Log: Spawning new actor for Viewport WindowsViewport
 

Evolution

New Member
Jan 24, 2003
38
0
0
www.organized-evolution.com
InitGame is the first script function called when the match begins. GameReplicationInfo isn't created until [and someone correct me if I'm wrong - going completely from memory atm] GameInfo.PreBeginPlay (or maybe PostBeginPlay), which is called AFTER GameInfo.InitGame. Thus, GameReplicationInfo will always be None in InitGame, since the GameReplicationInfo property isn't assigned a value until after InitGame has been executed.

To figure out exactly where the GameReplicationInfo property is assigned, do a find-in-files for InitGameReplicationInfo().

Am I understanding your problem correctly?
 
Last edited:

Ryan_Griffiths

New Member
Mar 13, 2005
12
0
0
Thanks for all your help. I was just testing what i had done so far. Some friends joined in when i ran a dedicated server. what was strange is that the change teams button was there. I did some further testing and I dont think the host can change teams. But since i was running a dedicated server it was ok as everyone could change.