Arma 3: Event Handlers/addMissionEventHandler

From Bohemia Interactive Community
Revision as of 21:47, 31 March 2016 by Killzone Kid (talk | contribs) (format)
Jump to navigation Jump to search

Mission Event Handlers


Mission event handlers are specific EHs that are anchored to the running mission and automatically removed when mission is over.

Related Commands


handle1 = addMissionEventHandler ["Loaded",{playMusic "EventTrack03_F_EPB"}]; removeMissionEventHandler ["Loaded", handle1]; addMissionEventHandler ["HandleDisconnect",{diag_log _this}]; removeAllMissionEventHandlers "HandleDisconnect";


Class Description Arguments Since


Runs the EH code each frame in unscheduled environment. Client side EH only (presence of UI). Will stop executing when UI loses focus (if user Alt+Tabs for example). Usually used with drawIcon3D, drawLine3D.

Introduced with Arma 3 version 0.500.50


Triggered when mission ends, either using trigger of type "End", endMission command, BIS_fnc_endMission function or ENDMISSION cheat.

Introduced with Arma 3 version 0.500.50


Triggered when player disconnects from the game. Similar to onPlayerDisconnected event but can be stacked and contains the unit occupied by player before disconnect. Must be added on the server and triggers only on the server.

Override: If this EH code returns true, the unit, previously occupied by player, gets transferred to the server, becomes AI and continues to live, even with description.ext param disabledAI = 1;

Introduced with Arma 3 version 1.321.32


Triggered when mission is loaded from save.

  • saveType: String - save type, can be have following values:
    • "save" - custom save, achieved by pressing SAVE button in the pause menu
    • "autosave" - automatic checkpoint, saved using saveGame command
    • "continue" - saved when leaving a mission to the main menu

Introduced with Arma 3 version 0.500.50


Triggered when an entity is respawned.

  • newEntity: Object - respawned entity
  • oldEntity: Object - corpse/wreck

Introduced with Arma 3 version 1.551.55


Triggered when an entity is killed.

  • killed: Object - entity that was killed
  • killer: Object - the killer

Introduced with Arma 3 version 1.551.55