Monday, September 17, 2012

HUD and Main Menu Update - Game Jam!

We now have a working HUD for the Jam, only it is not as clean as I would have liked it to be. In the three days I was working on it I couldn't figure out how the standard UDK HUD actually works, like what makes the ammo count go down in the SWF when you fire the gun in UDK. Anyway, I think we'll get it all figured out in our UI class this quarter. In the mean time I have a workaround using Kismet and a lot of Actionscript. The main menu has all of it's functionality, once I can put a specific function into our Jam's Player Controller class.

Here is my workaround in Kismet:
*Note: this is a very messy workaround with duplication in actions between AS3 and Kismet, but that was what it took to get the effects we wanted.

  • The main sequence where the sub-sequences and named variables are stored.

  • This sequence handles the main menu, as well as opening the HUD.

  • In this sequence, this will reduce the ammo count by 1 every time the gun is fired if the primary gun is not equipped , as well as setting the weapon to the default one once an alternate gun  runs out of ammo.

  • This sequence controls weapon switching, and receiving the call from the ReduceAmmo Sequence to change to the default weapon.

I ended up using quite a few named variables throughout the Kismet for the HUD. This allowed me to break the different function into their own sub-sequences for greater organization. One thing I learned about named variables is that they have to be in the main sequence in order to be used by the sub-sequences. This means that if I want to reference AmmoCount in my WepSelecting sub-sequence, but it is declared in my ReduceAmmo sub-sequence, it will not find the reference to it. To fix this I put all the named variables in the main sequence, which is accessed by both the ReduceAmmo and WepSelecting sub-sequences. I also learned about the 'Finish Sequence' and the 'Sequence Activated' Kismet nodes. These allow you to link nodes in one sub-sequence to another node in a different sub-sequence. 'Finish Sequence' acts as the 'Output' for the sequence while the 'Sequence Activated' acts as the 'Input'. Both of these nodes can be named to use as a reference when determining which Sequence 'Output' goes to which Sequence 'Input'.

Anyway, tonight after class we'll be putting together as much we can. Hopefully I'll be able to get the graphics for the main menu and the HUD tonight and implement them.


  1. WOO! FIRST!!!1!

    But seriously, you're awesome man!
    So glad to be on a team with you and the guys!

    Keep up the good work!

  2. Thanks Dave,

    It's been great working on this with everyone.