captainflash55 0 Posted April 14, 2019 Hello. I am very new to coding. I need a code/script to make enemies know where all the player location are and follow them (they do it automatically anyway?) Basically i need to make the AI know the location of all player and hunt them down, even if they where spawned in via script or already ingame. preferably in a loop maybe? so they get updated, i donno every 30 seconds? or more. Im very new and bad at coding, i tried reading up on it. but i failed. i tried google it, but to be real, i dont really know what to look for. Thanks. This is the last part of my mission to get it fully functional. Share this post Link to post Share on other sites
Crazy_Man 36 Posted April 14, 2019 Execute this script in your initServer.sqf : while {true} do { _allPlayers = allPlayers; { if ((side _x) == east) then // put the right ennemy side { for "_i" from 0 to count _allplayers -1 do { _x reveal [(_allplayers) select _i, 4]; }; }; } forEach allUnits; sleep 30; // every 30 seconds }; Share this post Link to post Share on other sites
captainflash55 0 Posted April 14, 2019 I dont even understand the code haha, but thanks, i will try it. thanks again. Share this post Link to post Share on other sites
Gunter Severloh 3949 Posted April 14, 2019 These are all the collected threads for the AI to hunt, or chase the player from my AI Compilation list linked in my sig, hope these can further help you if you need it. 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 2 Share this post Link to post Share on other sites