Announcement

Collapse
No announcement yet.

getting my menu to do what its supposed to...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    getting my menu to do what its supposed to...

    my code says:
    if (Sender == b_PlayLocal)
    {
    // then i want to run my customized gametype EvacMatch(which extends deathmatchx)
    //for the time being i am doing this which i dont want
    Controller.OpenMenu(Controller.GetInstantActionPag e());
    }

    this is in my 'EvacMainMenu'

    anyone know how i can just play my gametype?

    thnx in advance

    #2
    Did you try looking at how epic pulls it off? It only involves a few functions. Try a search for GetMapURL inside the interface classes (UT2K4Tab_MainMP, UT2K4Tab_MainSP, UT2K4Tab_MainBase). Essentially they get a URL to the map, and add the gametype on the end (you'll probably have to hard code this), then use a console command to send the player there.

    Comment


      #3
      follow up question...

      thanks. I took care of the console command stuff, but i still dont understand how the gametype is added to the map...
      i looked over the interface classes and i see gametypeinit() which is called when you choose a gametype but i dont see the connection. Any chance you could elaborate?

      thanks again....

      Comment


        #4
        Somewhere in gametype init it sets the gametype to a variable. When you press play, after you have chosen a map, it recalls that variable and sticks it on the gametype. If you're using your own menu system, and not adding your gametype to the UT2004 menus, you will probably have to hard code your gametype, no big deal. They do it that way so mod makers can easily add their gametype into the menus and it will still work. Nothing to be concerned about if youre not modding.

        Comment


          #5
          thanks again bonehed. although i havent solved my current problem, ive learned alot of little options/features for my menu.

          still (sorry Noob here ), by hardcoding i assume you mean assign the gametype in my menu

          function bool ButtonClick(GUIComponent Sender)
          {
          if (Sender == b_Play)
          {
          //Controller.LastGameType = PedEvac.EvacuationSimType;
          Controller.OpenMenu(Controller.GetServerBrowserPag e());
          }

          the piece of code that is commented is where my only error occurs (obv.). The way ive seen epic do it (correct me if im wrong)is they have menus that store the gametype and according to that they open the correct maplist. I dont see the where they bind the gametype to the map. I also am interested in the CacheManager.GameRecord....

          Comment


            #6
            Ugh. I remember why I hated doing the maplist for our mod, lol.

            Okay, I went through the code a bit and found this:

            UT2K4GamePageBase.uc:

            Code:
            var() editconst noexport UT2K4Tab_MainBase          p_Main;
            ......
            PrepareToPlay(out string GameURL, optional string OverrideMap)
            ..
            	// Append the gametype
                GameURL $= "?Game="$p_Main.GetGameClass();
            ....
            UT2K4Tab_MainBase.uc:

            Code:
            function string GetGameClass()
            {
                return CurrentGameType.ClassName;
            }

            CurrentGameType gets set in subclasses (UT2K4Tab_MainSP, and UT2K4Tab_MainMP) in InitGameType() in a really hacky way (it stores a LastGameType in the GUIController, which is set in InternalOnChange() in UT2K4Tab_GameTypeBase.uc). So what you might want to do is hard code the area in PrepareToPlay above where it says "?Game=$p_Main.GetGameClass()" to say "?Game=MyPackage.MyGameInfo". Or store it in a variable, or whatever you want to do. This is the relevant area you need to "fix" (or break, depending on how you like to think of it) to get your gametype in there. You can also dump off the mutators section and other parts its adding if you dont need them. You can always check the travel string in your log, it looks like this:

            Log: Browse: EE-Test-GameScripting?Game=ee_Game.eeSinglePlayer?Name=Amb er?Class=Engine.Pawn?Character=Skrilax?team=0
            Whew, what a ride! Menus suck, lol. All hail the menu guru's.

            Comment


              #7
              things are looking real good...
              mad props bonehed

              Comment


                #8
                in project goldeneye we use :-

                //single player version
                if (Sender == b_start)
                {
                PlayerOwner().ConsoleCommand ("START"@V_Level$".ut2?quickstart=true?TeamScreen= false?GoalScore=1?NumBots=0?savegame="$GP.PackageN ame);
                return true;
                }

                // multiplayer version

                if (Sender == B_Start)
                {
                PlayerOwner().ConsoleCommand ("OPEN"@V_Level$".ut2?Quickstart=false?TeamScreen= False?AllowThrowing=False?AllowBehindView=True?Cha racter="$V_Char$"?FriendlyFire=0.0?FragLimit="$V_F ragLimit$"?Game=Goldeneye.Goldeneye?GamePassWord=? GameRules=?GameSpeed=1.0?GoalScore="$V_FragLimit$" ?MaxLives=?MaxPlayers="$V_MaxPlayers$"?MaxSpectato rs=2?MinPlayers="$V_MinPlayers$"?NumBots="$V_Numbo ts$"?Password=?Timelimit="$V_GameLength$"?savegame ="$Multiplayer);
                return true;
                }

                notice most of its a string

                Comment

                Working...
                X