addMissionEventHandler: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
(removed Druid's note as outdated)
Line 8: Line 8:


| Adds mission event handler. Every event will create an array named ''_this'', which contains specific information about the particular event. Available mission event handlers:
| Adds mission event handler. Every event will create an array named ''_this'', which contains specific information about the particular event. Available mission event handlers:
<br/>"loaded"
<br/>'''"Loaded"'''
<br/>"ended"
<br/>'''"Ended"''' - Triggered when the mission is successfully ended. In variable ''_this'' is stored type of the end ("end1","end2", etc.).
<br/>"draw3D" 
<br/>'''"Draw3D"''' - It seems "Draw3D" mission EH is connected to your primary display. It will stop firing as soon as you Alt+Tab from the game and resume when you come back (unless Arma 3 client is launched with ''-window'' ''-nopause'' params). "Draw3D" does not fire at all on a dedicated server. |= Description
 
'''NOTE:''' It seems "Draw3D" mission EH is connected to your primary display. It will stop firing as soon as you Alt+Tab from the game and resume when you come back (unless Arma 3 client is launched with -window -nopause params). "Draw3D" does not fire at all on a dedicated server. |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 26: Line 24:




|x1= <code>_id = [[addMissionEventHandler]] ["ended",{_this [[exec]] "missionEnded.sqs"}];</code>|= EXAMPLE1  
|x1= <code>_id = [[addMissionEventHandler]] ["Ended",{_this [[exec]] "missionEnded.sqs"}];</code>|= EXAMPLE1  


____________________________________________________________________________________________
____________________________________________________________________________________________
Line 39: Line 37:
<dl class='command_description'>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on March 3, 2013 - 16:34
<dt class="note">'''[[User:Druid|Druid]]'''<dd class="note">There is only one type at this time:<br/>
'''ended''' - It is triggered when the mission is successfuly ended. In variable _this is stored type of the end ("end1","end2", etc.).


<!-- Note Section END -->
<!-- Note Section END -->

Revision as of 11:34, 12 March 2014

Hover & click on the images for description

Description

Description:
Adds mission event handler. Every event will create an array named _this, which contains specific information about the particular event. Available mission event handlers:
"Loaded"
"Ended" - Triggered when the mission is successfully ended. In variable _this is stored type of the end ("end1","end2", etc.).
"Draw3D" - It seems "Draw3D" mission EH is connected to your primary display. It will stop firing as soon as you Alt+Tab from the game and resume when you come back (unless Arma 3 client is launched with -window -nopause params). "Draw3D" does not fire at all on a dedicated server.
Groups:
Uncategorised

Syntax

Syntax:
addMissionEventHandler [type, command]
Parameters:
[type, command]: Array
type: String
command: Code or String - By default executed in missionNamespace
Return Value:
Number - The index of the currently added mission event handler is returned.

Examples

Example 1:
_id = addMissionEventHandler ["Ended",{_this exec "missionEnded.sqs"}];

Additional Information

See also:
removeMissionEventHandlerremoveAllMissionEventHandlers

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Bottom Section