Announcement

Collapse
No announcement yet.

Scaleform HUD freezes player on test map and other Q's.

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

    Scaleform HUD freezes player on test map and other Q's.

    I created a Scaleform HUD by following the tutorial found in Chapter 4 of Mastering UDK Game Development by John Doran. I followed the tutorial (which has the user create a Scaleform HUD using Flash and Kismet). I followed it to the letter and was even able to compile my ActionScript. I created the Kismet by following the book. When I went to test the HUD, everything froze when I touched an obstacle (that was supposed to lower the player's energy). I'm attaching all of my files to this post and I would really appreciate any type of help with this.

    Question 2: I need to add my crosshair reticule to this HUD and it has to turn red when it hits an object that it's supposed to slow down or speed up. How in the world do I do this?

    Question 3: I have a currencynode.uc file that will allow the player to acquire and use coins (or whatever I decide on) to buy upgrades for a main weapon. How to I get the script to work with my Scaleform HUD?

    Please, any type of help would be really greatly appreciated. I've asked former school instructors (I graduated last year), but none have really dabbled in Scaleform. I've done Google searches, watched videos, and even tried the links listed on this forum (posted by Matt Voyle). This is really driving me batty as I'm not sure what I did wrong. Thank you!

    NOTE: There is a canvas HUD I made for placement that will show up in the map. Please ignore that. I couldn't get that to work either. Please help!!!!

    Files: https://www.dropbox.com/sh/fmh8jj9mxmikee8/WvTsPr9tDs

    #2
    Because you should not start it from kismet , if it's a HUD.

    you have to instantiate your hud movie from your hud class

    // GameMenu=new class'GFxMyMenu';
    // GameMenu.Init(class'Engine'.static.GetEngine().Gam ePlayers[GameMenu.LocalPlayerOwnerIndex]);
    // GameMenu.start();

    for instance this in postbegin play of your hud class

    This should be the declared object.

    var GFxMyMeny GameMenu; and it should be a class that extends of GFxMoviePlayer that it's pointing to a movie of the content browser.

    Comment


      #3
      i only see 3 files on the d/l list, none of them contain a upk, or a flash file, Delta_hud folder , no script either?
      ^6 so noone can help with these files i guess, but i suck at hud's so don't listen to me.

      - i do not think you can use scaleform in Editor; choose "play on PC" instead of PIE [did you try this?]

      Comment


        #4
        My apologies, but I forgot to list the rest of the files. My bad! ^^;;

        A couple of quick questions.

        1) Someone mentioned something about a Hudwrapper, init/start, and Tickhud. I'm a bit confused as to how these can help me.
        2) I need the health and currency to update to the Pawn.uc script (and I'm not sure what other scripts would need to be updated). How in the world do I do that if my Scaleform HUD is triggered only in Kismet?

        To make this understandable, here are the relevant scripts I have:

        CurrencyNode.uc
        Code:
        // extend UIAction if this action should be UI Kismet Action instead of a Level Kismet Action
        class Delta_CurrencyNode extends SequenceAction;
        
        var() int currencyAdd;
        
        event Activated()
        {
        	local Delta_Gametype rGame;
        	local WorldInfo rWorld;
        
        	rWorld = GetWorldInfo();
        	if( rWorld != none)
        	{
        		rGame = Delta_Gametype(rWorld.Game);
        		if( rGame != none )
        		{
        			rGame.nCurrency += currencyAdd;
        		}
        	} 
        }
        
        defaultproperties
        {
        	ObjName="Delta_CurrencyNode"
        	ObjCategory="Team_Delta Actions"
        	bCallHandler = false;
        }
        Gametype.uc
        Code:
        class Delta_Gametype extends UDKGame;//FrameworkGame;
        
        var int nCurrency;
        
        DefaultProperties
        {
        	// Variable for currency system 
        	nCurrency = 0;
        	
        	PlayerControllerClass = class'TeamDelta.Delta_PlayerController'
        	DefaultPawnClass = class 'TeamDelta.Delta_Pawn'
        	bDelayedStart = False
        	bRestartLevel = false
        
        	HUDType=class'TeamDelta.Delta_HUD'
        
        	// Disable the scaleform hud in UTGame. See: GenericPlayerInitialization
        	bUseClassicHUD = true
        	
        	Name='Default__DeltaGametype'
        
        	
        	
        
        }
        Original HUD/HUD.uc (several hundred lines of code):
        https://www.dropbox.com/s/26li5e54vcwf5d4/Delta_HUD.uc

        Pawn.uc (several hundred lines of code):
        https://www.dropbox.com/s/wqtslovb16bezms/Delta_Pawn.uc

        ActionScript for Scaleform:
        Code:
        // Needed for the stage
        importflash.display.MovieClip;
        // Allows us to use Scaleform
        importscaleform.gfx.Extensions;
        
        //Allows us to use the Event.ENTER_FRAME event listener
        importflash.events.Event;
        
        // Declaring the Document class
        class Delta_hud extends MovieClip
        {
        	// Variables that we will be using to show the
        	// player's current and max health
        	public static var currentHealth:int = 100;
        	public static var maxHealth:int = 100;
        	
        	//Constructor will be called the first frame of the game
        	function Delta_hud()
        		{
        			// Enables Scaleform
        			Extensions.enabled = true;
        			// Adds an event so that the Update function will
        			// be called every single frame.
        			addEventListener(Event.ENTER_FRAME,this.Update);
        		}
        	// Code that we want to run every frame of the game
        	function Update(event:Event)
        		{
        			// Update our life's scale to reflect the current
        			// ratio of currentHealth to maxHealth
        			lifebar.scaleX = currentHealth/maxHealth;
        		}
        }
        The Scaleform HUD:
        http://i40.photobucket.com/albums/e2..._scaleform.png

        Kismet Sequence:
        http://i40.photobucket.com/albums/e2...lta_kismet.png

        Contents of Delta_Package:
        http://i40.photobucket.com/albums/e2..._Package-1.png

        Do I have to update anything in the ActionScript too?

        Any help would be greatly appreciated so I can figure this out. Making a kids game featuring a robot named Tom. :3 Thank you!

        Comment


          #5
          i have not linked behaviour like this to a HUD before, however, it is possible to use your "currency.uc" to output to the HUD using Code like previously mentioned by "Neongho".
          - This implies writing a function to draw text, image or more on the canvas within your HUD class.
          - You can at least use the "var currency mycurrency;" declarations [in your item or currency class, whichever] to output a "'log"
           
          Spoiler

          - set a timer and a loop to check for the current amount of ummm currency
          Stuff that might help:
          * it sounds vaguely similar to displaying an ammo count on the screen,
          - maybe check to see if there is a flash tutorial in the udk content you get
          - .. or the code for the udk hud etc

          * 'Hourences' normally has an answer to refusing to code:
          http://www.hourences.com/tutorials-u...met-interface/

          - i haven't thought beyond that sorry, but i might have some time later to implement a display, unless someone else wishes to.
          - i wasn't going to implement this for a few weeks but well see what happens

          Comment


            #6
            BTW, in the Dropbox link in my first post, there is a pdf of a book I was using for this. I got all of my information for it from Project 4: Creating a Custom HUD. That's where I found the Kismet sequence and everything. There was no UScript involved. I have tried so many outdated tutorials that I'm starting to lose hope.

            Comment

            Working...
            X