Environmental Damage - KillZone Element
Environmental damage like fire or teargas that damage players, or even enemies in some cases, are easily set up using Area Trigger and Killzone elements.
Defining The Area
To define the area in which the damage should apply, place a Shape element and adjust the width, depth and height if needed. Multiple Shape elements can be used for more complex areas.
Set Up The Elements
Place a AreaTrigger element and link it to the Shape element. Either use the Manage Use Shape Element ID List button, or hold spacebar while clicking on the Shape element.
Using Shape elements for this is not actually required, however if more than one type of instigator (players, enemies, civilians, etc.) should be affected, multiple AreaTrigger elements are required since they can only use 1 type per trigger.
The area would need to be set up individually for each trigger element. Using Shape elements instead, the whole process only needs to be done once and any AreaTrigger element can just link to and use the Shapes.
Place a KillZone element, choose a damage type and have it get executed by the AreaTrigger.
Keep in mind that not every damage type is available to every instigator, more information on that can be found here.
Depending on who should get damaged, the AreaTrigger needs to be set up differently.
Player / Team AI
For players and team AI, set Trigger On to "both", Instigator to "player" or "ai_teammates" as well as Trigger Times to "0".
This will execute the KillZone every time someone enters the AreaTrigger, activating the damage effect. When leaving the AreaTrigger, the KillZone gets executed once again, deactivating the effect.
The Trigger Times set to "0" ensures that it can execute infinitely without disabling itself.
Enemies / Civilians
For enemies and civilians, it also depends on what damage type is set in the KillZone.
If the instigator should get affected instantly when entering, set the instigator to either "enemies" or "civilians". For Trigger On set it to "on_enter" and Trigger Times to "0".
If instead a random instigator should get picked with a delay in between, set Trigger On to "while_inside" and Trigger Times to "1".
Place a Toggle element and have it get executed by the KillZone element with a short delay, for example "2.0" seconds. Link the Toggle to the AreaTrigger and set the Set Trigger Times to "1".
Here are some extra steps to enhance your KillZone experience even further.
Effects And Sounds
The KillZone and AreaTrigger elements don't have any visualization that they deal damage when entering. Signal the player that the area is dangerous using PlayEffect elements playing, for example, teargas, fire or electric spark effects.
Additionally PlaySound elements can be used to add to the immersion. A list with sound IDs can be found here.
Simply execute the PlayEffect and PlaySound elements when the AreaTrigger gets enabled and tweak the timing if needed.
The AreaTrigger can be toggled on and off at any point during the heist to enable and disable getting damaged by it.
For example when cops fill a room on your level with teargas mid heist, or something gets lit on fire and later extinguished.