This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tmf:wavespawner [2016/07/26 09:21]
head [Wave spawner]
tmf:wavespawner [2017/07/16 11:49] (current)
Line 2: Line 2:
 [[#headless client support|{{:​tmf:​hcicon.png}}]] [[#trigger support|{{:​tmf:​triggericon.png}}]] [[#headless client support|{{:​tmf:​hcicon.png}}]] [[#trigger support|{{:​tmf:​triggericon.png}}]]
-The wave spawner is a powerful tool for a wide variety of reason.+The wave spawner is a powerful tool for a wide variety of reason. Any units that are synced to the wave spawner will be replicated when the wave spawner activates. When the mission loads they will be deleted and data on them stored (loadouts and waypoints).
 The wave spawner works with triggers or without. The wave spawner works with triggers or without.
Line 22: Line 22:
 {{:​tmf:​pcpupax.png|}} {{:​tmf:​pcpupax.png|}}
 +=====  API - Event handler =====
 +==== On wave spawn event ====
 +You can add an event handler via the TMF function //​tmf_ai_fnc_addWaveHandler//​ . The event handler is executed everytime a wave is spawned. This code can be placed on the init box of the wave spawner module.
 +The parameters passed to the event handler is an array consisting of: [wave_index,​array of groups]
 +Example 1: Set all spawned units to move fast and free to engage any enemies. Perhaps for spawned reinforcements.
 +<code cpp>
 +    private _groups = _this select 1;
 +    {
 +        _x setBehaviour "​AWARE"; ​
 +        _x setCombatMode "​RED"; ​
 +        _x setSpeedMode "​FULL";​
 +    } forEach _groups;
 +}] call tmf_ai_fnc_addWaveHandler;​
 +Example 2: Handle the output in a seperately defined function.
 +<code cpp>
 +[this,​my_custom_function] call tmf_ai_fnc_addWaveHandler;​
  • tmf/wavespawner.txt
  • Last modified: 2017/07/16 11:49
  • by snippers