Scripted Event Handlers – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "{{cc|//" to "{{cc|")
(Add Arma 3 Contact Scripted Event Handler names until more details)
 
(15 intermediate revisions by 5 users not shown)
Line 1: Line 1:
= Scripted Event Handlers =
{{TOC|side}}
 
 
== Description ==
 
Scripted Event Handlers are triggered by some of BI's modules and functions. When triggered any code registered for one of these events via [[BIS_fnc_addScriptedEventHandler]] will be executed.
Scripted Event Handlers are triggered by some of BI's modules and functions. When triggered any code registered for one of these events via [[BIS_fnc_addScriptedEventHandler]] will be executed.
All the events exists as variables within a namespace, whether this is one of the main [[Namespace]]s like [[missionNamespace]] or [[uiNamespace]] or it could be a specific namespace like a [[Group]] or [[Object]] etc.
All the events exists as variables within a namespace, whether this is one of the main [[Namespace]]s like [[missionNamespace]] or [[uiNamespace]] or it could be a specific namespace like a [[Group]] or [[Object]] etc.
The event also has a set of parameters passed to the executed code.
The event also has a set of parameters passed to the executed code.
You can even implement your own scripted eventHandlers by using [[BIS_fnc_callScriptedEventHandler]].
You can even implement your own scripted eventHandlers by using [[BIS_fnc_callScriptedEventHandler]].
For all other available Event Handlers, see [[Arma 3: Event_Handlers]].
For all other available Event Handlers, see [[Arma 3: Event Handlers]].


