natanbrody 10 Posted July 15, 2013 Could someone explain to me a way to get an enemy squad to follow the players unit as if they were an elite tracker team. Thanks in advance!! Share this post Link to post Share on other sites
kylania 568 Posted July 15, 2013 Loop a getPos player and move the enemy's waypoint there or just tell the Ai to go to that spot. Share this post Link to post Share on other sites
natanbrody 10 Posted July 15, 2013 In simpler terms.... :D Share this post Link to post Share on other sites
kylania 568 Posted July 15, 2013 This but instead of moving a marker you move a waypoint. :) Super busy today, but if you don't figure it out soon I'll put more code up in a bit. Share this post Link to post Share on other sites
natanbrody 10 Posted July 15, 2013 could you post up the code if you have time :D Share this post Link to post Share on other sites
Larrow 2823 Posted July 15, 2013 (edited) Here a little code to get you going, may need a little editing depending on where you want to implement this. e,g in unit init box or from a trigger or script etc trackerGroup = group trackerLeader; trackerCurrentWP = currentWaypoint trackerGroup; if (trackerCurrentWP == count waypoints trackerGroup) then { trackerGroup addWaypoint [(getPosATL player), 2, trackerCurrentWP]; }; handle = [trackerGroup, trackerCurrentWP] spawn { while {alive player} do { _this setWaypointPosition [(getPosATL player),2]; sleep 10; }; }; Commented code //get the group from the name of one of the units (trackerleader) //replace trackerleader with this if putting code in a units init box trackerGroup = group trackerLeader; //get current waypoint index trackerCurrentWP = currentWaypoint trackerGroup; //if current == total number of waypoints //then all waypoints have been completed if (trackerCurrentWP == count waypoints trackerGroup) then { //add a new waypoint trackerGroup addWaypoint [(getPosATL player), 2, trackerCurrentWP]; //add other commands here to set waypoint cobat mode etc }; //create a new thread, pass in current waypoint handle = [trackerGroup, trackerCurrentWP] spawn { while {alive player} do { //update waypoint position to players position every 10 seconds _this setWaypointPosition [(getPosATL player),2]; sleep 10; }; }; test mission Stepping into the trigger will either:- change their current waypoint to the players position every 10 seconds or if the group have finished their waypoints, will add a new waypoint to track the player every 10 seconds Edited July 15, 2013 by Larrow 1 Share this post Link to post Share on other sites
natanbrody 10 Posted July 16, 2013 where would i implement this code? trigger or a unit's init box? Share this post Link to post Share on other sites
ProfTournesol 956 Posted July 16, 2013 Something easy : put "guard" WP for the ofpor groups and reveal them where the player is by writing this in each of their leader init line : group this reveal player Share this post Link to post Share on other sites
natanbrody 10 Posted July 16, 2013 And this will make them follow me? Share this post Link to post Share on other sites