Skip to content
Mike-MF edited this page Mar 31, 2024 · 4 revisions

This page will explain the usage of the Hunt function.


/*
 * 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.
 * Hunt groups are capped to a maximum of 6 for performance reasons.
 *
 * Call on the server.
 *
 * Arguments
 * 0: Hunter Group <GROUP>
 * 1: Waypoint Refresh <NUMBER> (Optional - Default: 10)
 * 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