{{TOC|subtoc|content=
* 1. {{Link|#Functions}}
* 2. {{Link|#Examples}}
* 3. {{Link|#Events}}
* 4. {{Link|#{{Name|arma3contact}} Events}}
}}


== Related Commands ==
 
== Functions ==


* [[BIS_fnc_addScriptedEventHandler]]
* [[BIS_fnc_addScriptedEventHandler]]
Line 21: Line 24:
== Examples ==
== Examples ==


<code>[<nowiki/>[[missionNamespace]], "arsenalOpened", {
=== Subscribe ===
[[hint]] "Player opened the Arsenal"; {{cc|Hint message to the player when he opens the Arsenal}}
 
}] [[call]] [[BIS_fnc_addScriptedEventHandler]];</code>
<sqf>
[missionNamespace, "localPlayerNearFourArmedRobot", {
hint "Hello there";
}] call BIS_fnc_addScriptedEventHandler;
</sqf>
 
<sqf>
[missionNamespace, "arsenalOpened", {
hint "Player opened the Arsenal"; // hint message to the player when he opens the Arsenal
}] call BIS_fnc_addScriptedEventHandler;
</sqf>
 
=== Trigger ===
 
<sqf>
waitUntil { sleep 1; player distance _GG < 10 };
[missionNamespace, "localPlayerNearFourArmedRobot", [player, _GG]] call BIS_fnc_callScriptedEventHandler;
</sqf>




Line 29: Line 49:


This is a list of all available scripted events that exist through BI's functions and modules.
This is a list of all available scripted events that exist through BI's functions and modules.
Each event is listed under the system that calls them whether this be a specific function or a module. List last updated for {{GVI|arma3|1.98}}
Each event is listed under the system that calls them whether this be a specific function or a module. List last updated for {{GVI|arma3|2.10}}


{| class="wikitable"
{| class="wikitable align-left"
|-
|- class="align-center"
! Event namespace
! Event namespace
! Event name
! Event name
! Event passed parameters
! Event passed parameters
|-
|-
! colspan="3" style="text-align: left" | Player opens pause menu
! colspan="3" |
=== EG Spectator Display ===
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "RscDisplayEGSpectator_OnCursorObjectFocused"
| <sqf>params ["_object"];</sqf>
|-
| <sqf>missionNamespace</sqf>
| "RscDisplayEGSpectator_OnCursorObjectUnfocused"
| <sqf>params ["_object"];</sqf>
|-
| <sqf>missionNamespace</sqf>
| "RscDisplayEGSpectator_OnFocusChanged"
| <sqf>params ["_newFocus"];</sqf>
|-
| <sqf>missionNamespace</sqf>
| "RscDisplayEGSpectator_OnUiVisibilityChanged"
| <sqf>params ["_isVisible"];</sqf>
|-
| <sqf>missionNamespace</sqf>
| "RscDisplayEGSpectator_MapStateChanged"
| <sqf>params ["_isMapVisible"];</sqf>
 
|-
! colspan="3" |
=== Player opens pause menu ===
|-
| <sqf>missionNamespace</sqf>
| "OnGameInterrupt"
| "OnGameInterrupt"
| [_display]
| <sqf>params ["_display"];</sqf>
 
|-
! colspan="3" |
=== Player exits Game Options menu ===
|-
|-
| <sqf>missionNamespace</sqf>
| "OnGameOptionsExited" {{GVI|arma3|2.02}}
| <sqf>params ["_okButtonPressed"];</sqf>
|-
|-
! colspan="3" style="text-align: left" | Player exits Game Options menu
! colspan="3" |
=== Probing Beam (enoch) ===
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "OnGameOptionsExited" {{GVI|arma3|2.02}}
| "probingStarted"
| [_okButtonPressed]
| <sqf>params ["_cursorTarget", "_data"];</sqf>
|-
| <sqf>missionNamespace</sqf>
| "probingEnded"
| <sqf>params ["_data", "_isEnded"];</sqf>
 
|-
|-
! colspan="3" |
=== Respawn Display ===
|-
|-
! colspan="3" style="text-align: left" | Saving of the game, scripted or manual
| <sqf>missionNamespace</sqf>
| "RscDisplayRespawnKeyDown"
| <sqf>params ["_display", "_keyCode", "_shift", "_ctrl", "_alt"];</sqf>
 
|-
|-
| missionNamespace
! colspan="3" |
=== Saving of the game, scripted or manual ===
|-
| <sqf>missionNamespace</sqf>
| "OnSaveGame"
| "OnSaveGame"
| {{n/a}}
| {{n/a}}
|-
|-
! colspan="3" |
=== [[Event Scripts#teamSwitchedScript.sqs|teamSwitchedScript.sqs]] ===
|-
|-
! colspan="3" style="text-align: left" | teamSwitchedScript.sqs
| <sqf>missionNamespace</sqf>
|-
| missionNamespace
| "teamSwitched"
| "teamSwitched"
| [_originalUnit, _switchToUnit]
| <sqf>params ["_originalUnit", "_switchToUnit"];</sqf>
 
|-
|-
! colspan="3" |
=== [[BIS_fnc_addScriptedEventHandler]] ===
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_packStaticWeapon
| <sqf>missionNamespace</sqf>
| "ScriptedEventHandlerAdded"
| <sqf>params ["_namespace", "_name", "_handlerID"];</sqf>
 
|-
|-
| _group
! colspan="3" |
| "StaticWeaponPacked"
=== [[BIS_fnc_animateFlag]] ===
| [_group, _leader, _gunner, _assistant, _weaponBag, _baseBag]
|-
|-
| <sqf>_flag</sqf>
| "FlagAnimationDone"
| <sqf>params ["_flag", "_phaseEnd"];</sqf>
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_unpackStaticWeapon
! colspan="3" |
=== [[BIS_fnc_arsenal]] ===
|-
|-
| _group
| <sqf>missionNamespace</sqf>
| "StaticWeaponUnpacked"
| "arsenalPreOpen" {{GVI|arma3|2.08}} Fires just before Arsenal display is created
| [_group, _leader, _gunner, _assistant, _weapon]
| <sqf>params ["_missionDisplay", "_center"];</sqf>
|-
|-
| <sqf>missionNamespace</sqf>
| "arsenalOpened"
| <sqf>params ["_display", "_toggleSpace"];</sqf>
* _toggleSpace: [[Boolean]] - <sqf inline>uiNamespace getVariable ["bis_fnc_arsenal_toggleSpace", false]];</sqf>
|-
|-
! colspan="3" style="text-align: left" | Module Timeline
| <sqf>missionNamespace</sqf>
| "arsenalClosed"
| <sqf>params ["_displayNull", "_toggleSpace"];</sqf>
* _toggleSpace: [[Boolean]] - <sqf inline>uiNamespace getVariable ["bis_fnc_arsenal_toggleSpace", false]];</sqf>
 
|-
|-
| _timeline
! colspan="3" |
| "finished"
=== [[BIS_fnc_bleedTickets]] ===
| [_timeline]
|-
|-
| <sqf>missionNamespace</sqf>
| "dominantSideChanged"
| <sqf>params ["_dominantSide", "_dominantSideOld", "_sides"];</sqf>
|-
|-
| _timeline
! colspan="3" |
| "played"
=== [[BIS_fnc_EGSpectatorCamera]] ===
| {{n/a}}
|-
|-
| <sqf>missionNamespace</sqf>
| "EGSpectator_OnCameraModeChanged"
| <sqf>params ["_newMode"];</sqf>
|-
|-
| _timeline
! colspan="3" |
| "looped"
=== [[BIS_fnc_garage]] ===
| [_timeline]
|-
|-
| <sqf>missionNamespace</sqf>
| "garageOpened"
| <sqf>params ["_display", "_toggleSpace"];</sqf>
|-
|-
! colspan="3" style="text-align: left" | Module Rich Curve Key
| <sqf>missionNamespace</sqf>
| "garageClosed"
| <sqf>params ["_displayNull", "_toggleSpace"];</sqf>
* _toggleSpace: [[Boolean]] - <sqf inline>uiNamespace getVariable ["bis_fnc_arsenal_toggleSpace", false]];</sqf>
 
|-
|-
| _curKey
! colspan="3" |
| "reached"
{{ArgTitle|3|[[BIS_fnc_initDisplay]]|{{GVI|arma3|2.04}}}}
| [_curKey]
|-
|-
| <sqf>missionNamespace</sqf>
| "OnDisplayRegistered"
| <sqf>params ["_display", "_class"];</sqf>
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_kbTellLocal
| <sqf>missionNamespace</sqf>
| "OnDisplayUnregistered"
| <sqf>params ["_display", "_class"];</sqf>
 
|-
|-
| missionNamespace
! colspan="3" |
| "BIS_fnc_kbTellLocal_played"
=== [[BIS_fnc_initInspectable]] ===
| [_from, _to, _sentence, _channel]
|-
|-
| <sqf>missionNamespace</sqf>
| "objectInspected"
| <sqf>params ["_object", "_texture", "_text", "_sound", "_textureRatio"];</sqf>
any data, shown as used by the [[Arma 3: Leaflets|Leaflets]] system
|-
|-
! colspan="3" style="text-align: left" | Module Game Master (Zeus)
! colspan="3" |
=== [[BIS_fnc_initIntelObject]] ===
|-
|-
| _curator
| _object
| "curatorGroupPlaced"
| "intelObjectFound"
| [_group]
| <sqf>params ["_object", "_foundBy"];</sqf>
|-
|-
| <sqf>_curator</sqf>
| "intelObjectFound"
| <sqf>params ["_curator", "_foundBy", "_object"];</sqf>
|-
|-
| _curator
! colspan="3" |
| "curatorObjectPlaced"
=== [[BIS_fnc_kbTellLocal]] ===
| [_object]
|-
|-
| <sqf>missionNamespace</sqf>
| "BIS_fnc_kbTellLocal_played"
| <sqf>params ["_from", "_to", "_sentence", "_channel"];</sqf>
|-
|-
| _curator
! colspan="3" |
| "curatorUnitAssigned"
=== [[BIS_fnc_packStaticWeapon]] ===
| [_curator, _player]
|-
|-
| <sqf>_group</sqf>
| "StaticWeaponPacked"
| <sqf>params ["_group", "_leader", "_gunner", "_assistant", "_weaponBag", "_baseBag"];</sqf>
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_playVideo
! colspan="3" |
=== [[BIS_fnc_playVideo]] ===
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "BIS_fnc_playVideo_started"
| "BIS_fnc_playVideo_started"
| [_video]
| <sqf>params ["_video"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "BIS_fnc_playVideo_stopped"
| "BIS_fnc_playVideo_stopped"
| [_video]
| <sqf>params ["_video"];</sqf>
 
|-
|-
! colspan="3" |
=== BIS_fnc_priorityQueue* system ===
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_addScriptedEventHandler
| <sqf>missionNamespace</sqf>
|-
| "BIS_onQueue%1Pop" where %1 is ID returned from [[BIS_fnc_priorityQueue_Init]]
| missionNamespace
| <sqf>params ["_handle"];</sqf>
| "ScriptedEventHandlerAdded"
| [_namespace, _name, _handlerID]
|-
|-
| <sqf>missionNamespace</sqf>
| "BIS_onQueue%1Push" where %1 is ID returned from [[BIS_fnc_priorityQueue_Init]]
| <sqf>params ["_handle"];</sqf>
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_removeScriptedEventHandler
! colspan="3" |
=== [[BIS_fnc_removeAllScriptedEventHandlers]] ===
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "ScriptedEventHandlerRemoved"
| "ScriptedEventHandlerRemoved"
| [_namespace, _name, _handlerID]
| <sqf>params ["_namespace", "_name", "_handlerID"];</sqf>
 
|-
|-
! colspan="3" |
=== [[BIS_fnc_removeScriptedEventHandler]] ===
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_removeAllScriptedEventHandlers
| <sqf>missionNamespace</sqf>
|-
| missionNamespace
| "ScriptedEventHandlerRemoved"
| "ScriptedEventHandlerRemoved"
| [_namespace, _name, _handlerID]
| <sqf>params ["_namespace", "_name", "_handlerID"];</sqf>
 
|-
|-
! colspan="3" |
=== [[BIS_fnc_respawnTickets]] ===
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_respawnTickets
| <sqf>missionNamespace</sqf>
|-
| missionNamespace
| "respawnTicketsExhausted"
| "respawnTicketsExhausted"
| [_target]
| <sqf>params ["_target"];</sqf>
 
|-
|-
! colspan="3" |
=== [[BIS_fnc_unpackStaticWeapon]] ===
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_bleedTickets
| <sqf>_group</sqf>
| "StaticWeaponUnpacked"
| <sqf>params ["_group", "_leader", "_gunner", "_assistant", "_weapon"];</sqf>
 
|-
|-
| missionNamespace
! colspan="3" |
| "dominantSideChanged"
=== Module Curator RemoteControl ===
| [_dominantSide, _dominantSideOld, _sides]
|-
|-
| <sqf>_curator</sqf>
| "curatorObjectRemoteControlled"
| <sqf>params ["_curator", "_player", "_unit", "_isRemoteControlled"];</sqf>
* _isRemoteControlled is [[true]] when entering remote control, [[false]] when exiting
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_arsenal
! colspan="3" |
=== Module End Game ===
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "arsenalOpened"
| "EndGame_OnStageChanged"
| [_display, _toggleSpace]
| <sqf>params ["_stage", "_side"];</sqf>
|-
|-
| <sqf>missionNamespace</sqf>
| "EndGame_OnStartGameObjectiveCompleted"
| <sqf>params ["_side"];</sqf>
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "arsenalClosed"
| "EndGame_OnObjectiveStateChanged"
| [<nowiki/>[[displayNull]], [[uiNamespace]] [[getVariable]] ["BIS_fnc_arsenal_toggleSpace", [[false]]]]
| <sqf>params ["_objective", "_side", "_newState"];</sqf>
|-
|-
| <sqf>missionNamespace</sqf>
| "EndGame_OnObjectiveCompleted"
| <sqf>params ["_objective"];</sqf>
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_garage
| <sqf>missionNamespace</sqf>
| "EndGame_OnObjectiveEnded"
| <sqf>params ["_objective"];</sqf>
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "garageOpened"
| "EndGame_OnDownloadCompleted"
| [_display, _toggleSpace]
| <sqf>params ["_side", "_isUpload"];</sqf>
|-
|-
| <sqf>missionNamespace</sqf>
| "EndGame_Ended"
| <sqf>params ["_winnerSide", "_loserSide", "_isDraw"];</sqf>
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "garageClosed"
| "onUploadStateChanged"
| [displayNull,uiNamespace getVariable ["BIS_fnc_arsenal_toggleSpace",false]]
| <sqf>params ["_side"]; // can be nil</sqf>
|-
|-
| <sqf>missionNamespace</sqf>
| "onPickupInfoChanged"
| <sqf>params ["_BIS_hvt_pickupInfo"];</sqf>
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_initIntelObject
! colspan="3" |
=== Module Game Master (Zeus) ===
|-
|-
| _object
| <sqf>_curator</sqf>
| "intelObjectFound"
| "curatorGroupPlaced"
| [_object, _foundBy]
| <sqf>params ["_group"];</sqf>
|-
|-
| <sqf>_curator</sqf>
| "curatorObjectPlaced"
| <sqf>params ["_object"];</sqf>
|-
|-
| _curator
| <sqf>_curator</sqf>
| "intelObjectFound"
| "curatorUnitAssigned"
| [_curator, _foundBy, _object]
| <sqf>params ["_curator", "_player"];</sqf>
 
|-
|-
! colspan="3" |
=== Module Rich Curve Key ===
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_EGSpectatorCamera
| _curKey
|-
| "reached"
| missionNamespace
| <sqf>params ["_curKey"];</sqf>
| "EGSpectator_OnCameraModeChanged"
 
| [_newMode]
|-
|-
! colspan="3" style="text-align: left" | Module Vehicle Respawn
|-
| missionNamespace
| "respawn"
| [_newVeh, _veh]
|-
|-
! colspan="3" |
=== Module Sector ===
|-
|-
! colspan="3" style="text-align: left" | Module Sector
| <sqf>_sector</sqf>
|-
| _sector
| "ownerChanged"
| "ownerChanged"
| [_sector, _owner, _ownerOld]
| <sqf>params ["_sector", "_owner", "_ownerOld"];</sqf>
 
|-
|-
! colspan="3" |
=== Module Spawn AI: Sector Tactic ===
|-
|-
! colspan="3" style="text-align: left" | Module Curator RemoteControl
| <sqf>missionNamespace</sqf>
|-
| _curator
| "curatorObjectRemoteControlled"
| [_curator, _player, _unit, _return]
|-
|-
! colspan="3" style="text-align: left" | Module Spawn AI: Sector Tactic
|-
| missionNamespace
| "bis_groundSupport_groupSpawned"
| "bis_groundSupport_groupSpawned"
| ["bis_groundSupport_groupSpawned", _group, _side]
| <sqf>params ["_bis_groundSupport_groupSpawned", "_group", "_side"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_wiped"
| "bis_groundSupport_wiped"
| ["bis_groundSupport_wiped", _group]
| <sqf>params ["_bis_groundSupport_wiped", "_group"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_inEnemySector"
| "bis_groundSupport_inEnemySector"
| ["bis_groundSupport_inEnemySector", _group]
| <sqf>params ["_bis_groundSupport_inEnemySector", "_group"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_destinationReached"
| "bis_groundSupport_destinationReached"
| ["bis_groundSupport_destinationReached", _group]
| <sqf>params ["_bis_groundSupport_destinationReached", "_group"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_groupTypeChanged"
| "bis_groundSupport_groupTypeChanged"
| ["bis_groundSupport_groupTypeChanged", _group, _type, _currentType]
| <sqf>params ["_bis_groundSupport_groupTypeChanged", "_group", "_type", "_currentType"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_decimated"
| "bis_groundSupport_decimated"
| ["bis_groundSupport_decimated", _group]
| <sqf>params ["_bis_groundSupport_decimated", "_group"];</sqf>
|-
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "bis_groundSupport_farFromDestination"
| "bis_groundSupport_farFromDestination"
| ["bis_groundSupport_farFromDestination", _group]
| <sqf>params ["_bis_groundSupport_farFromDestination", "_group"];</sqf>
|-
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "bis_groundSupport_needTransport"
| "bis_groundSupport_needTransport"
| ["bis_groundSupport_needTransport", _group]
| <sqf>params ["_bis_groundSupport_needTransport", "_group"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_joined"
| "bis_groundSupport_joined"
| ["bis_groundSupport_joined", _group, _transportGroup]
| <sqf>params ["_bis_groundSupport_joined", "_group", "_transportGroup"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_closeToDestination"
| "bis_groundSupport_closeToDestination"
| ["bis_groundSupport_closeToDestination", _group]
| <sqf>params ["_bis_groundSupport_closeToDestination", "_group"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_needEvac"
| "bis_groundSupport_needEvac"
| ["bis_groundSupport_needEvac", _group]
| <sqf>params ["_bis_groundSupport_needEvac", "_group"];</sqf>
|-
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "bis_groundSupport_needAmmo"
| "bis_groundSupport_needAmmo"
| ["bis_groundSupport_needAmmo", _group]
| <sqf>params ["_bis_groundSupport_needAmmo", "_group"];</sqf>
|-
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "bis_groundSupport_needSupport"
| "bis_groundSupport_needSupport"
| ["bis_groundSupport_needSupport", _group, _reportedVehicle]
| <sqf>params ["_bis_groundSupport_needSupport", "_group", "_reportedVehicle"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_boarded"
| "bis_groundSupport_boarded"
| ["bis_groundSupport_boarded", _group, _transport]
| <sqf>params ["_bis_groundSupport_boarded", "_group", "_transport"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_transportStarted"
| "bis_groundSupport_transportStarted"
| ["bis_groundSupport_transportStarted", _group, _transport]
| <sqf>params ["_bis_groundSupport_transportStarted", "_group", "_transport"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_transportEnded"
| "bis_groundSupport_transportEnded"
| ["bis_groundSupport_transportEnded", _group, _transport]
| <sqf>params ["_bis_groundSupport_transportEnded", "_group", "_transport"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_transportAborted"
| "bis_groundSupport_transportAborted"
| ["bis_groundSupport_transportAborted", _group, _transport]
| <sqf>params ["_bis_groundSupport_transportAborted", "_group", "_transport"];</sqf>
|-
|-
|-
| <sqf>missionNamespace</sqf>
| missionNamespace
| "bis_groundSupport_disembarked"
| "bis_groundSupport_disembarked"
| ["bis_groundSupport_disembarked", _group, _transport]
| <sqf>params ["_bis_groundSupport_disembarked", "_group", "_transport"];</sqf>
 
|-
|-
! colspan="3" |
=== Module Timeline ===
|-
|-
! colspan="3" style="text-align: left" | Module End Game
| <sqf>_timeline</sqf>
| "finished"
| <sqf>params ["_timeline"];</sqf>
|-
|-
| missionNamespace
| <sqf>_timeline</sqf>
| "EndGame_OnStageChanged"
| "played"
| [_stage, _side]
| {{n/a}}
|-
|-
| <sqf>_timeline</sqf>
| "looped"
| <sqf>params ["_timeline"];</sqf>
|-
|-
| missionNamespace
! colspan="3" |
| "EndGame_OnStartGameObjectiveCompleted"
=== Module Trident ===
| [_side]
|-
|-
|-
| missionNamespace
| <sqf>missionNamespace</sqf>
| "EndGame_OnObjectiveStateChanged"
| [_objective, _side, _newState]
|-
|-
| missionNamespace
| "EndGame_OnObjectiveCompleted"
| [_objective]
|-
|-
| missionNamespace
| "EndGame_OnObjectiveEnded"
| [_objective]
|-
|-
| missionNamespace
| "EndGame_OnDownloadCompleted"
| [_side, _isUpload]
|-
|-
| missionNamespace
| "EndGame_Ended"
| [_winnerSide, _looserSide, _isDraw]
|-
|-
| missionNamespace
| "onUploadStateChanged"
| [_side] {{cc|can be nil}}
|-
|-
| missionNamespace
| "onPickupInfoChanged"
| [BIS_hvt_pickupInfo]
|-
|-
! colspan="3" style="text-align: left" | EG Spectator Display
|-
| missionNamespace
| "RscDisplayEGSpectator_OnCursorObjectFocused"
| [_object]
|-
|-
| missionNamespace
| "RscDisplayEGSpectator_OnCursorObjectUnfocused"
| [_object]
|-
|-
| missionNamespace
| "RscDisplayEGSpectator_OnFocusChanged"
| [_newFocus]
|-
|-
| missionNamespace
| "RscDisplayEGSpectator_OnUiVisibilityChanged"
| [_isVisible]
|-
|-
| missionNamespace
| "RscDisplayEGSpectator_MapStateChanged"
| [_isMapVisible]
|-
|-
! colspan="3" style="text-align: left" | Respawn Display
|-
| missionNamespace
| "RscDisplayRespawnKeyDown"
| [_display, _keyCode, _shft, _ctr, _alt]
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_animateFlag
|-
| _flag
| "FlagAnimationDone"
| [_flag, _phaseEnd]
|-
|-
! colspan="3" style="text-align: left" | Module Trident
|-
| missionNamespace
| "BIS_fnc_moduleTrident_updated"
| "BIS_fnc_moduleTrident_updated"
| [_sideA, _sideB, _areFriendly]
| <sqf>params ["_sideA", "_sideB", "_areFriendly"];</sqf>
 
|-
|-
! colspan="3" |
=== Module Vehicle Respawn ===
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_initInspectable
| <sqf>missionNamespace</sqf>
|-
| "respawn"
| missionNamespace
| <sqf>params ["_newVeh", "_veh"];</sqf>
| "objectInspected"
| [_object, (_texture, _text, _sound, _textureRatio)] {{cc|any data, shown as used by leaflet system}}
|-
|-
! colspan="3" style="text-align: left" | BIS_fnc_priorityQueue
|-
| missionNamespace
| "BIS_onQueue%1Pop" {{cc|where %1 is ID returned from BIS_fnc_priorityQueue_init}}
| [_handle]
|-
|-
| missionNamespace
| "BIS_onQueue%1Push" {{cc|where %1 is ID returned from BIS_fnc_priorityQueue_init}}
| [_handle]
|-
|}
|}
== {{Name|arma3contact}} Events ==
{{Feature|arma3contact}}
{{Columns|5|
* "antennaAdded"
* "antennaDeleted"
* "arsenalPreOpen"
* "behaviourChanged"
* "currentSignalChanged"
* "dangerZoneEntered"
* "dangerZoneExited"
* "diaryRecordSet"
* "dominantSideChanged"
* "gravitPulseHit"
* "gravitPulseRewarded"
* "handleCombat"
* "handleWarningShot"
* "moveToModelSpaceCompleted"
* "puzzleReset"
* "puzzleStepCompleted"
* "puzzleTerminated"
* "refresh"
* "respawnTicketsExhausted"
* "rotationChanged"
* "signalEnded"
* "signalScanned"
* "signalStartedPassive"
* "siteSpawned"
* "taskSet"
* "translationChanged"
* "transmittingEnded"
* "transmittingStarted"
* "wpPatrolEnded"
* "wpPatrolStarted"
}}


[[Category: Event Handlers]]
[[Category: Event Handlers]]

Latest revision as of 12:55, 20 April 2024

Scripted Event Handlers are triggered by some of BI's modules and functions. When triggered any code registered for one of these events via BIS_fnc_addScriptedEventHandler will be executed. All the events exists as variables within a namespace, whether this is one of the main Namespaces like missionNamespace or uiNamespace or it could be a specific namespace like a Group or Object etc. The event also has a set of parameters passed to the executed code. You can even implement your own scripted eventHandlers by using BIS_fnc_callScriptedEventHandler. For all other available Event Handlers, see Arma 3: Event Handlers.


Functions


Examples

Subscribe

[missionNamespace, "localPlayerNearFourArmedRobot", { hint "Hello there"; }] call BIS_fnc_addScriptedEventHandler;

[missionNamespace, "arsenalOpened", { hint "Player opened the Arsenal"; // hint message to the player when he opens the Arsenal }] call BIS_fnc_addScriptedEventHandler;

Trigger

waitUntil { sleep 1; player distance _GG < 10 }; [missionNamespace, "localPlayerNearFourArmedRobot", [player, _GG]] call BIS_fnc_callScriptedEventHandler;


Events

This is a list of all available scripted events that exist through BI's functions and modules. Each event is listed under the system that calls them whether this be a specific function or a module. List last updated for Arma 3 logo black.png2.10

Event namespace Event name Event passed parameters

EG Spectator Display

"RscDisplayEGSpectator_OnCursorObjectFocused"
params ["_object"];
"RscDisplayEGSpectator_OnCursorObjectUnfocused"
params ["_object"];
"RscDisplayEGSpectator_OnFocusChanged"
params ["_newFocus"];
"RscDisplayEGSpectator_OnUiVisibilityChanged"
params ["_isVisible"];
"RscDisplayEGSpectator_MapStateChanged"
params ["_isMapVisible"];

Player opens pause menu

"OnGameInterrupt"
params ["_display"];

Player exits Game Options menu

"OnGameOptionsExited" Arma 3 logo black.png2.02
params ["_okButtonPressed"];

Probing Beam (enoch)

"probingStarted"
params ["_cursorTarget", "_data"];
"probingEnded"
params ["_data", "_isEnded"];

Respawn Display

"RscDisplayRespawnKeyDown"
params ["_display", "_keyCode", "_shift", "_ctrl", "_alt"];

Saving of the game, scripted or manual

"OnSaveGame" N/A

teamSwitchedScript.sqs

"teamSwitched"
params ["_originalUnit", "_switchToUnit"];

BIS_fnc_addScriptedEventHandler

"ScriptedEventHandlerAdded"
params ["_namespace", "_name", "_handlerID"];

BIS_fnc_animateFlag

_flag
"FlagAnimationDone"
params ["_flag", "_phaseEnd"];

BIS_fnc_arsenal

"arsenalPreOpen" Arma 3 logo black.png2.08 Fires just before Arsenal display is created
params ["_missionDisplay", "_center"];
"arsenalOpened"
params ["_display", "_toggleSpace"];
"arsenalClosed"
params ["_displayNull", "_toggleSpace"];

BIS_fnc_bleedTickets

"dominantSideChanged"
params ["_dominantSide", "_dominantSideOld", "_sides"];

BIS_fnc_EGSpectatorCamera

"EGSpectator_OnCameraModeChanged"
params ["_newMode"];

BIS_fnc_garage

"garageOpened"
params ["_display", "_toggleSpace"];
"garageClosed"
params ["_displayNull", "_toggleSpace"];
"OnDisplayRegistered"
params ["_display", "_class"];
"OnDisplayUnregistered"
params ["_display", "_class"];

BIS_fnc_initInspectable

"objectInspected"
params ["_object", "_texture", "_text", "_sound", "_textureRatio"];

any data, shown as used by the Leaflets system

BIS_fnc_initIntelObject

_object "intelObjectFound"
params ["_object", "_foundBy"];
_curator
"intelObjectFound"
params ["_curator", "_foundBy", "_object"];

BIS_fnc_kbTellLocal

"BIS_fnc_kbTellLocal_played"
params ["_from", "_to", "_sentence", "_channel"];

BIS_fnc_packStaticWeapon

_group
"StaticWeaponPacked"
params ["_group", "_leader", "_gunner", "_assistant", "_weaponBag", "_baseBag"];

BIS_fnc_playVideo

"BIS_fnc_playVideo_started"
params ["_video"];
"BIS_fnc_playVideo_stopped"
params ["_video"];

BIS_fnc_priorityQueue* system

"BIS_onQueue%1Pop" where %1 is ID returned from BIS_fnc_priorityQueue_Init
params ["_handle"];
"BIS_onQueue%1Push" where %1 is ID returned from BIS_fnc_priorityQueue_Init
params ["_handle"];

BIS_fnc_removeAllScriptedEventHandlers

"ScriptedEventHandlerRemoved"
params ["_namespace", "_name", "_handlerID"];

BIS_fnc_removeScriptedEventHandler

"ScriptedEventHandlerRemoved"
params ["_namespace", "_name", "_handlerID"];

BIS_fnc_respawnTickets

"respawnTicketsExhausted"
params ["_target"];

BIS_fnc_unpackStaticWeapon

_group
"StaticWeaponUnpacked"
params ["_group", "_leader", "_gunner", "_assistant", "_weapon"];

Module Curator RemoteControl

_curator
"curatorObjectRemoteControlled"
params ["_curator", "_player", "_unit", "_isRemoteControlled"];
  • _isRemoteControlled is true when entering remote control, false when exiting

Module End Game

"EndGame_OnStageChanged"
params ["_stage", "_side"];
"EndGame_OnStartGameObjectiveCompleted"
params ["_side"];
"EndGame_OnObjectiveStateChanged"
params ["_objective", "_side", "_newState"];
"EndGame_OnObjectiveCompleted"
params ["_objective"];
"EndGame_OnObjectiveEnded"
params ["_objective"];
"EndGame_OnDownloadCompleted"
params ["_side", "_isUpload"];
"EndGame_Ended"
params ["_winnerSide", "_loserSide", "_isDraw"];
"onUploadStateChanged"
params ["_side"]; // can be nil
"onPickupInfoChanged"
params ["_BIS_hvt_pickupInfo"];

Module Game Master (Zeus)

_curator
"curatorGroupPlaced"
params ["_group"];
_curator
"curatorObjectPlaced"
params ["_object"];
_curator
"curatorUnitAssigned"
params ["_curator", "_player"];

Module Rich Curve Key

_curKey "reached"
params ["_curKey"];

Module Sector

_sector
"ownerChanged"
params ["_sector", "_owner", "_ownerOld"];

Module Spawn AI: Sector Tactic

"bis_groundSupport_groupSpawned"
params ["_bis_groundSupport_groupSpawned", "_group", "_side"];
"bis_groundSupport_wiped"
params ["_bis_groundSupport_wiped", "_group"];
"bis_groundSupport_inEnemySector"
params ["_bis_groundSupport_inEnemySector", "_group"];
"bis_groundSupport_destinationReached"
params ["_bis_groundSupport_destinationReached", "_group"];
"bis_groundSupport_groupTypeChanged"
params ["_bis_groundSupport_groupTypeChanged", "_group", "_type", "_currentType"];
"bis_groundSupport_decimated"
params ["_bis_groundSupport_decimated", "_group"];
"bis_groundSupport_farFromDestination"
params ["_bis_groundSupport_farFromDestination", "_group"];
"bis_groundSupport_needTransport"
params ["_bis_groundSupport_needTransport", "_group"];
"bis_groundSupport_joined"
params ["_bis_groundSupport_joined", "_group", "_transportGroup"];
"bis_groundSupport_closeToDestination"
params ["_bis_groundSupport_closeToDestination", "_group"];
"bis_groundSupport_needEvac"
params ["_bis_groundSupport_needEvac", "_group"];
"bis_groundSupport_needAmmo"
params ["_bis_groundSupport_needAmmo", "_group"];
"bis_groundSupport_needSupport"
params ["_bis_groundSupport_needSupport", "_group", "_reportedVehicle"];
"bis_groundSupport_boarded"
params ["_bis_groundSupport_boarded", "_group", "_transport"];
"bis_groundSupport_transportStarted"
params ["_bis_groundSupport_transportStarted", "_group", "_transport"];
"bis_groundSupport_transportEnded"
params ["_bis_groundSupport_transportEnded", "_group", "_transport"];
"bis_groundSupport_transportAborted"
params ["_bis_groundSupport_transportAborted", "_group", "_transport"];
"bis_groundSupport_disembarked"
params ["_bis_groundSupport_disembarked", "_group", "_transport"];

Module Timeline

_timeline
"finished"
params ["_timeline"];
_timeline
"played" N/A
_timeline
"looped"
params ["_timeline"];

Module Trident

"BIS_fnc_moduleTrident_updated"
params ["_sideA", "_sideB", "_areFriendly"];

Module Vehicle Respawn

"respawn"
params ["_newVeh", "_veh"];


Arma 3 Contact Events

enoch icon ca.png
This content is exclusive to the Arma 3 Contact Expansion.
  • "antennaAdded"
  • "antennaDeleted"
  • "arsenalPreOpen"
  • "behaviourChanged"
  • "currentSignalChanged"
  • "dangerZoneEntered"
  • "dangerZoneExited"
  • "diaryRecordSet"
  • "dominantSideChanged"
  • "gravitPulseHit"
  • "gravitPulseRewarded"
  • "handleCombat"
  • "handleWarningShot"
  • "moveToModelSpaceCompleted"
  • "puzzleReset"
  • "puzzleStepCompleted"
  • "puzzleTerminated"
  • "refresh"
  • "respawnTicketsExhausted"
  • "rotationChanged"
  • "signalEnded"
  • "signalScanned"
  • "signalStartedPassive"
  • "siteSpawned"
  • "taskSet"
  • "translationChanged"
  • "transmittingEnded"
  • "transmittingStarted"
  • "wpPatrolEnded"
  • "wpPatrolStarted"