Jump to content
johnnyboy

Forced AI Movement via scripted Waypoints

Recommended Posts

I'm releasing a new scripted solution for forcing units to move through a set path using waypoints.  This allows AI to move on surfaces or places in building that their normal AI pathing does not support.  Should be very useful for cutscenes, and filling bases and towns with immersive looking AI.

 

Download sample mission with scripts here.

  • Like 5
  • Thanks 4

Share this post


Link to post
Share on other sites

Super cool stuff JB, nice to see you wrangling with A3's crazy AI again. :rthumb:    

  • Thanks 1

Share this post


Link to post
Share on other sites

Nice work JB. I wonder if this works for something like tanks crossing a bridge.

I've been using your boat script (Vietnam)  so far and for the most part been having good luck with it.

👍

Share this post


Link to post
Share on other sites
30 minutes ago, fawlty said:

Nice work JB. I wonder if this works for something like tanks crossing a bridge.

I've been using your boat script (Vietnam)  so far and for the most part been having good luck with it.

👍

Thanks dude.  This script will def not work for vehicles.  It forces infantry animations to move infantry AI units.

 

I'm glad the boat script is working for you.  I love making little combat scenarios with that.  A similar technique can be used for tanks and bridges.  You need eachFrame eventhandler to continually push tank forward using setVelocityModelSpace to make that work.  I did something similar for the Last Tango In Tanoa Heist mission for the chase sequence.  The bandit truck the player is chasing has triggers on its straight road sections that use setVelocityModelSpace to force AI truck to go fast and make chase more interesting.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Hi JB,

 

Look’n Real Good - I hope you consulted the Secret Service manual before putting people at risk - on such a “slopey” roof.

😉

 

Regards,

Scott

 

 

  • Haha 2

Share this post


Link to post
Share on other sites
On 9/11/2024 at 7:47 PM, fawlty said:

Хорошая работа, Джей Би. Интересно, сработает ли это, например, с танками, пересекающими мост.

Я до сих пор пользуюсь вашим сценарием про лодку (Вьетнам) и по большей части мне с ним везет.

👍

_bridges = ((nearestObjects [_vehicle, [], 20]) select {str _x find "bridge" > -1});
if (count _bridges > 0 || (surfaceIsWater (getpos _vehicle))) then {
  private _vel = velocityModelSpace _vehicle;
  private _vel1 = _vel select 1;
  _vel set [1, 4 + _vel1];
  _vehicle setVelocityModelSpace _vel;
};

 

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

@dimon That's very cool, thanks for sharing it.  The "near bridge object" + surfaceIsWater is  a smart detection for on bridge.  That loop could be further improved to slowly align vehicle's direction with bridge's direction as well, which should help with longer bridges, and especially those without guard rails like in the Prairie Fire maps.

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

×