How to add a DamageTrigger

Prerequisites:
The Basics

Summary:
If you'd like to set up areas of your map which will poison, shock, burn, or irradiate the player or NPC's, you've come to the right place, you sick puppy. :)

NOTE: There is an alternative to using a DamageTrigger, which may be more appropriate, depending on what you're doing.  If you need to define a very precise region for the "pain", it may be better to use a Pain Zone.  DamageTrigger's only work within a circular region, but they work better with path nodes and are a little easier to set up.  Pain Zones let you define a pain area based on an area of your level geometry.  See How to add Pain Zones for more information.

 

1. Add a DamageTrigger item

Under Actor -> Triggers -> Trigger, select DamageTrigger, and add one to your map where you want the center of your pain area to be.

 

2. Set properties

Pull up the DamageTrigger's properties, and expand the DamageTrigger category.

Set the DamageAmount to how much damage occurs per "hit", the damageInterval to how many seconds between damage "hits", and bConstantDamage to False if you just want a one-time damage hit.  Most of the time you'll want bConstantDamage to be True I would think.

As described in the SDK docs, to set up which type of damage to dish out, set the DamageType to one of these values: Shot, Exploded, TearGas, PoisonGas, HalonGas, Radiation, Flamed (catches player on fire), Burned, Shocked, NanoVirus, EMP, Drowned, or Stunned.  This will affect which damage icons appear on the player's HUD.  NOTE: it appears that NanoVirus was never implemented as it seems to have no effect.

Here are some of the common DamageType values and the corresponding HUD icons that the player will see:

Shocked
EMP
Burned
PoisonGas
Drowned, HalonGas
Radiation

If you'd like the DamageTrigger to also cause damage to NPC's, you'll need to set the Trigger -> TriggerType to TT_PawnProximity.  That will allow any type of pawn to receive damage.  If you'd like to control exactly which type of pawn will receive damage, you can use a TriggerType of TT_ClassProximity along with a ClassProximityType value to define what type of class will receive damage.

 

3. Add cosmetic effects (optional)

To be fair, you might want to provide the player some sort of audio and/or visual clue to go with your Pain Zone.  Sparks, lightning bolts, and/or electrical sound effects would be good things to include if you have DamageType set to Shocked, for example.  Many of the damage types go well with one or more particle generators.  If you want add one to your map, they are available under Actor -> Effects.

If you have your DamageType set to PoisonGas, you might set the ParticleGenerator -> particleTexture property to one of the properties in the Effects texture package, such as Gas_Poison or Gas_Poison_A.  I'll eventually do a separate tutorial on particle generators, but for now you can play with the settings or find some examples in the existing Deus Ex maps.

Rebuild your geometry with F8, save your level, and feel some pain!


Back to main page