Jump to content
Sign in to follow this  
araxiel

Have vehicles halt and engage enemies on the way, instead of zooming past and beelining for the WP

Recommended Posts

So, here's a thing I've been wondering since forever about waypoints and vehicle behavior:


Situation: There's a waypoint some distance away. Between the current unit's location and the waypoint are a couple of enemies.

For infantry, when given a normal Move waypoint, unless they're set to Careless, they will always halt to engage any enemy they spot on the way, and only continue onwards once the area is clear.
But vehicles will always drive past any enemies and beeline for the waypoint. The gunners might start shooting at them, but as a whole, the vehicle will just zoom past in a mad-dash to reach the waypoint, no matter the situation. Even when set to Combat and Slow speed.
Search and Destroy also only starts, once the vehicle reaches the WP, and will similarly zoom past any enemy to the WP.

My question is the following: What kind of waypoint type and/or other settings would I need, to have a vehicle halt and engage an enemy they spot on the way?

This would especially useful to know when it comes to something like telling vehicles to attack a city, and have them attack enemies on approach, instead of blasting towards the city-center without support, just to get RPG'd in the butt.

Basically, an attack-move in an RTS game.

P.S. I understand that in theory, one could manually place a whole legion of waypoints and triggers and some complicated conditions and whatnot, but not only is that immensely time intensive, it's also incredibly messy when it comes to creating dynamic waypoints in scripts for e.g. created units.

  • Like 1

Share this post


Link to post
Share on other sites

I have always thought this should be something easily done in the editor, but sadly you're right that the kind of triggers and extra waypoints it takes become very messy.

I think the best way to do it instead is using a trigger and/or scripts to add a new waypoint (possibly a new seek & destroy waypoint at their current location, or a place nearby from which they'll be able to engage the spotted enemies) immediately before the one they were going to, and set that as their current waypoint.  Check out the documentation for addWaypoint, setCurrentWaypoint, and currentWaypoint.  You can provide an index to addWaypoint that will place it immediately before the waypoint they were already going to, use currentWaypoint to find out what that waypoint's index is. Unfortunately the whole process may require a bit of trial and error as you get used to the scripting side of it.

 

Also check out the other pages on waypoints at the wiki.

 

Sorry, I wish I had a simpler answer but maybe someone else has some ideas.

  • Like 1

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
Sign in to follow this  

×