Home Unreal Engine
The BRAWL² Tournament Challenge has been announced!

It starts May 12, and ends Sept 12. Let's see what you got!

https://polycount.com/discussion/237047/the-brawl²-tournament

Scaleform HUD and UScript Currency Node script; How to access? Help!!!!!!

Hello!

I have a simple Scaleform HUD set up:

http://i40.photobucket.com/albums/e235/RaptorMoonX/Scaleform_hud.png

I got the Health/Energy bar at the time working. I have no idea how to get the currency to increment/decrement for this HUD. Do I accomplish this in AS3 or in UDK? I will have Kismet Nodes set up in UDK to get this to work in my game. Here's what I have for code (including a UScript file called CurrencyNode.uc):

ActionScript:
  1. // Needed for the stage
  2. importflash.display.MovieClip;
  3. // Allows us to use Scaleform
  4. importscaleform.gfx.Extensions;
  5.  
  6. //Allows us to use the Event.ENTER_FRAME event listener
  7. importflash.events.Event;
  8.  
  9. // Declaring the Document class
  10. class Delta_hud extends MovieClip
  11. {
  12. // Variables that we will be using to show the
  13. // player's current and max health
  14. public static var currentHealth:int = 100;
  15. public static var maxHealth:int = 100;
  16. //Constructor will be called the first frame of the game
  17. function Delta_hud()
  18. {
  19. // Enables Scaleform
  20. Extensions.enabled = true;
  21. // Adds an event so that the Update function will
  22. // be called every single frame.
  23. addEventListener(Event.ENTER_FRAME,this.Update);
  24. }
  25. // Code that we want to run every frame of the game
  26. function Update(event:Event)
  27. {
  28. // Update our life's scale to reflect the current
  29. // ratio of currentHealth to maxHealth
  30. lifebar.scaleX = currentHealth/maxHealth;
  31. }
  32. }
This doesn't include the currency as I don't know how to get this into AS. Here is the CurrencyNode.uc code:
  1. // extend UIAction if this action should be UI Kismet Action instead of a Level Kismet Action
  2. class Delta_CurrencyNode extends SequenceAction;
  3.  
  4. var() int currencyAdd;
  5.  
  6. event Activated()
  7. {
  8. local Delta_Gametype rGame;
  9. local WorldInfo rWorld;
  10.  
  11. rWorld = GetWorldInfo();
  12. if( rWorld != none)
  13. {
  14. rGame = Delta_Gametype(rWorld.Game);
  15. if( rGame != none )
  16. {
  17. rGame.nCurrency += currencyAdd;
  18. }
  19. }
  20. }
  21.  
  22. defaultproperties
  23. {
  24. ObjName="Delta_CurrencyNode"
  25. ObjCategory="Team_Delta Actions"
  26. bCallHandler = false;
  27. }
How do I get this to work in AS and/or how do I tie this in via UScript (or Kismet) so that the currency node works in the Scaleform HUD? The HUD was created using the tutorial found in Mastering UDK Game Development (chapter 4) by John Doran. Any help would be greatly appreciated asap. Thank you! ^_^
Sign In or Register to comment.