Skip to content
Mike-MF edited this page Dec 30, 2022 · 4 revisions

This page will explain the usage of the Hunt function. It can automatically be called from the Reinforcements function too.


/*
 * Author: Mike
 * Has an enemy group hunt a player group.
 * If no hunted group is given it will select nearest player group within a given distance and target those.
 *
 * Call from Trigger with (isServer) check.
 *
 * Arguments
 * 0: Hunter Group <GROUP>
 * 1: Waypoint Refresh <NUMBER> (Optional - Default: 5)
 * 2: Hunted Group <GROUP> (Optional - Default grpNull)
 * 2: Search Distance <NUMBER> (Optional - Default 1000)
 *
 * Return Value:
 * None
 *
 * Example:
 * [Enemy_Group] call MFUNC(hunt)
 * [Enemy_Group, 10] call MFUNC(hunt)
 * [Enemy_Group, nil, Player_Group] call MFUNC(hunt)
 * [Enemy_Group, nil, nil, 2000] call MFUNC(hunt)
 */

Usage

This function will take a provided group or select the closest player group within a set radius and actively hunt them down until one group is dead.

The defaults provided are quite performance friendly but it is still good practice to not have too many "hunter" groups at once.

Called from a trigger with a server check or initServer.sqf

Example:

if (isServer) then {
    [My_Enemy_Group] call TAC_Mission_fnc_hunt;
};

Example without defaults:

if (isServer) then {
    [My_Enemy_Group, 10, nil, 2000] call TAC_Mission_fnc_hunt;
};
Clone this wiki locally