Hunt - Theseus-Aegis/MissionTemplate GitHub Wiki

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 and select a random alive player who isn't in spectator and use them as a target.

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;
};
⚠️ **GitHub.com Fallback** ⚠️