Time for action – Differentiating Kismet inputs
That's pretty easy to do actually, so let's do it! We'll have the Turn On input do what it's doing now, and the Turn Off input return the AwesomeWeaponUpgrade actors to their normal size and color.
We only need to change our
OnToggle
function to make this work, using theInputLinks
array:function OnToggle(SeqAct_Toggle Action) { if(Action.InputLinks[0].bHasImpulse) { MyMesh.SetScale(2.0); MyMesh.SetMaterial(0, BigMaterial); } else if(Action.InputLinks[1].bHasImpulse) { MyMesh.SetScale(MyMesh.default.Scale); MyMesh.SetMaterial(0, MyMesh.default.Materials[0]); } }
That's easy enough, but where do we get the numbers from for the
InputLinks
array index? If we look at theSeqAct_Toggle
class, we can see the answer:InputLinks(0)=(LinkDesc="Turn On") InputLinks(1)=(LinkDesc="Turn Off") InputLinks(2)=(LinkDesc="Toggle")
Compile the code with our new
OnToggle
function, then open the editor.Time for...