TURCO_AR 5 Posted September 2, 2019 Greetings to all. I usually use this script to spawn (on trigger position) hunters to hunt the players (on foot) in my multiplayer mission (dedi) and its works perfect. But updating the mission and adding vehicles for the players I realized that when a player is inside a vehicle and activates the trigger and then gets off the vehicle and continues on foot, the hunters reach the position of the abandoned vehicle and stop there, do not continue chasing the player on foot. Any help or advice is welcome. Thank You! Trigger size: 390 x 390 Activation: Any Player ActType: Present Server Only: yes Cond: this OnAct: null = [thistrigger,thislist] execvm "4hunters.sqf"; 4hunters.sqf _PosTrigger = _this select 0; _objetives = _this select 1; _objetive = _objetives select 0; if (isserver) then { private ["_hunters", "_leaderhunters"]; _CountEnemies = {alive _x && side _x == independent} count allUnits; //Spawn hunters if less than 100 enemies on the map if (_CountEnemies < 100) then { _SpawnPos = position _PosTrigger ; _hunters = createGroup independent; _hunters = [_SpawnPos, independent, ["I_C_Soldier_Para_2_F","I_C_Soldier_Para_1_F","I_C_Soldier_Para_2_F","I_C_Soldier_Para_1_F"],[],[],[],[],[],260] call BIS_fnc_SpawnGroup; //Move to player position _leaderhunters = leader _hunters; _leaderhunters move (position _objetive); _hunters setCombatMode "RED"; _hunters setBehaviour "AWARE"; _hunters allowFleeing 0; 0 = [_hunters,_objetive] spawn { while {true} do { params ["_hunters","_objetive"]; sleep 3; //If the player who activates the trigger moves more than 400 meters away, the hunters are deleted if ((_objetive distance (leader _hunters)) > 400) exitWith { {deleteVehicle _x} forEach units _hunters; }; }; }; //When the hunters reach the position where the trigger is activated (and the player is not there) wait 3 sec and update the player's new position. while {true} do { // _leaderhunters = leader _hunters; if ((unitReady _leaderhunters) && {(alive _leaderhunters)}) then { sleep 3; if (({ alive _x} count (units _hunters)) != 0) then { _leaderhunters = leader _hunters; _leaderhunters move (position _objetive); _hunters setCombatMode "RED"; _hunters setBehaviour "AWARE"; _hunters allowFleeing 0;};};}; }; }; Share this post Link to post Share on other sites
Mr H. 402 Posted September 2, 2019 Don't know if it's relevant but BI made their own hunting function: https://community.bistudio.com/wiki/BIS_fnc_stalk 1 Share this post Link to post Share on other sites
Maff 251 Posted September 2, 2019 3 hours ago, TURCO_AR said: But updating the mission and adding vehicles for the players I realized that when a player is inside a vehicle and activates the trigger and then gets off the vehicle and continues on foot, the hunters reach the position of the abandoned vehicle and stop there, do not continue chasing the player on foot. Give the following a try: _objetive = vehicle (_objetives select 0); Share this post Link to post Share on other sites
TURCO_AR 5 Posted September 7, 2019 Thanks for answering Maff. It still doesn't work. The AI's remain in the position of the abandoned vehicle and do not update the location of the player on foot, as seen in the image below: Spoiler Share this post Link to post Share on other sites
Gunter Severloh 4065 Posted September 15, 2019 @TURCO_AR Did you sort out your issue here? If not i have on my AI compilation list (linked in my signature) a whole section of threads dedicated to this subject, maybe one of these threads has the answer you seek, check them out: AI Hunting player/group Make enemy know where player is http://tinyurl.com/y24hs8nv Script enemy chases player https://tinyurl.com/y8j6p9go How to make AI Hunt a player down while he is on the move?http://tinyurl.com/lp9h88u How to make AI KNOW where player is?http://tinyurl.com/mhej5mj AI to stalk player grouphttp://tinyurl.com/ojevr9a Sneaky Hunter AIhttp://tinyurl.com/k7mfpr2 Group chasing/hunting the playerhttp://tinyurl.com/oh8f74r Enemies follow players?http://tinyurl.com/nd3hmea Trying do make enemy hunt player script.http://tinyurl.com/mubku5g All remaining enemy Chase player/teamhttp://tinyurl.com/lkhn6d2 Making enemy units chase playerhttp://tinyurl.com/lr8ku6m AI hunting playerhttp://tinyurl.com/phm3e5w ============ Hope that helps! Share this post Link to post Share on other sites
Joe98 92 Posted September 15, 2019 On 9/7/2019 at 2:08 PM, TURCO_AR said: The AI's remain in the position of the abandoned vehicle and do not update the location of the player on foot,,,, To update the location of the player: Name the friendly unit blue1 name the enemy unit red1. Place a third man on the map, on a flat road, in an out of the way place. Name him green1 Set up some waypoints including a cycle waypoint so that green1 runs up the road 50 meters, turns around and runs back again 50 meters, turns around and runs up again 50 meters for ever and ever in a never ending loop. Set up a trigger in the middle of his route. When he enters the trigger, it activates. When he leaves the trigger it deactivates. You now type some script in two fields of the trigger, the activation field and the deactivation field; red1 move getPos blue1; red1 setCombatMode "RED"; ==================================================== The result is that whenever blue1 moves, red1 will always know his location and will constantly come looking for him. . Share this post Link to post Share on other sites