Difference between revisions of "Arma 3: Event Handlers/addMissionEventHandler"

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "WIP")
 
(DEDICATED PAGE)
Line 1: Line 1:
WIP
+
<!-------------------------------------------------------------------------------------->
 +
== addMissionEventHandler ==
 +
 
 +
Mission event handler, always executed on the computer where it was added.
 +
 
 +
Commands:
 +
* [[addMissionEventHandler]]
 +
* [[removeMissionEventHandler]]
 +
* [[removeAllMissionEventHandlers]]
 +
 
 +
'''Example:'''
 +
addMissionEventHandler ["Loaded",{[[playMusic]] "EventTrack03_F_EPB";}]
 +
 
 +
 
 +
{| class="wikitable sortable"
 +
! Class
 +
! class="unsortable" | Description
 +
! class="unsortable" | Arguments
 +
! Since
 +
 
 +
 
 +
|-
 +
| <!-- Title -->
 +
==== Draw3D ====
 +
| <!-- Description -->
 +
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]].
 +
| <!-- Arguments -->
 +
| <!-- Since -->
 +
{{GVI|arma3|0.50}}
 +
|-
 +
| <!-- Title -->
 +
==== Ended ====
 +
| <!-- Description -->
 +
Triggered when mission ends, either using trigger of type "End", [[endMission]] command, [[BIS_fnc_endMission]] function or ENDMISSION cheat.
 +
| <!-- Arguments -->
 +
* endType: [[String]] - mission end type. Used in [[Debriefing]] among other things.
 +
| <!-- Since -->
 +
{{GVI|arma3|0.50}}
 +
 
 +
|-
 +
| <!-- Title -->
 +
==== HandleDisconnect ====
 +
| <!-- Description -->
 +
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.
 +
| <!-- Arguments -->
 +
* unit: [[Object]] - unit formerly occupied by player
 +
* id: [[Number]] - same as _id in [[onPlayerDisconnected]]
 +
* uid: [[String]] - same as _uid in [[onPlayerDisconnected]]
 +
* name: [[String]] - same as _name in [[onPlayerDisconnected]]
 +
'''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;''
 +
| <!-- Since -->
 +
{{GVI|arma3|1.32}}
 +
 
 +
|-
 +
| <!-- Title -->
 +
==== Loaded ====
 +
| <!-- Description -->
 +
Triggered when mission is loaded from save.
 +
| <!-- Arguments -->
 +
* 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
 +
| <!-- Since -->
 +
{{GVI|arma3|0.50}}
 +
 
 +
|-
 +
| <!-- Title -->
 +
==== EntityRespawned ====
 +
| <!-- Description -->
 +
Triggered when an entity is respawned.
 +
| <!-- Arguments -->
 +
* newEntity: [[Object]] - respawned entity
 +
* oldEntity: [[Object]] - corpse/wreck
 +
 
 +
| <!-- Since -->
 +
{{GVI|arma3|1.55}}
 +
 
 +
|-
 +
| <!-- Title -->
 +
==== EntityKilled ====
 +
| <!-- Description -->
 +
Triggered when an entity is killed.
 +
| <!-- Arguments -->
 +
* killed: [[Object]] - entity that was killed
 +
* killer: [[Object]] - the killer
 +
 
 +
| <!-- Since -->
 +
{{GVI|arma3|1.55}}
 +
 
 +
|}

Revision as of 21:10, 31 March 2016

addMissionEventHandler

Mission event handler, always executed on the computer where it was added.

Commands:

Example:

addMissionEventHandler ["Loaded",{playMusic "EventTrack03_F_EPB";}]


Class Description Arguments Since


Draw3D

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

Ended

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

HandleDisconnect

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

Loaded

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

EntityRespawned

Triggered when an entity is respawned.

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

Introduced with Arma 3 version 1.551.55

EntityKilled

Triggered when an entity is killed.

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

Introduced with Arma 3 version 1.551.55