fnc_addEventMission.sqf

Summary
fnc_addEventMission.sqf
Functions
OCAP_recorder_fnc_addEventMissionUsed for applying mission event handlers.
Event Handlers
Event Handlers
OCAP_EH_HandleDisconnectFired when a player leaves the mission by returning to lobby or disconnecting.
OCAP_EH_PlayerConnectedHandle for the “PlayerConnected” mission event handler.
OCAP_EH_OnUserAdminStateChangedHandle for the “OnUserAdminStateChange” mission event handler.
OCAP_EH_EntityKilledHandle for the “EntityKilled” mission event handler.
OCAP_EH_EntityRespawnedHandle for the “EntityRespawned” mission event handler.
OCAP_EH_MPEndedHandle for the “MPEnded” mission event handler.
OCAP_EH_EndedHandle for the “Ended” mission event handler.
CBA Events
Variables
CBA Listener Handles
CBA Events
ace_advanced_throwing_throwFiredXEHFired when a throwable is primed.
ace_explosives_placeEvent listener for ACE3 global event indicating a mine has been placed and armed.
OCAP_customEventEvent listener for custom event text to be added to the timeline.
OCAP_counterInitMeant for use in custom tracking of points or score between two sides.
OCAP_counterEventMeant for use in custom tracking of points or score between two sides.
OCAP_recordUsed to start or resume recording.
OCAP_pauseUsed to pause recording.
OCAP_exportDataUsed to stop recording & signal the extension to save and upload it to the web component.

Functions

OCAP_recorder_fnc_addEventMission

Description

Used for applying mission event handlers.  Applied during initialization of OCAP in OCAP_recorder_fnc_init.

Parameters

None

Returns

Nothing

Examples

call FUNC(addEventMission);

Public

No

Author

IndigoFox, Dell

Event Handlers

Summary
Event Handlers
OCAP_EH_HandleDisconnectFired when a player leaves the mission by returning to lobby or disconnecting.
OCAP_EH_PlayerConnectedHandle for the “PlayerConnected” mission event handler.
OCAP_EH_OnUserAdminStateChangedHandle for the “OnUserAdminStateChange” mission event handler.
OCAP_EH_EntityKilledHandle for the “EntityKilled” mission event handler.
OCAP_EH_EntityRespawnedHandle for the “EntityRespawned” mission event handler.
OCAP_EH_MPEndedHandle for the “MPEnded” mission event handler.
OCAP_EH_EndedHandle for the “Ended” mission event handler.

Event Handlers

OCAP_EH_HandleDisconnect

Fired when a player leaves the mission by returning to lobby or disconnecting.  Calls OCAP_recorder_fnc_eh_disconnected.

OCAP_EH_PlayerConnected

Handle for the “PlayerConnected” mission event handler.  Fired when a player joins the mission from lobby and appears in the world.  Calls OCAP_recorder_fnc_eh_connected.

OCAP_EH_OnUserAdminStateChanged

Handle for the “OnUserAdminStateChange” mission event handler.  Fired when a player’s admin status changes.  Calls OCAP_recorder_fnc_eh_onUserAdminStateChanged.

OCAP_EH_EntityKilled

Handle for the “EntityKilled” mission event handler.  Fired when an entity is killed.  Calls OCAP_recorder_fnc_eh_killed.

OCAP_EH_EntityRespawned

Handle for the “EntityRespawned” mission event handler.  Fired when an entity is respawned.  Sets new body to not-killed and calls OCAP_recorder_fnc_addUnitEventHandlers on it.  Then excludes corpse from further capture.

OCAP_EH_MPEnded

Handle for the “MPEnded” mission event handler.  Fired on the MPEnded mission event.  This is used to automatically save and export if OCAP_settings_saveMissionEnded is true and OCAP_settings_minMissionTime was reached.

OCAP_EH_Ended

Handle for the “Ended” mission event handler.  Fired on the singleplayer Ended mission event.  This is used to automatically save and export if OCAP_settings_saveMissionEnded is true and OCAP_settings_minMissionTime was reached.  Kept in just in case this event triggers.

CBA Events

Summary
Variables
CBA Listener Handles
CBA Events
ace_advanced_throwing_throwFiredXEHFired when a throwable is primed.
ace_explosives_placeEvent listener for ACE3 global event indicating a mine has been placed and armed.
OCAP_customEventEvent listener for custom event text to be added to the timeline.
OCAP_counterInitMeant for use in custom tracking of points or score between two sides.
OCAP_counterEventMeant for use in custom tracking of points or score between two sides.
OCAP_recordUsed to start or resume recording.
OCAP_pauseUsed to pause recording.
OCAP_exportDataUsed to stop recording & signal the extension to save and upload it to the web component.

Variables

CBA Listener Handles

OCAP_listener_aceThrowingHandle for ace_advanced_throwing_throwFiredXEH listener.
OCAP_listener_aceExplosivesHandle for ace_explosives_place listener.
OCAP_listener_customEventHandle for OCAP_customEvent listener.
OCAP_listener_counterInitHandle for OCAP_counterInit listener.
OCAP_listener_counterEventHandle for OCAP_counterEvent listener.
OCAP_counter_sidesSides that are tracked by the custom counter system.  [Array]
OCAP_listener_recordHandle for OCAP_record listener.
OCAP_listener_pauseHandle for OCAP_pause listener.
OCAP_listener_exportDataHandle for OCAP_exportData listener.

