wiggum2 31 Posted October 21, 2011 Hi ! Im just wondering, what is the exact difference between these three ? With all these commands i can order a group to mave to a specific position, but i believe there is a difference in the AI behaviour while moving. Maybe its just me, but i think with addWaypoit they react better to enemys while still on the way to the location. So, can anyone tell me what is the difference between these 3 commands respective AI behaviour while on the move ? Or maybe its all the same, then i would like to know which one is the best for moving AI under combat conditions. Or maybe one of the commands has other pros (like the addWaypoint with all the options i can add). What is the easiest way to add some randomness to a move/doMove command ? Just like you can do it with addWaypoint: _wp = grp addWaypoint [position player, 50] The 50 will be the location where the waypoint is placed randomly around the given center. Is there a simple way to do the same with move/doMove ? Share this post Link to post Share on other sites
demonized 20 Posted October 21, 2011 when you issue a doMove command, AI beheaves default no matter what the beheaviour was set to before the command, so a unit in stealth mode never fire, will move in aware fire at will after a domove, set beheaviour again after domove command is issued and its good again. addwaypoint, well you know what you can do with it and you can chain in several destinations and beheaviour in that unlike domove and move wich is single destinations. move and addwaypoint beheaves similar, difference is move is 1 single temp wp, addwaipoint you can chain severals. domove is a command wich when completed unit returns to formation or is ready to get targets assigned by AI leader again. A AI unit given a domove command will never be given (afaik) a attack command by his AI leader until he has completed his move and is ready. with both move and addwaypoint such commands can be given distracting the units from their current movement. So, if you need a single unit from a group or unit alone to move somewhere without being distracted by leader, use doMove, unit will still fire on immediate treats, but movement is priority and leader of group will not give additional orders until move is completed, for all else use addwaypoint or move. For randomness in move and doMove positions, just use x y with random numbers, there is another way, though i dont have the formula handy atm. car position, random 100 meter radius: _here = getPos car; unit doMove [(_here select 0) + ((random 100)+(random -100)), (_here select 1) + ((random 100)+(random -100)), 0]; Share this post Link to post Share on other sites
zapat 56 Posted October 21, 2011 I haven't experienced any behavioural difference between doMove and move. Maybe it is just me though, after reading Demoonized's post. My addition to the above: doMove and doStop can be used one after another: 1. (units _grp) doMove _moveTo; // the group will move to moveTo 2. doStop (units _grp); // group will stop; 3. (units _grp) doMove _moveTo; //group will continue. You cannot use doStop with move and waypoints. Once doStop is ordered, a doMove will be needed to get them moving again, a simple move or waypoint won't be enough. Share this post Link to post Share on other sites
roguetrooper 2 Posted October 21, 2011 Demonized already mentioned how to randomize doMove. Here's another method, which calculates a random point within a circle with _radius and the center coordinates _x and _y: _radius = 100; _x and _y = "coordinates or the position of an object/marker"; _dir = random 360; _pos = [(_x + (random _radius) * sin _dir), (_y + (random _radius) * cos _dir), 0]; unit doMove _pos; Share this post Link to post Share on other sites
wiggum2 31 Posted October 23, 2011 Is there any better way to check if a waypoint is completed then with setWaypointStatements ? Share this post Link to post Share on other sites
f2k sel 164 Posted October 23, 2011 You cannot use doStop with move and waypoints. Once doStop is ordered, a doMove will be needed to get them moving again, a simple move or waypoint won't be enough. correct but you can use unit stop true and unit stop false with a waypoint. Share this post Link to post Share on other sites
zapat 56 Posted October 23, 2011 (edited) F2K Sel: that is correct, but doStop and stop are not the same: Stop completely stops a unit, doStop is more loose, afaik. doStop handles more units, stop does not. (stop: Stopped unit will not be able to move, fire, or change its orientation to follow a watched object doStop: It will prevent the unit from moving around with their group (or formation leader), while still beeing able to turn around and even move to a new position if they see fit. They will still respond to orders from their group leader ) Move moves a group, stop stops a unit. DoMove, doStop both works for array of units. Allinall I rather use doMove - doStop combo for dynamic waypoints. Wiki says doMove/doStop separates the unit from its group, but if I am moving all units together they behave as a group. But to narrow OP's question: is there a differnce between doMove-doStop and move-stop regarding behaviour? (If I understood correctly Demonized is not sure in what he wrote about it.) Edited October 23, 2011 by zapat Share this post Link to post Share on other sites