Results 1 to 29 of 29
  1. #1
    MSgt. Shooter Person
    Join Date
    Apr 2006
    Location
    Cary, NC
    Posts
    78

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

    xCTFGame.UC

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

    Code:
    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 http://utforums.epicgames.com/showthread.php?t=584867 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:

    http://utforums.epicgames.com/showthread.php?t=585462

    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:

    Code:
    defaultproperties
    {
        MidGameMenuTemplate=UTUIScene_MidGameMenu'MidGameMenuModData.Menus.NewMidGameMenu'
    
    }
    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 Attached Files

  2. #2
    MSgt. Shooter Person
    Join Date
    Oct 2007
    Posts
    64

    Default

    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?
    Last edited by Catalyst; 12-13-2007 at 07:18 PM.

  3. #3

    Default

    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... :-) )

  4. #4
    Iron Guard
    Join Date
    Sep 2007
    Location
    Adelaide, South Australia
    Posts
    550

    Default

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

  5. #5
    MSgt. Shooter Person
    Join Date
    Aug 2006
    Location
    I came from earth
    Posts
    347

    Default

    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

  6. #6
    MSgt. Shooter Person
    Join Date
    Aug 2006
    Location
    Warrenville, IL - USA
    Posts
    218
    Gamer IDs

    Gamertag: jbizzler127

    Default

    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?
    Play UT2D - Turn UT into a sidescrolling fragfest!

  7. #7

    Default

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

  8. #8
    Veteran
    Join Date
    Sep 2006
    Location
    Newcastle, UK
    Posts
    6,971
    Gamer IDs

    Gamertag: ambershee

    Default

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

  9. #9

    Default

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

  10. #10
    MSgt. Shooter Person
    Join Date
    Oct 2007
    Posts
    240

    Default

    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.
    www.DAWGA.com

    UT3 RPG Invasion Server up, hit F10, "open dawga.com:8888" to join

  11. #11
    MSgt. Shooter Person
    Join Date
    Dec 2007
    Location
    Canada
    Posts
    38

    Question

    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.

  12. #12
    MSgt. Shooter Person
    Join Date
    Mar 2008
    Posts
    43

    Default

    What is a midgame menu?

  13. #13
    MSgt. Shooter Person
    Join Date
    Dec 2007
    Location
    Canada
    Posts
    38

    Default

    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??

  14. #14
    MSgt. Shooter Person
    Join Date
    Jan 2008
    Posts
    130
    Gamer IDs

    Gamertag: PC: FourEyes

    Default

    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?

  15. #15
    Skaarj
    Join Date
    Aug 2006
    Location
    Canada
    Posts
    9

    Default

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

    Thanks!

  16. #16

    Default

    Question?

    Is there any way we can extend UTUIScene_MidGameMenu class so we can add our code? Or can we do this another way?
    Yeap, nothing hare!
    I cant' splel eother.

  17. #17

    Default

    Superb tutorial. Everything worked for me. I also succeeded in changing the background, but what I'm interested in is changing the red background panel which holds all the information. I found the image in the UI_scenes_common package and copied it into my own package, but that didn't work. Do I have to include code? Or do I have to make my own widget? How do you do that anyways? I'll be posting my results soon.

  18. #18
    MSgt. Shooter Person
    Join Date
    Mar 2008
    Location
    Germany
    Posts
    95

    Default

    how do I know if this would work on PS3? I suppose it wouldn't right now...

  19. #19
    MSgt. Shooter Person
    Join Date
    Jan 2008
    Posts
    31

    Default

    Can this save any settings you change and automatically reload them next time you play the level?

    Ideally I'd like to do it with an ini file or something, but not sure if that's possible. It's just to control the visibility and collision of objects without having to go into the editor.
    Last edited by Flux101; 09-04-2008 at 11:12 AM.

  20. #20
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    79

    Default

    Quote Originally Posted by FourEyes View Post
    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?
    I am also having trouble getting this step to work; I've tried

    f:\games\ut3\binaries\UT3.exe editor

    as well as

    F:\games\UT3\Binaries\UT3.exe editor -useunpublished

    to no avail. It does compile without any warnings or errors though, and I do have: MidGameMenuMod.u as well as UTMidGameMenuMod.ini and UTMidGameMenuModData.ini being generated and placed properly.

  21. #21

    Default

    could we possibly get a tutorial on creating and customizing UIscenes? I done about 2 so far and still am puzzled about how some of the properties work and how to achieve certain tasks with it.

  22. #22

    Default

    Quote Originally Posted by FourEyes View Post
    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?

    In xTestMidGamePanel.uc, on the second (third) line, there is extra spaces between the ellipses. Removing the extra spaces enabled me to see xTestMidGamePanel in the editor.

    use:
    Code:
    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);
    }
    instead of :
    Code:
    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);
    }

  23. #23
    Skaarj
    Join Date
    May 2009
    Location
    Sweden
    Posts
    6

    Default

    Hi! Thank you for the tutorial. It's working fine for me. For the people who can't make it work remember to apply patch 1.4, i forgot to and that made me waste a day of work
    Last edited by PeerMeer; 05-12-2009 at 09:13 AM.

  24. #24

    Default

    is it possible to run functions from other classes from the tab page?

    meaning if I wanted my tab page to run a function in my controller class, is it possible?

    if so how do I go about aquiring the instigator that opened up the menu? anything will do controller, pawn, pri anything i can use to get to the controller class ...
    Released Games:
    -Fridge Raider
    -Laser Vault

    Upcoming Titles:
    -Raid
    -Epar

    Demo Reel 2011 (WIP):
    -Demo 2011 (WIP)

  25. #25

    Default

    figured it out, for anyone else wondering here is the code i used:

    Code:
        local UTPlayerController UTPC;
        local UTUIScene UTSceneOwner;
    
        UTSceneOwner = UTUIScene(GetScene());
    
        UTPC = UTSceneOwner.GetUTPlayerOwner();
    you can navigate to any class from there
    Released Games:
    -Fridge Raider
    -Laser Vault

    Upcoming Titles:
    -Raid
    -Epar

    Demo Reel 2011 (WIP):
    -Demo 2011 (WIP)

  26. #26
    MSgt. Shooter Person
    Join Date
    Feb 2009
    Location
    Australia
    Posts
    144

    Default

    I get a crash whenever i run the mod using the unpublished command line, havnt tried copying over to published though i doubt thatll help.
    Looking for a mod team? You're in luck. Check out our mod page.

  27. #27
    MSgt. Shooter Person
    Join Date
    Sep 2008
    Location
    Planet Andromeda, planning your annihilation
    Posts
    149

    Default

    As for the UIScenes in the main menu, I've been able to replace some of them with custom ones, but many seem to be hard-linked to default pages (which have missing textures and look really ugly BTW) through what would seem to be the .exe file. For example, I can't replace or modify the advanced video settings or the mutators tab pages/scenes using any combination of UnrealScript, ini's and int's. Every time I reference one of the scenes I've created, the game overrides my code and replaces it with the default one in either UIScenes_FrontEnd or UIScenes_ChrisBLayout.

  28. #28
    MSgt. Shooter Person
    Join Date
    Sep 2010
    Posts
    71

    Default

    Hi,
    I see that there haven't been any new post for a long time here; is that because it's outdated or because it works?
    Because I actually followed this tut, and in didn't work entirely for me: when I launch my game and open the MidGameMenu, I can see the newly created tabs and can click on them, but it looks like they never get the focus, as the display remains the same (meaning the Scoreboard). I checked in the ActivatePage(), but bActivate = true so I don't see why it's not working.
    Any ideas?

  29. #29

    Default

    Sorry, but I'm need help with the game unreal tournament 99'. the warrior walks to everywhere but forward not, the key W does not work, how I can fix it? I believe that something is not configured , but i don't know how to fix it. Thanks man.
    Last edited by nachotaz; 09-20-2012 at 12:56 PM.


 

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.