Announcement

Collapse
No announcement yet.

Scaleform HUD Tutorial Series

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

    I forgot to mention that mygetpc() is original getpc() function. This is how i've changed it to work.
    About the text fields, as i've written before, they don't work for me. I don't know why. The bar works fine and it shows the ammo.
    I'm working with August Beta. Maybe that's the problem. Maybe something has to be changed in line: AmmoTF.SetString("text", ""$UTWeapon(UTP.Weapon).AmmoCount);

    P.S. Does your ammo bar work?

    Comment


      not got an ammo bar, just using the text field to show ammo count. i also have a problem with the heath text field not going down to 0 when i die as well. its slightly annoying but at least it works.

      Comment


        my text fields don't work at all. i'm not sure why. i think we need help from someone more experienced then us

        Comment


          thank you to everyone in this thread for sharing information and error fixes
          and of course a big thanks to Grosie

          for those whos text doesnt work
          in flash, the dynamic text properties
          click character embedding..
          chose Numerals [0...9] (11 glyphs)

          EDIT:
          forgot to ask
          how do i get my lovely 3rd person cam back?
          with this hud its 1st person view for some reason, i left out bforcebehindview=false or made it true, no difference

          Comment


            Okay, so I'm getting an actionScript compiler error: "The class "myMovieClip" could not be loaded"

            I figure it's because I 'exported them for ActionScript' - which from what I can tell, doesn't actually create a .as file - but there's no class definition. So I go and define them all as xxx extends MovieClip, and get another error about Class.Register.

            So what the hell am I doing wrong? Are you guys getting AS compiler errors when you check 'export for actionscript'? Do I just ignore it?

            I've been at this for like 5 hours now, and I'm starting to go insane. Any help would be appreciated.

            Comment


              I got 2 Qs

              1. The HUD works just fine running out of the front end but not from the editor. Is there something I have to move over to get it to work from there?

              2. My health bar works just fine but my numbers do not change. They do show up but never change. Any ideas?

              Comment


                hello
                has anyone managed to get the escape menu working with this hud?
                any ideas why it doesnt work?

                Comment


                  Tegleg, I didn't try it out yet but go to page 6 of this thread and read post 57.

                  Comment


                    thanks but no that doesnt work
                    with this hud, as is, from the tutorial, pressing escape makes the game freeze.
                    with the solution you mentioned kobaltic, nothing happens at all when you press escape.
                    im trying to use the default escape menu.
                    im thinking i might be better hacking uthud to keep the functionality. (that way at least i will still have the logs and messages)
                    this is what iv done with the menu.

                    edit:
                    what would be great for everyone is a run through of how epic made their menu and hud (hint hint)
                    it the moment what i see when i look at their code is some kind of magic spell

                    Comment


                      For those having issue with the pause menu, here is some info I believe will help you:

                      1. UTGFxHudWrapper.uc declares the var PauseMenuMovie which is of type GFxUI_PauseMenu (GFxUI_PauseMenu.uc)
                      2. Inside UTGFxHudWrapper.uc The exec function ShowMenu() fires off TogglePauseMenu(). Being an exec function means it can be fired off using a keyboard press.
                      3. ShowMenu() is fired off by pressing Escape. This is established in DefaultInput.ini by setting the binding: .Bindings=(Name="Escape",Command="GBA_ShowMenu" in the Game Keyboard/Mouse Bindings section. This is put into UDKInput.ini as: Bindings=(Name="Escape",Command="GBA_ShowMenu") when built.
                      4. TogglePauseMenu() is where the magic happens, and the pause menu is created and displayed.

                      Hope this helps.

                      Comment




                        no errors in compiler (Yay and tyvm)

                        Game crashes on debug with
                        "couldn't spawn player controller of class none"

                        Hope it's obvious to someone : )

                        (in the info.uc file,
                        PlayerControllerClass=class'SFtutorialflash.SFplay ercontroller'
                        //calls player controller without needing .ini to call it?

                        Made sure all my names match, other than that I have no idea what I'm doing

                        Comment


                          I have managed to get the script to compile within the September build but I cant seem to get it to appear in game, I can manually open the file through kismet and I know that it knows where the file is but nothing I seem to do will make it appear in game, could someone take a look at my code to see if anything is wrong, I'm not that experienced with UnrealScript so I might be missing something obvious.

                          http://pastebin.com/puf4qtrG

                          Comment


                            Code:
                            class STGFxHUD extends GFxMoviePlayer;
                            
                            //Create a Health Cache variable
                            var float LastHealthpc;
                            
                            //Create variables to hold references to the Flash MovieClips and Text Fields that will be modified
                            var GFxObject HealthMC, HealthBarMC;
                            var GFxObject HealthTF;
                            
                            //  Function to round a float value to an int
                            function int roundNum(float NumIn) {
                             local int iNum;
                             local float fNum;
                            
                             fNum = NumIn;
                             iNum = int(fNum);
                             fNum -= iNum;
                             if (fNum >= 0.5f) {
                             return (iNum + 1);
                             }
                             else {
                             return iNum;
                             }
                            }
                            
                            //  Function to return a percentage from a value and a maximum
                            function int getpc(int val, int max) {
                             return roundNum((float(val) / float(max)) * 100.0f);
                            }
                            
                            //Called from STHUD'd PostBeginPlay()
                            function Init(PlayerController PC) {
                             //Start and load the SWF Movie
                             Start();
                             Advance(0.f);
                            
                             //Set the cahce value so that it will get updated on the first Tick
                             LastHealthpc = -1337;
                            
                             //Load the references with pointers to the movieClips and text fields in the .swf
                             HealthMC = GetVariableObject("_root.healthbar_mc");
                             HealthBarMC = GetVariableObject("_root.healthbar_mc.bar_mc");
                             HealthTF = GetVariableObject("_root.healthbar_mc.health_txt");
                            }
                            
                            //Called every update Tick
                            function TickHUD() {
                             local UTPawn UTP;
                            
                             //We need to talk to the Pawn, so create a reference and check the Pawn exists
                             UTP = UTPawn(PlayerOwner.Pawn);
                             if (UTP == None) {
                             return;
                             }
                            
                             //If the cached value for Health percentage isn't equal to the current...
                             if (LastHealthpc != getpc(UTP.Health, UTP.HealthMax)) {
                             //...Make it so...
                             LastHealthpc = getpc(UTP.Health, UTP.HealthMax);
                             //...Update the bar's xscale (but don't let it go over 100)...
                             HealthBarMC.SetFloat("_xscale", (LastHealthpc > 100) ? 100.0f : LastHealthpc);
                             //...and update the text field
                             HealthTF.SetString("text", round(LastHealthpc)$"%");
                             }
                            }
                            
                            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'STAssets.HUD.HudSwf'
                             //Just put it in...
                             bGammaCorrection = false
                            }
                            i am getting this error please tell me wat i'll do now???

                            Code:
                            Error, Redefinition of 'function getpc' differs from original; different number of parameters

                            Comment


                              http://forums.epicgames.com/showthre...light=GetPC%3F

                              people are happy to help you yaziii but try using search a bit more

                              Comment


                                thanx tegleg by the way i am new in this UDK so i have alots of problems so don't mind please and i am glad that people are happy from me.

                                Comment

                                Working...
                                X