Can Take Damage (Kismet Conditional Node)
For all you people supplying Kismet damage, via touching some actor or whatnot, running a proper CanTakeDamage check will make sure you don't hurt the player unfairly, or kill them in the span of a second! Works well with using Modify Health as a damage dealer.
For use within Kismet, usually before a Modify Health to deal damage to a player on some event. Found under the Combat section in the Conditions pop-up tab in Kismet.
bWorld - Is the damage caused by the world? (AKA: no actor) Ignores most damage invulnerabilities, such as being in a shop.
DamageSource - Who is supplying the damage. If the actor is an enemy, they will not be allowed to deliver damage if paused, in cinematic mode, or talking.
DamageAmt - How much damage to check to deal. An example is the player cannot be hurt while in the shop menu, UNLESS the damage is 4 or greater.
As an example, typical actors that deal damage, such as sawblades, run their check as CanTakeDamage(false, self, 1), meaning it's not caused by the world, the damage source would be that actor, and it checks for 1 damage.
/** * * Copyright 2012-2015 Gears for Breakfast ApS. All Rights Reserved. */ class Ink_SeqCond_CanTakeDamage extends SequenceCondition; var() bool bWorld; var() Actor DamageSource; var() int DamageAmt; var Array<Actor> Targets; event Activated() { local bool bAllow; local Hat_Pawn PTarget; local int i; bAllow = false; for (i = 0; i < Targets.Length; i++) { PTarget = None; if (Hat_Pawn(Targets[i]) != None) PTarget = Hat_Pawn(Targets[i]); else if (Controller(Targets[i]) != None) PTarget = Hat_Pawn(Controller(Targets[i]).Pawn); if (PTarget == None) continue; if (PTarget.CanTakeDamage(bWorld, DamageSource, DamageAmt)) { bAllow = true; break; } } OutputLinks[bAllow ? 0 : 1].bHasImpulse = true; } defaultproperties { ObjName="Can Take Damage (Insert Mod Name Here)" ObjCategory="Combat" OutputLinks(0)=(LinkDesc="True") OutputLinks(1)=(LinkDesc="False") VariableLinks(0)=(ExpectedType=class'SeqVar_Object',LinkDesc="Target",PropertyName=Targets) VariableLinks(1)=(ExpectedType=class'SeqVar_Bool',LinkDesc="World Damage",PropertyName=bWorld) VariableLinks(2)=(ExpectedType=class'SeqVar_Object',LinkDesc="Source",PropertyName=DamageSource) VariableLinks(3)=(ExpectedType=class'SeqVar_Int',LinkDesc="Amount",PropertyName=DamageAmt) }