Time for action – Using variables in Kismet
One thing we might want to know from Kismet is the current level of the weapon the player is holding. We could use this information to control the spawning of weapon upgrades, for instance. Let's see if we can do that:
To do this, we'll create a new file in our
Development\Src\AwesomeGame\Classes
folder calledAwesomeSeqAct_GetWeaponLevel.uc
.Write the following code in the new file:
class AwesomeSeqAct_GetWeaponLevel extends SequenceAction; event Activated() { } defaultproperties { ObjName="Get Weapon Level" ObjCategory="Awesome Game" VariableLinks.Empty }
Now we'll need an UnrealScript variable to store the weapon level as well as a node that we can use in Kismet for it. First let's add the variable:
var int WeaponLevel;
Now let's add the variable link node. If we look in SequenceOp in UnCodeX, we can see that
VariableLinks
is an array of theSeqVarLink
struct. Inside that struct are a lot of variables, but we're only concerned about...