Home Unreal Engine

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:
// 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;
        }
}
This doesn't include the currency as I don't know how to get this into AS. Here is the 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;
}
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.