No announcement yet.

Tutorial: Custom Mid Game Menu

This is a sticky topic.
  • Filter
  • Time
  • Show
Clear All
new posts

    Tutorial: Custom Mid Game Menu

    This tutorial will go over the steps required to have a custom mid-game menu. Note, replacing the mid-game menu REQUIRES UT PATCH 1.1 to be installed. Without it this isn't possible. Also, I'll be building a sample mod while I go but you can easily incorporate this in to your current mods. Let's begin:

    Step 1: In your "..\My Documents\My Games\Unreal Tournament 3\UTGame\Src" folder create a new mod folder called "MidGameMenuMod" and inside that create your "Classes" folder.

    Step 2: Inside the classes folder, create 2 files.


    class XCTFGame extends UTCTFGame_Content;
    simulated function PostBeginPlay()
        `log("[XCTFGame] - Initialized and running");
    and xTestMidGamePanel.uc

    class xTestMidGamePanel extends UTTabPage;
    event bool ActivatePage( int PlayerIndex, bool bActivate, optional bool bTakeFocus=true )
        `log("[XCTFGame] - Our Page is Active");
        return Super.ActivatePage(PlayerIndex, bActivate, bTakeFocus);
    Step 3: Follow the instructions at this link and compile your mod. You should now have the file \MidGameMenuMod.u in your "Unpublished\CookedPC\Script" folder.

    Step 4: Time to create the content. Load the editor ("UT3.exe editor") and go to the generic browser. Find the package "UI_InGameHUD" and make sure it's fully loaded.

    Step 5: Switch to the log tab and type the following:

    obj savepackage file=C:\tmpdata package=UI_InGameHud

    You can find out more about this trick in this thread by Matt:

    Step 6: You can now duplicate the current mid game menu. Go back to the browser tab and expand UI_InGameHud and select the Menus Group. Select "MidGameMenu" from the list of objects. Right click and select Duplicate.

    Step 7: In the dialog that appears, change the package to "MidGameMenuModData" and edit New Name to say "NewMidGameMenu". Finally click OK.

    Step 8. You now have a new package in your browser called "MidGameMenuModData". Save this package to disk then double click on the NewMidGameMenu object to edit it.

    Step 9: Find the widget "TabControl" and expand it. Right click on widget in the Scene Tool and select "UTUITabControl" which will show a submenu with "Insert New Page" and "Remove Page". Select "Insert New Page".

    Step 10: The "Choose the type of page to add" dialog will appear. Expand the drop down until you see the entry for XTestMidGamePanel and select it. Then click OK.

    Step 11: This will create a panel in the scene, you will see the panel in the Scene Tools (called xTestMidGamePanel_0) but a bug will stop it from showing the tab in the current open scene. Don't worry about this right now.

    Step 12: Select the panel in the Scene Tools window and rename "xTestMidGamePanel_0" to "TestPage".

    Step 13: While it's selected go to the properties window and under Data expand ButtonCaption. Set the markup to "TEST".

    Step 14: close the scene editor.

    Step 15: Double click on the NewMidGameMenu object to edit it again. Bingo, your tab has appeared.

    Step 16: In the Scene Tools, browse back to TestPage. By default the Tab control will mark the tab as bHidden. In the properties window, uncheck it and add widgets to your new page.

    Step 17: Close the Scene editor and save the package. Then exit the editor.

    Step 18: Open xCTFGame.uc and add the following section to the end of the file:

    That creates the reference. BUT Before you can compile you have to do the following (due to a bug we haven't fixed yet)...

    Step 19: In your "..\My Documents\My Games\Unreal Tournament 3\UTGame" folder create a new folder called "Published" and inside "Published" create "CookedPC".

    Step 20: COPY (not move) MidGameMenuModData from your "Unpublished\CookedPC" directory to your "Published\CookedPC".

    Step 21: Recompile your code.

    Run the game "ut3 ctf-strident?game=MidGameMenuMod.XCTFGame -log -useunpublished"

    Your mid game menu should now have the TEST tab in your custom game type.

    I've attached the source and data to this project. Keep in mind that you can modify your copy of the mid game menu any way you would like.
    Attached Files

    Thanks very much for this!

    I'm currently trying to make some different changes to the MidGameMenu, specifically I want to replace the ScoreTab item in the TabControl to be an instance of my own class, whilst keeping all of the child windows intact. Is there a neat way to do this?


      Thanks Joe,

      I didn't know about the copy-to-published/recompile thing - that helps a lot!

      P.S. Feel free to post more tutorials! (especially on how to build and script up a multi-column UIList - hint, hint... :-) )


        +1 to the Multi-column List tutorial. It appears as though generic use for it has been 'disabled' through the use of natively coded classes that implement UIListElementProvider and UIListElementCellProvider.


          More tutorials.
          Also, release the content about ue3 from the udn.
          Ah c´mon you know you want to do it, c´mon c´mon dont be shy


            That is ridiculously complex. I hope it's a temporary fix. My guess is, if this is so hacky-weird, total conversions are out of the question right now?


              is there any chance to replace the mainmenu (like for a tc)?


                Yes. Just look at how UT3 deals with main menus and copy it


                  this is the most useful thread I have read here, thanks


                    How do I change the UISceneClass it is pointing to? or more specifically, how can I open the CommandMenu UIScene to see what widgets are being used? When I double click on it, it starts to open, but closes....So I never get to see it.


                      This tutorial works great. One question: my newly-created tabs behave differently than the default tabs: If I keep clicking the same tab button, then every 2nd click of the tab button, the tab's contents disappear. It appears to be showing, hiding, showing, hiding... How do I change the tab's behavior to be the same as the default tabs, i.e. if it's already clicked/showing, leave its contents showing? Thanks.


                        What is a midgame menu?


                          A midgame menu is the menu that comes up when you pause the game.

                          And I still haven't figured out why my tab content toggles on and off. Has no one else replaced their midgame menu??


                            Having a problem at step 10 as xTestMidGamePanel don't show up.

                            Have tried with both the script I wrote following this tutorial and the downloaded one. I also use -nohomedir, but I doubt it makes a difference as the editor finds complains about scripts being outdated when I have changed to the downloaded script.

                            anyone know why this might be?


                              This tutorial does not appear to work at all.
                              Doing it myself and following the steps does not work, and downloading your zip file and replacing the files and recompiling does not work.

                              Can someone put up a complete tutorial on how to create a custom UI?
                              (I mean the whole shebang, custom main menu, custom midgame, etc).