Results 1 to 8 of 8
  1. #1
    Veteran
    Join Date
    Dec 2003
    Location
    Finland
    Posts
    5,996

    Default GameInfo: StartMatch() not called at all? (Solved)

    I'm coding my own gametype, extending from Engine.GameInfo.

    I'm doing logging to see how the code goes around when executed. Currently I can only get a log entry from PostBeginPlay(), but when trying to do a log from StartMatch() I get nothing.

    UDN states that StartMatch() is the function that really starts the match and spawns players. Even though I already have my controller and my pawn running around how come the StartMatch() doesn't execute?

    I get no errors during compile nor during game. This is the code I currently have regarding StartMatch():

    Code:
    function StartMatch()
    {
        super.StartMatch();
        
        `log( self $ "/StartMatch -> Started match." );
    }
    Last edited by musilowski; 03-07-2011 at 09:49 AM. Reason: Problem solved.
    Also known as Rask — http://www.ottorask.com/

    UT3 Levels: CTF-Austere (MSU P3 5th place)
    UE3 Tutorials: From Textures To Materials In UE3 Complex Fire In UE3

  2. #2
    Prisoner 849
    Join Date
    Jan 2010
    Posts
    895

    Default

    i don't really get why it is not called, if you have placed this in your gameinfo there shouldn't be a problem.

    i have used StartMatch myself, only then extending from UTGame and it worked without problems.

  3. #3
    Boomshot
    Join Date
    Oct 2007
    Location
    UK
    Posts
    2,211

    Default

    StartMatch is called as soon as the first player joins the game, as you can see by looking at GameInfo.PostLogin. However, this only happens if bDelayedStart is false, whereas is is true by default. Change that in the default properties and StartMatch will work as expected.

  4. #4
    Veteran
    Join Date
    Dec 2003
    Location
    Finland
    Posts
    5,996

    Default

    Quote Originally Posted by Mr Evil View Post
    StartMatch is called as soon as the first player joins the game, as you can see by looking at GameInfo.PostLogin. However, this only happens if bDelayedStart is false, whereas is is true by default. Change that in the default properties and StartMatch will work as expected.
    Nope, not working with bDelayedStart as false... PostLogin is called fine, but there it ends. Here's the full game info code I have (at Pastebin). It's not much, but still managed to get it stuck.

    EDIT: Here some log if of use:

    Code:
    [0002.76] Init: Client initialized
    [0009.42] Log: LoadMap: ..\BRGame\Maps\BRM-TestLevel_01.udk?Name=Player?Team=255?Game=BRGame.BR_Game
    [0009.46] DevMemory: Memory allocations reported by the OS: 250.07 MB (with 0.00 MB waste)
    [0009.48] Log: Game class is 'BR_Game'
    [0009.65] Log: Primary PhysX scene will be in software.
    [0009.65] Log: Creating Primary PhysX Scene.
    [0009.66] Log: Bringing World BRM-TestLevel_01.TheWorld up for play (0) at 2011.03.06-21.58.29
    [0009.66] ScriptLog: BR_Game_0/Event:PostBeginPlay -> PostBeginPlay done.
    [0009.66] Log: Bringing up level for play took: 0.160190
    [0009.66] ScriptWarning: Accessed None 'Profile'
            UIDataStore_OnlinePlayerData Transient.DataStoreClient_0:UIDataStore_OnlinePlayerData_0
            Function Engine.UIDataStore_OnlinePlayerData:OnLoginChange:0134
    [0009.66] ScriptWarning: Accessed None 'Profile'
            UIDataStore_OnlinePlayerData Transient.DataStoreClient_0:UIDataStore_OnlinePlayerData_0
            Function Engine.UIDataStore_OnlinePlayerData:OnLoginChange:0168
    [0009.66] ScriptLog: BR_Game_0/Event:PostLogin -> Begin PostLogin. bDelayedStart: False
    [0009.66] ScriptLog: BR_Game_0/Event:PostLogin -> PostLogin done.
    [0009.66] Log: ########### Finished loading level: 0.241134 seconds
    [0009.68] Init: Game engine initialized
    [0009.68] Log: Initializing Engine Completed
    [0015.52] Log: >>>>>>>>>>>>>> Initial startup: 15.52s <<<<<<<<<<<<<<<
    Last edited by musilowski; 03-06-2011 at 03:00 PM. Reason: Added log stuff.
    Also known as Rask — http://www.ottorask.com/

    UT3 Levels: CTF-Austere (MSU P3 5th place)
    UE3 Tutorials: From Textures To Materials In UE3 Complex Fire In UE3

  5. #5
    Redeemer
    Join Date
    Dec 2008
    Location
    Germany
    Posts
    1,226

    Default

    Actually I think what's going wrong here: you call super.PostLogin(); right? And in there (GameInfo::PostLogin()) epic calls StartMatch, which is GameInfo::StartMatch() NOT BR_Game::StartMatch(). Therefore it doesn't execute YOUR new function (and doesn't print the log) but the 'old' one from GameInfo.

    Add StartMatch() to your PostLogin and it should be called correctly...

  6. #6
    Veteran
    Join Date
    Dec 2003
    Location
    Finland
    Posts
    5,996

    Default

    That explains quite a bit. I somehow thought of Super as a kind of an import... I'll try to go around with what you said in mind. Thanks!
    Also known as Rask — http://www.ottorask.com/

    UT3 Levels: CTF-Austere (MSU P3 5th place)
    UE3 Tutorials: From Textures To Materials In UE3 Complex Fire In UE3

  7. #7
    Technical Writer - UDN
    Join Date
    Aug 2006
    Posts
    3,812
    Gamer IDs

    Gamertag: ffejnosliw

    Default

    That is not why it isn't being called. Functions called from parent classes don't execute the parent's version of that function. They execute the most derived version. Otherwise, you would always have to override every single function of every class to make sure your new functions got called.

    The reason it is not being called is because GameInfo does a check to see if bWaitingToStartMatch is true in PostLogin() before calling StartMatch(). GameInfo never sets that variable to true, though. It is expected that your gametype will do so at the appropriate time, as evident in the BeginState() event of UTGame's PendingMatch state. Or, as always, you can override the functionality and call Startmatch() whenever you want.

  8. #8
    Veteran
    Join Date
    Dec 2003
    Location
    Finland
    Posts
    5,996

    Default

    Quote Originally Posted by ffejnosliw View Post
    The reason it is not being called is because GameInfo does a check to see if bWaitingToStartMatch is true in PostLogin() before calling StartMatch(). GameInfo never sets that variable to true, though. It is expected that your gametype will do so at the appropriate time, as evident in the BeginState() event of UTGame's PendingMatch state. Or, as always, you can override the functionality and call Startmatch() whenever you want.
    bWaitingToStartMatch was the reason. Changed it to true in my own PostBeginPlay() and StartMatch() was called fine. Thanks!
    Also known as Rask — http://www.ottorask.com/

    UT3 Levels: CTF-Austere (MSU P3 5th place)
    UE3 Tutorials: From Textures To Materials In UE3 Complex Fire In UE3


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.