Skip to content
Mike-MF edited this page Nov 20, 2023 · 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 because the performance of this function doesn't scale well it is now locked to a maximum of 6 hunter groups at any one time.

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