{"name":"BIS_fnc_stalk","operator":null,"title":"BIS fnc stalk","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_stalk","revid":327438,"updated":"2022-07-12T22:12:09Z","groups":["Object Manipulation","Combat"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.00"}],"since":{"game":"arma3","name":"Arma 3","version":"1.00"},"arma3_since":"1.00","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":"spawn","description":"Continuously set WP of one group to a different group to hunt it. It does not change the group's behaviour.\n\nScript terminates if one of the groups is eliminated or if the optional condition is activated.","syntaxes":[{"syntax":"[stalker, stalked, refresh, radius, endCondition, endDestination] spawn BIS_fnc_stalk","since":null,"effect":null,"exec":null,"params":[{"name":"stalker","type":"Group","optional":false,"default":null,"description":"the group that will move towards the other","types":["Group"],"since":null,"text":"stalker: Group - the group that will move towards the other"},{"name":"stalked","type":"Group","optional":false,"default":null,"description":"the group that will be followed","types":["Group"],"since":null,"text":"stalked: Group - the group that will be followed"},{"name":"refresh","type":"Number","optional":true,"default":"10, minimum 5","description":"time between waypoint updates","types":["Number"],"since":null,"text":"refresh: Number - (Optional, default 10, minimum 5) time between waypoint updates"},{"name":"radius","type":"Number","optional":true,"default":"0, minimum 0","description":"waypoint \"precision\"","types":["Number"],"since":null,"text":"radius: Number - (Optional, default 0, minimum 0) waypoint \"precision\""},{"name":"endCondition","type":"Code","optional":true,"default":"{false}","description":"condition that if true stops *stalker* to follow *stalked*","types":["Code"],"since":null,"text":"endCondition: Code - (Optional, default {false}) condition that if true stops *stalker* to follow *stalked*"},{"name":"endDestination","type":"String or Position or Object or Number","optional":true,"default":"0","description":"destination *stalker* will go after *endCondition* is met (or *stalked* is killed)\n- String - destination marker name\n- Position - destination\n- Object - destination\n- Number\n  - 0: return to original group waypoints\n  - 1: search around their current stalking position, in a 50m radius\n  - 2: return to the original position before stalking","types":["String","Position","Object","Number"],"since":null,"text":"endDestination: String or Position or Object or Number - (Optional, default 0) destination *stalker* will go after *endCondition* is met (or *stalked* is killed)\n- String - destination marker name\n- Position - destination\n- Object - destination\n- Number\n  - 0: return to original group waypoints\n  - 1: search around their current stalking position, in a 50m radius\n  - 2: return to the original position before stalking"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"true when done","text":"Boolean - true when done"}}],"examples":[{"text":"```sqf\nprivate _stalking = [BIS_grpStalkers, BIS_grpPlayer] spawn BIS_fnc_stalk;\n```","code":["private _stalking = [BIS_grpStalkers, BIS_grpPlayer] spawn BIS_fnc_stalk;"]},{"text":"```sqf\nprivate _stalking = [grp1, group player, nil, nil, { player distance BIS_Heli < 100 }, \"BIS_mrkRetreatMarker\"] spawn BIS_fnc_stalk;\n```","code":["private _stalking = [grp1, group player, nil, nil, { player distance BIS_Heli < 100 }, \"BIS_mrkRetreatMarker\"] spawn BIS_fnc_stalk;"]},{"text":"```sqf\nprivate _stalking = [BIS_grpStalkers, BIS_grpPlayer, 20, 10, { BIS_Return }, 1] spawn BIS_fnc_stalk;\n```","code":["private _stalking = [BIS_grpStalkers, BIS_grpPlayer, 20, 10, { BIS_Return }, 1] spawn BIS_fnc_stalk;"]},{"text":"```sqf\nprivate _stalking = [BIS_grpStalkers, BIS_grpPlayer, 5, 0, { dayTime > 20 }, [3600,600,0]] spawn BIS_fnc_stalk;\n```","code":["private _stalking = [BIS_grpStalkers, BIS_grpPlayer, 5, 0, { dayTime > 20 }, [3600,600,0]] spawn BIS_fnc_stalk;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["BIS_fnc_spawnGroup"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Combat","Function Group: Object Manipulation","Functions","Introduced with Arma 3 version 1.00"],"docblock":null,"filled_from_docblock":[]}