Thursday, September 15, 2011

Score - Progress!

Hello, again!  I was up very, very late the last few nights trying to get a score system integrated.  I knew of a few cheap ways to do it such as altering the game's core files, but I figured that would not be the best road to take, as I know it can screw a lot of things up.  So instead, I wound up doing this:

~Updated my game class (Which extends UTDeathMatch) with a function which gives score for each kill, overriding the original.

~Updated my PlayerController class to contain functions which keep track of the score that is defined within.  For instance, a very important function here is "GiveScore," which you'll hear about in a moment.

~I then, after investigating for the past few days, learned a lot about Kismet integration.  Using this knowledge I created my SequenceAction class, called "SeqAct_GiveScore".  This class essentially creates a kismet node from scratch, and the only values required for it are "Amount" and a target.  The target will obviously always be the player, and the amount can either be set within a textbox in Kismet or the node can be linked to a variable.

     Essentially, what's happening is two things.  First of all, I can use the "Score" variable quite easily within my code.  As long as I know its location, I can alter it however I want.  However, the important thing is that I can now, thanks to my SequenceAction class, affect the variable and manipulate it from within Kismet.  Why would I need to?  It's much easier on the engine to test for player collision with my pickup items in Kismet than the code, as the things are created in-engine, and not through the code. 

     Here is a shot of the scorebar in action:






     And here is a shot of the new kismet node being applied:

     This is a HUGE step and I can't wait to get things working even better!

No comments:

Post a Comment