Skip to content

Wave Start and Wave End Events

Ansible2 edited this page Feb 26, 2021 · 8 revisions

Relevant Files

  • Functions\Waves\fn_startWave.sqf (BLWK_fnc_startWave)
  • Functions\Waves\fn_endWave.sqf (BLWK_fnc_endWave)

Summary

As of 0.9, there are now scripted eventhandlers for the start and end of wave. This opens opportunities to execute code on a wave's start or end. These are remoteExec'd onto all machines (but not JIP). They are located in the missionNamespace.

The event names are:

  • BLWK_onWaveStart
  • BLWK_onWaveEnd

Execution Order

You can review the relevant files above for their exact execution position within the file, but in general, they are the last item called.

Usage

To use the events, simply add a scripted eventhandler with Bohemia's function BIS_fnc_addScriptedEventHandler. Don't forget to also remove the event with BIS_fnc_removeScriptedEventHandler if it is no longer relevant as it will continue to be called.

Examples:

myEventId = [missionNamespace,"BLWK_onWaveStart",{hint "a wave has started"}] call BIS_fnc_addScriptedEventHandler; [missionNamespace,"BLWK_onWaveStart",myEventId] call BIS_fnc_removeScriptedEventHandler;

Documentation

https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/ScriptedEventHandlers