Scripted Event Handlers – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search

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

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

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

Trigger

Copy
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"
Copy
params ["_object"];
"RscDisplayEGSpectator_OnCursorObjectUnfocused"
Copy
params ["_object"];
"RscDisplayEGSpectator_OnFocusChanged"
Copy
params ["_newFocus"];
"RscDisplayEGSpectator_OnUiVisibilityChanged"
Copy
params ["_isVisible"];
"RscDisplayEGSpectator_MapStateChanged"
Copy
params ["_isMapVisible"];

Player opens pause menu

"OnGameInterrupt"
Copy
params ["_display"];

Player exits Game Options menu

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

Probing Beam (enoch)

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

Respawn Display

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

Saving of the game, scripted or manual

"OnSaveGame" N/A

teamSwitchedScript.sqs

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

BIS_fnc_addScriptedEventHandler

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

BIS_fnc_animateFlag

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

BIS_fnc_arsenal

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

BIS_fnc_bleedTickets

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

BIS_fnc_EGSpectatorCamera

"EGSpectator_OnCameraModeChanged"
Copy
params ["_newMode"];

BIS_fnc_garage

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

BIS_fnc_initInspectable

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

any data, shown as used by the Leaflets system

BIS_fnc_initIntelObject

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

BIS_fnc_kbTellLocal

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

BIS_fnc_packStaticWeapon

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

BIS_fnc_playVideo

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

BIS_fnc_priorityQueue* system

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

BIS_fnc_removeAllScriptedEventHandlers

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

BIS_fnc_removeScriptedEventHandler

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

BIS_fnc_respawnTickets

"respawnTicketsExhausted"
Copy
params ["_target"];

BIS_fnc_unpackStaticWeapon

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

Module Curator RemoteControl

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

Module End Game

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

Module Game Master (Zeus)

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

Module Rich Curve Key

_curKey "reached"
Copy
params ["_curKey"];

Module Sector

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

Module Spawn AI: Sector Tactic

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

Module Timeline

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

Module Trident

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

Module Vehicle Respawn

"respawn"
Copy
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"