Announcement

Collapse
No announcement yet.

Mastering a Scaleform GFx HUD (5 Part Series)

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

    #61
    Hi there, I FINALLY got it to work. I dug into the UT hud classes and saw the showmenu command was inside the UTHUDBase class (exec function showmenu() and all that jazz), so I added my exec functions to my hud base instead of the player controller and it works perfectly.

    Thanks a lot for the tutorials! I wasn't exactly trying to create a pause menu, but surely they helped a lot on what I was trying to do!

    Comment


      #62
      great! that is what I am looking for! thank U!

      Comment


        #63
        ?

        I am still trying to figure this out, how do I go about loading a movie from script? I know now that the objects in the .flv file are referenced from script, but what is the function or class that initially loads the movie(.flx file)?

        Comment


          #64
          You load the Flash .SWF file, not a .FLV movie.

          The loading is done using a GFx class extending GFxMovie. For example, in my case, a simple crosshair:

          Code:
          class MyGFxCrosshair extends MyGFxTweenableMoviePlayer;
          
          var GFxObject CrosshairMC;
          var GFxObject ReticuleMC;
          
          
          
          function Init(optional LocalPlayer player)
          {
           //Start and load the SWF Movie
           Start();
           Advance(0.f);
                   CrosshairMC = GetVariableObject("_root.crosshair");
                  ReticuleMC = GetVariableObject("_root.crosshair.reticule");
          
          }
          
          DefaultProperties
          {
           //this is the HUD. If the HUD is off, then this should be off
           bDisplayWithHudOff=false
           //The path to the swf asset we will create later
           MovieInfo=SwfMovie'MyGFxHud.MyGFxCrosshair'
           //Just put it in...
           bEnableGammaCorrection = false
          }
          Note that I'm extending the TweenableMoviePlayer class, because I am using animated motion tweens to make the cross appear and go away. Basically it goes like this, the "function Init" thing starts up the SWF movie, and inside that you create the references to the different objects as needed (for example if you're using a health bar or a bullet counter).

          Then you create the default properties and there you make the call to your previously-imported-into-UDK movie, with the "MovieInfo..." line.

          I hope this helps.

          Comment


            #65
            Yes!

            This helps immensely, as I didn't know how to make the file actually play, I am going to play around with this tonight and see if I can get an inventory system up.

            Thanks very much!

            Comment


              #66
              Having a little trouble

              So where do I upload the .SWF file to?

              Thanks for your time.

              Comment


                #67
                You save the flash file and flash movie under UDKGAME\Flash\whateveryoursubfolderis
                Then you import it just like any other asset into the content browser.

                Comment


                  #68
                  Extending UT classes

                  Can I use Scaleform without extending UT classes?

                  My project uses non-UT classes.

                  Oh yea, and I tried using the method above to load a .swf, I have the right paths and everything, but it's not working. I was thinking that the part---

                  function Init(optional LocalPlayer player)

                  ---might have to match the player variable in the project, or is my assumption incorrect?

                  Comment


                    #69
                    Won't work

                    It works, but I can't get it to access from script like you mention above. The only way it will work is with Kismet. I can use a "open movie" function in Kismet and it will load it, but if I try to do it from script it won't work.

                    Why? I will play around with it and try to get it to work.

                    Any help is greatly appreciated.

                    Comment


                      #70
                      You extend the base GFx Classes.

                      What are you trying to do exactly BTW? Displaying a HUD, a crosshair, a message box?
                      GFxHUD movies are loaded from your HUDBase class. Maybe this tutorial can help a little http://widff.co.uk/DevBlog/?p=1503

                      However, you should REALLY check the UTHUDbase class, and the scaleform tutorials on Youtube so you know how the flash HUD is loaded from code.

                      Comment


                        #71
                        Inventory

                        I am trying to create an inventory system, one where items are dragged onto a character and then an object(such as a helm) is equipped on the game character.

                        The thing is, I don't want to use any of the UT classes because, although they've already implemented a lot of stuff, the things I want to do I don't know how to implement with the UT classes, but the code that I have so far works great without extending any of the UT classes.

                        Comment


                          #72
                          Now I am having problems referencing a function in a class from a class extending GFXMoviePlayer. I have a scaleform movie that plays, and a button set up that runs a function that calls a function from the player controller.

                          When I click the button it says "Accessed None" then it lists my player controller. I believe I am not referencing the playercontroller correctly, so what is the proper method from a class extending GFXMoviePlayer?

                          Comment


                            #73
                            Originally posted by LordNelson7 View Post
                            Now I am having problems referencing a function in a class from a class extending GFXMoviePlayer. I have a scaleform movie that plays, and a button set up that runs a function that calls a function from the player controller.

                            When I click the button it says "Accessed None" then it lists my player controller. I believe I am not referencing the playercontroller correctly, so what is the proper method from a class extending GFXMoviePlayer?
                            I think it would be something like this:

                            local PlayerController PC;
                            local MyCustomPlayerController MCPC;

                            PC = GetPC();
                            MCPC = MyCustomPlayerController(PC);

                            where MyCustom... is your custom class that extends PlayerController or UTPlayerController

                            Comment


                              #74
                              When is the Mini Map tutorial? I am pretty sure that is most struggling to get working (custom wise).

                              Comment


                                #75
                                Unfortunately, I haven't had the time to make a minimap tutorial. However, the minimap that ships with UDK provides everything that is needed to learn how to build your own. You just have to get in there and reverse engineer the code and Flash files.

                                Comment

                                Working...
                                X