addMissionEventHandler: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (link to eh page) |
m (rewrote example (removed exec/sqs...); rephrased 'ended' description) |
||
Line 9: | Line 9: | ||
| 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"''' - Triggered when the mission is successfully ended. | <br/>'''"Ended"''' - Triggered when the mission is successfully ended. The variable ''_this'', stores the type of the ending ("END1","END2", "LOSER", etc.). | ||
<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. | <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. | ||
<br/>'''"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. For more info: [http://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDisconnect HandleDisconnect] |= Description | <br/>'''"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. For more info: [http://community.bistudio.com/wiki/Arma_3:_Event_Handlers#HandleDisconnect HandleDisconnect] |= Description | ||
Line 25: | Line 25: | ||
|x1= <code>_id = [[addMissionEventHandler]] ["Ended",{_this [[ | |x1= <code>// A script could be executed to stop custom scripts graciously, or save progress & stats, for example: | ||
_id = [[addMissionEventHandler]] ["Ended",{ _this [[execVM]] "missionEnded.sqf" }];</code>|= EXAMPLE1 | |||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ |
Revision as of 18:24, 24 October 2014
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. The variable _this, stores the type of the ending ("END1","END2", "LOSER", 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.
"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. For more info: HandleDisconnect - 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:
// A script could be executed to stop custom scripts graciously, or save progress & stats, for example: _id = addMissionEventHandler ["Ended",{ _this execVM "missionEnded.sqf" }];
Additional Information
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