CBA Events

ace_advanced_throwing_throwFiredXEH

EGVAR(
   listener,
   aceThrowing
) = ["ace_advanced_throwing_throwFiredXEH", { _this call FUNC(eh_firedMan) }] call CBA_fnc_addEventHandler

Fired when a throwable is primed.  This is a global event the server will handle and forward to OCAP_recorder_fnc_eh_firedMan.  Created only if PBO “ace_advanced_throwing” is loaded.

ace_explosives_place

EGVAR(
   listener,
   aceExplosives
) = ["ace_explosives_place", { call FUNC(aceExplosives); }] call CBA_fnc_addEventHandler

Event listener for ACE3 global event indicating a mine has been placed and armed.  Calls OCAP_recorder_fnc_aceExplosives when triggered.  Created only if PBO “ace_explosives” is loaded.

OCAP_customEvent

Description

Event listener for custom event text to be added to the timeline.  Calls OCAP_recorder_fnc_handleCustomEvent when triggered.

Parameters

0Event name [String]
1Event data [Array]
1.0Always “generalEvent” [String]
1.1Custom event text [String]

Example

["OCAP_customEvent", ["generalEvent", "The warehouse has been secured!"]] call CBA_fnc_serverEvent;
[QGVARMAIN(customEvent), ["generalEvent", "The warehouse has been secured!"]] call CBA_fnc_serverEvent;

OCAP_counterInit

Description

Meant for use in custom tracking of points or score between two sides.  Separate from BIS_fnc_respawnTickets.  Initializes the system.  Calls <OCAP_recorder_fnc_counterInit> when triggered.

Parameters

0Event name [String]
1Key/value for one or more sides [Array]
1.0Pair [Array]
1.0.0Side <SIDE>
1.0.1Initial value [Number]

Example

["OCAP_counterInit", [
  [west, 0],
  [east, 0]
]] call CBA_fnc_serverEvent;

[QGVARMAIN(counterInit), [
  [west, 0],
  [east, 0]
]] call CBA_fnc_serverEvent;

OCAP_counterEvent

Description

Meant for use in custom tracking of points or score between two sides.  Separate from BIS_fnc_respawnTickets.  Updates the system.  Calls <OCAP_recorder_fnc_counterEvent> when triggered.

Parameters

0Event name [String]
1Event data [Array]
1.0Side <SIDE>
1.1Value to set [Number]

Example

["OCAP_counterEvent", [west, 1]] call CBA_fnc_serverEvent;

OCAP_record

Description

Used to start or resume recording.  Calls OCAP_recorder_fnc_startRecording when triggered.

Example

["OCAP_record"] call CBA_fnc_serverEvent;

OCAP_pause

Description

Used to pause recording.  Calls OCAP_recorder_fnc_stopRecording when triggered.

Example

["OCAP_pause"] call CBA_fnc_serverEvent;

OCAP_exportData

Description

Used to stop recording & signal the extension to save and upload it to the web component.  Calls OCAP_recorder_fnc_exportData when triggered.

Will always bypass OCAP_settings_minMissionTime.

Parameters

0Event name [String]
1Event data [Array]
1.0(optional) Winning side <SIDE>
1.1(optional) Message describing mission end [String]
1.2(optional) Custom save tag (overrides OCAP_settings_saveTag) [String]
EGVAR(
   listener,
   aceThrowing
) = ["ace_advanced_throwing_throwFiredXEH", { _this call FUNC(eh_firedMan) }] call CBA_fnc_addEventHandler
Fired when a throwable is primed.
EGVAR(
   listener,
   aceExplosives
) = ["ace_explosives_place", { call FUNC(aceExplosives); }] call CBA_fnc_addEventHandler
Event listener for ACE3 global event indicating a mine has been placed and armed.
Initializes event listeners, event handlers, gathers OCAP_version and OCAP_extension_version, and kicks off waiters for the auto-start conditions if settings are configured to enable it.
This function uses the OCAP_EH_HandleDisconnect event handler to log “disconnected” events to the timeline.
This function uses the OCAP_EH_Connected event handler to log “connected” events to the timeline.
Uses OCAP_EH_OnUserAdminStateChanged to detect when someone is has logged in or out of the server and calls OCAP_recorder_fnc_adminUIControl to update the admin UI.
Tracks when a unit is killed.
Used for applying unit-specific event handlers to units during initialization.
If true, automatically save and export the mission when the MPEnded event fires.
A recording must be at least this long (in minutes) to auto-save.
Event listener for custom event text to be added to the timeline.
Meant for use in custom tracking of points or score between two sides.
Meant for use in custom tracking of points or score between two sides.
Used to start or resume recording.
Used to pause recording.
Used to stop recording & signal the extension to save and upload it to the web component.
Tracks bullet and non-bullet projectiles.
Adds marker on the mine’s position to the recording timeline.
Sends custom event data to the extension to save it to the timeline.
Begins recording the current mission.
Stops recording the current mission.
This function facilitates the actual endMission and save events in the extension, prompting it to pack the mission and upload it to the web component.
If not overriden by the OCAP_exportData CBA event or if a mission is auto-saved, this will be used to categorize and filter the recording in the database and web list of missions.
Close