Respirator Effects - Theseus-Aegis/MissionTemplate GitHub Wiki

This page will explain the usage of the Respirator Effects function.


/*
 * Author: Alganthe, Mike
 * Specified masks protect from a contamination zone while providing HUD/Sound effects.
 * Requires a marker covering an area named for damage to take effect. Can be used for multiple marker zones.
 * Provides Burn damage on Head/Torso if inside a zone without a mask.
 * Markers array provided will be converted into GVAR(respiratorMarkers) so it can be edited after mission start.
 *
 * Call from initPlayerLocal.sqf
 *
 * Arguments:
 * 0: Markers <ARRAY> (default: [])
 * 1: Damage Per Tick <NUMBER> (default: 0.15)
 * 2: Damage Tick Rate <NUMBER> (default: 10)
 * 3: Use Additional Effect <BOOL> (default: false)
 *
 * Return Value:
 * None
 *
 * Example:
 * [["MyMarker1", "MyMarker2"]] call MFUNC(respiratorEffects)
 * [["MyMarker"], 0.6, 5, true] call MFUNC(respiratorEffects)
 */

Usage

This function adds an overlay and sound effects when wearing gas masks from contact DLC. It only functions once the mask is equipped.

This function takes an array of markers which are dangerous zones, only within these zones will you take damage without a respirator, if you only want the mask effect but no damage simply provide no marker areas to the function.

This function deals Burn damage to the Head/Torso.

If you wanted a visual area for these zones it works well with the Contamination Gas function.

The selection of masks can be changed mid-mission or beforehand in initPlayerLocal.sqf
(Note: classnames placed here must be lower case.)

MGVAR(respiratorMasks) = ["g_airpurifyingrespirator_01_f"];

This would overwrite the old list and only allow one type of mask to work. Any facewear can be used as a mask and the list can be updated at any point during the mission.

Additionally the mask sounds can be disabled by using

ace_player setVariable ["TAC_Mission_enableMaskSounds", false];

The markers array can also be edited on the fly by editing MGVAR(respiratorMarkers).

Call from initPlayerLocal.sqf

Example:

[_player, ["marker_1", "marker_2", "marker_3"]] call MFUNC(respiratorEffects);
⚠️ **GitHub.com Fallback** ⚠️