Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel

Difference between revisions of "User:Wormbo/DamageTriggerMover"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Created page with '{{infobox class |game=UT2004 |engine=UE2 |custom=yes |parent1=Mover |parent2=Actor |parent3=Object }} This Mover subclass replaces the logic for damage-triggering the mover with ...')
 
m (not just UT2004)
 
Line 1: Line 1:
 
{{infobox class
 
{{infobox class
|game=UT2004
 
 
|engine=UE2
 
|engine=UE2
 
|custom=yes
 
|custom=yes

Latest revision as of 01:49, 18 November 2009

UE2 Object >> Actor >> Mover >> DamageTriggerMover (custom)

This Mover subclass replaces the logic for damage-triggering the mover with the ability to trigger a generic event when the mover is damaged.

Properties

Property group 'Mover' (redefined from Mover)

bDamageTriggered

Type: bool

Not used.

DamageThreshold

Type: float

Minimum amount of damage required to trigger the event.

Property group 'MoverEvents'

DamageEvent

Type: name

This event will be triggered when the mover is damaged.

Usage

Download DamageTriggerMover.zip and extract it to your UT2004\System directory. Either load DamageTriggerMover.u in the Actor Browser or add DamageTriggerMover to your EditPackages list. You will be able to place this type of mover by right-clicking the mover icon in the UnrealEd toolbox.

The other way is manually creating a subclass of Mover in myLevel and compiling the following code, which should be compatible with almost all Unreal Engine 2 games.

class DamageTriggerMover extends Mover;
 
 
//=============================================================================
// Variables
//=============================================================================
 
var(MoverEvents) name DamageEvent;
var() const editconst string Build;
 
 
/**
Called when the mover takes damage. (duh...)
*/
event TakeDamage(int Damage, Pawn EventInstigator, vector HitLocation, vector Momentum, class<DamageType> DamageType)
{
  if (Damage >= DamageThreshold)
    TriggerEvent(DamageEvent, Self, EventInstigator);
}