Arma 3 Scripting

Topic in Event Handlers

Arma 3: Scripted Event Handlers

Also available as Markdown and JSON, or read the original wiki page.

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 v2.10

Event namespace Event name Event passed parameters
#### EG Spectator Display
sqf
missionNamespace
"RscDisplayEGSpectator_OnCursorObjectFocused" sqf
params ["_object"];
sqf
missionNamespace
"RscDisplayEGSpectator_OnCursorObjectUnfocused" sqf
params ["_object"];
sqf
missionNamespace
"RscDisplayEGSpectator_OnFocusChanged" sqf
params ["_newFocus"];
sqf
missionNamespace
"RscDisplayEGSpectator_OnUiVisibilityChanged" sqf
params ["_isVisible"];
sqf
missionNamespace
"RscDisplayEGSpectator_MapStateChanged" sqf
params ["_isMapVisible"];
#### Player opens pause menu
sqf
missionNamespace
"OnGameInterrupt" sqf
params ["_display"];
#### Player exits Game Options menu
sqf
missionNamespace
"OnGameOptionsExited" Arma 3 v2.02 sqf
params ["_okButtonPressed"];
#### Probing Beam (enoch)
sqf
missionNamespace
"probingStarted" sqf
params ["_cursorTarget", "_data"];
sqf
missionNamespace
"probingEnded" sqf
params ["_data", "_isEnded"];
#### Respawn Display
sqf
missionNamespace
"RscDisplayRespawnKeyDown" sqf
params ["_display", "_keyCode", "_shift", "_ctrl", "_alt"];
#### Saving of the game, scripted or manual
sqf
missionNamespace
"OnSaveGame" N/A
#### teamSwitchedScript.sqs
sqf
missionNamespace
"teamSwitched" sqf
params ["_originalUnit", "_switchToUnit"];
#### BIS_fnc_addScriptedEventHandler
sqf
missionNamespace
"ScriptedEventHandlerAdded" sqf
params ["_namespace", "_name", "_handlerID"];
#### BIS_fnc_animateFlag
sqf
_flag
"FlagAnimationDone" sqf
params ["_flag", "_phaseEnd"];
#### BIS_fnc_arsenal
sqf
missionNamespace
"arsenalPreOpen" Arma 3 v2.08 Fires just before Arsenal display is created sqf
params ["_missionDisplay", "_center"];
sqf
missionNamespace
"arsenalOpened" sqf
params ["_display", "_toggleSpace"];

- _toggleSpace: Boolean - uiNamespace getVariable ["bis_fnc_arsenal_toggleSpace", false]];
sqf
missionNamespace
"arsenalClosed" sqf
params ["_displayNull", "_toggleSpace"];

- _toggleSpace: Boolean - uiNamespace getVariable ["bis_fnc_arsenal_toggleSpace", false]];
#### BIS_fnc_bleedTickets
sqf
missionNamespace
"dominantSideChanged" sqf
params ["_dominantSide", "_dominantSideOld", "_sides"];
#### BIS_fnc_EGSpectatorCamera
sqf
missionNamespace
"EGSpectator_OnCameraModeChanged" sqf
params ["_newMode"];
#### BIS_fnc_garage
sqf
missionNamespace
"garageOpened" sqf
params ["_display", "_toggleSpace"];
sqf
missionNamespace
"garageClosed" sqf
params ["_displayNull", "_toggleSpace"];

- _toggleSpace: Boolean - uiNamespace getVariable ["bis_fnc_arsenal_toggleSpace", false]];
#### BIS_fnc_initDisplay (Arma 3 v2.04)
sqf
missionNamespace
"OnDisplayRegistered" sqf
params ["_display", "_class"];
sqf
missionNamespace
"OnDisplayUnregistered" sqf
params ["_display", "_class"];
#### BIS_fnc_initInspectable
sqf
missionNamespace
"objectInspected" sqf
params ["_object", "_texture", "_text", "_sound", "_textureRatio"];

