Jump to content
Ibragim A

Make AI move from point to point in an array

Recommended Posts

After calculating the path using the calculcatePath command and event handler, an array with positions is returned.

What could be the most efficient and correct way to move a unit through them, but other than adding waypoints to each of these positions?
Thanks!

Share this post


Link to post
Share on other sites

If there is a calculated path, that means the vehicle/unit will reach this position with a simple move or waypoint (under same conditions: type of vehicle/unit,behavior)

You just have to script for this destination. Waypoint is for group, while doMove is adapted for a unit.

Share this post


Link to post
Share on other sites
2 hours ago, pierremgi said:

If there is a calculated path, that means the vehicle/unit will reach this position with a simple move or waypoint (under same conditions: type of vehicle/unit,behavior)

You just have to script for this destination. Waypoint is for group, while doMove is adapted for a unit.

This is what I wanted to understand: is there any command or function like (group move array of positions) that uses the returned result of the calculatePath command, or do I need to script the movement from one point to another by myself manually.

Share this post


Link to post
Share on other sites
22 minutes ago, Ibragim A said:

This is what I wanted to understand: is there any command or function like (group move array of positions) that uses the returned result of the calculatePath command, or do I need to script the movement from one point to another by myself manually.

The calculated path returns key points (positions) for a destination, in regard of type of objects (vehicle's size, ability to take roads & footpaths, air asset... I guess) and the behavior (staying on road or not... as described in BIKI)

 

You can use setDriveOnPath command. I'm rather sure your vehicle will not follow these points, falling into combat mode, anyway.

 

 

 

Share this post


Link to post
Share on other sites

pierrwmgi - tell me why this setdriveonpath command is limited only to land units - this limitation cut possibility of direct command to ai of it's movement - for example make kamikaze unit or make cruse missile or torpedos  from air or water drone units or steering of huge ship units (parameters used in config like steerAheadSimul = 100;        predictTurnSimul = 100; not helping much with ship in carrier size - AI makes turns with too much oscilations and anyway it crash on coast sometimes - with this direct steering possibiity moders can make their own path calculations like A* for example.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×