Time for action – Using handler functions
We're going to take a rocket ship to goofy town on this one. The easiest way to learn about handler functions is to use an already existing Kismet action, so we're going to use the Toggle action on our AwesomeWeaponUpgrade actors to see how they work. To let us know that it's working, we're going to make the weapon upgrade actors change the size and color when the toggle's handler function is called on them:
Open
AwesomeWeaponUpgrade.uc
in ConTEXT.The first thing we need to do is give ourselves access to the static mesh so we can change its size and color. Let's add a variable to reference it:
var StaticMeshComponent MyMesh;
Now let's change the static mesh part of the default properties to add a line:
Begin Object Class=StaticMeshComponent Name=PickupMesh StaticMesh=StaticMesh'UN_SimpleMeshes.TexPropCube_Dup' Materials(0)=Material'EditorMaterials.WidgetMaterial_Y' LightEnvironment=MyLightEnvironment Scale3D=(X=0.125...