Time for action – Creating a custom SupportedEvent
We'll create a custom event called Picked Up.
Create a new file in
Development\Src\AwesomeGame\Classes
calledAwesomeSeqEvent_PickedUp.uc
.Write the following code in the new file:
class AwesomeSeqEvent_PickedUp extends SequenceEvent; defaultproperties { ObjName="Picked Up" ObjCategory="Awesome Game" bPlayerOnly=false }
Simple enough. Now we need to add this to the
SupportedEvents
of our AwesomeWeaponUpgrade class's default properties. In AwesomeWeaponUpgrade add this to the defaults:SupportedEvents.Add(class'AwesomeSeqEvent_PickedUp')
Now we can use it in the editor, but we need to trigger it. Let's rewrite our
Touch
function to add a new line. Change AwesomeWeaponUpgrade'sTouch
function to look like the following:event Touch(Actor Other, PrimitiveComponent OtherComp, vector HitLocation, vector HitNormal) { if(Pawn(Other) != none && AwesomeWeapon(Pawn(Other).Weapon) != none) { AwesomeWeapon(Pawn(Other).Weapon...