any data, shown as used by the Leaflets system
#### BIS_fnc_initIntelObject
_object "intelObjectFound" sqf
params ["_object", "_foundBy"];
sqf
_curator
"intelObjectFound" sqf
params ["_curator", "_foundBy", "_object"];
#### BIS_fnc_kbTellLocal
sqf
missionNamespace
"BIS_fnc_kbTellLocal_played" sqf
params ["_from", "_to", "_sentence", "_channel"];
#### BIS_fnc_packStaticWeapon
sqf
_group
"StaticWeaponPacked" sqf
params ["_group", "_leader", "_gunner", "_assistant", "_weaponBag", "_baseBag"];
#### BIS_fnc_playVideo
sqf
missionNamespace
"BIS_fnc_playVideo_started" sqf
params ["_video"];
sqf
missionNamespace
"BIS_fnc_playVideo_stopped" sqf
params ["_video"];
#### BIS_fnc_priorityQueue* system
sqf
missionNamespace
"BIS_onQueue%1Pop" where %1 is ID returned from BIS_fnc_priorityQueue_Init sqf
params ["_handle"];
sqf
missionNamespace
"BIS_onQueue%1Push" where %1 is ID returned from BIS_fnc_priorityQueue_Init sqf
params ["_handle"];
#### BIS_fnc_removeAllScriptedEventHandlers
sqf
missionNamespace
"ScriptedEventHandlerRemoved" sqf
params ["_namespace", "_name", "_handlerID"];
#### BIS_fnc_removeScriptedEventHandler
sqf
missionNamespace
"ScriptedEventHandlerRemoved" sqf
params ["_namespace", "_name", "_handlerID"];
#### BIS_fnc_respawnTickets
sqf
missionNamespace
"respawnTicketsExhausted" sqf
params ["_target"];
#### BIS_fnc_unpackStaticWeapon
sqf
_group
"StaticWeaponUnpacked" sqf
params ["_group", "_leader", "_gunner", "_assistant", "_weapon"];
#### Structures
sqf
missionNamespace
"StructureDamaged" Arma 3 v2.22 sqf
params ["_structure", "_shot", "_position", "_velocity", "_ammo", "_explosive", "_indirectHit", "_invArmor", "_explPow", "_damage"];
sqf
missionNamespace
"StructureDestroyed" Arma 3 v2.22 sqf
params ["_structure", "_killer", "_instigator", "_useEffects", "_shot", "_real"];
#### Module Curator RemoteControl
sqf
_curator
"curatorObjectRemoteControlled" sqf
params ["_curator", "_player", "_unit", "_isRemoteControlled"];

- _isRemoteControlled is true when entering remote control, false when exiting
#### Module End Game
sqf
missionNamespace
"EndGame_OnStageChanged" sqf
params ["_stage", "_side"];
sqf
missionNamespace
"EndGame_OnStartGameObjectiveCompleted" sqf
params ["_side"];
sqf
missionNamespace
"EndGame_OnObjectiveStateChanged" sqf
params ["_objective", "_side", "_newState"];
sqf
missionNamespace
"EndGame_OnObjectiveCompleted" sqf
params ["_objective"];
sqf
missionNamespace
"EndGame_OnObjectiveEnded" sqf
params ["_objective"];
sqf
missionNamespace
"EndGame_OnDownloadCompleted" sqf
params ["_side", "_isUpload"];
sqf
missionNamespace
"EndGame_Ended" sqf
params ["_winnerSide", "_loserSide", "_isDraw"];
sqf
missionNamespace
"onUploadStateChanged" sqf
params ["_side"]; // can be nil
sqf
missionNamespace
"onPickupInfoChanged" sqf
params ["_BIS_hvt_pickupInfo"];
#### Module Game Master (Zeus)
sqf
_curator
"curatorGroupPlaced" sqf
params ["_group"];
sqf
_curator
"curatorObjectPlaced" sqf
params ["_object"];
sqf
_curator
"curatorUnitAssigned" sqf
params ["_curator", "_player"];
#### Module Rich Curve Key
_curKey "reached" sqf
params ["_curKey"];
#### Module Sector
sqf
_sector
"ownerChanged" sqf
params ["_sector", "_owner", "_ownerOld"];
#### Module Spawn AI: Sector Tactic
sqf
missionNamespace
"bis_groundSupport_groupSpawned" sqf
params ["_bis_groundSupport_groupSpawned", "_group", "_side"];
sqf
missionNamespace
"bis_groundSupport_wiped" sqf
params ["_bis_groundSupport_wiped", "_group"];
sqf
missionNamespace
"bis_groundSupport_inEnemySector" sqf
params ["_bis_groundSupport_inEnemySector", "_group"];
sqf
missionNamespace
"bis_groundSupport_destinationReached" sqf
params ["_bis_groundSupport_destinationReached", "_group"];
sqf
missionNamespace
"bis_groundSupport_groupTypeChanged" sqf
params ["_bis_groundSupport_groupTypeChanged", "_group", "_type", "_currentType"];
sqf
missionNamespace
"bis_groundSupport_decimated" sqf
params ["_bis_groundSupport_decimated", "_group"];
sqf
missionNamespace
"bis_groundSupport_farFromDestination" sqf
params ["_bis_groundSupport_farFromDestination", "_group"];
sqf
missionNamespace
"bis_groundSupport_needTransport" sqf
params ["_bis_groundSupport_needTransport", "_group"];
sqf
missionNamespace
"bis_groundSupport_joined" sqf
params ["_bis_groundSupport_joined", "_group", "_transportGroup"];
sqf
missionNamespace
"bis_groundSupport_closeToDestination" sqf
params ["_bis_groundSupport_closeToDestination", "_group"];
sqf
missionNamespace
"bis_groundSupport_needEvac" sqf
params ["_bis_groundSupport_needEvac", "_group"];
sqf
missionNamespace
"bis_groundSupport_needAmmo" sqf
params ["_bis_groundSupport_needAmmo", "_group"];
sqf
missionNamespace
"bis_groundSupport_needSupport" sqf
params ["_bis_groundSupport_needSupport", "_group", "_reportedVehicle"];
sqf
missionNamespace
"bis_groundSupport_boarded" sqf
params ["_bis_groundSupport_boarded", "_group", "_transport"];
sqf
missionNamespace
"bis_groundSupport_transportStarted" sqf
params ["_bis_groundSupport_transportStarted", "_group", "_transport"];
sqf
missionNamespace
"bis_groundSupport_transportEnded" sqf
params ["_bis_groundSupport_transportEnded", "_group", "_transport"];
sqf
missionNamespace
"bis_groundSupport_transportAborted" sqf
params ["_bis_groundSupport_transportAborted", "_group", "_transport"];
sqf
missionNamespace
"bis_groundSupport_disembarked" sqf
params ["_bis_groundSupport_disembarked", "_group", "_transport"];
#### Module Timeline
sqf
_timeline
"finished" sqf
params ["_timeline"];
sqf
_timeline
"played" N/A
sqf
_timeline
"looped" sqf
params ["_timeline"];
#### Module Trident
sqf
missionNamespace
"BIS_fnc_moduleTrident_updated" sqf
params ["_sideA", "_sideB", "_areFriendly"];
#### Module Vehicle Respawn
sqf
missionNamespace
"respawn" sqf
params ["_newVeh", "_veh"];
#### Spectrum Analyzer Device
sqf
missionNamespace
"SpectrumAnalyzerOpened" sqf
params ["_display"];
sqf
missionNamespace
"SpectrumAnalyzerClosed" sqf
params ["_display"];

Arma 3 Contact Events

Note

This content is exclusive to the Arma 3 Contact Expansion.