Jump to content
itscolt

Make AI ignore a waypoint until triggered

Recommended Posts

Hi, I'm stumped.

 

I want my enemy AI to ignore a waypoint until a trigger is activated. I've looked this up and most of the replies are saying to disable the AI's movement until the trigger is activated. This is not what I want. I want my AI to act normally (eg. engage in combat, follow predefined waypoints, etc.) until this trigger is activated, then have them move to this waypoint. Is this possible?

 

Thanks for any replies.

Share this post


Link to post
Share on other sites

Hello, Welcome to Bis forums!


Normally you would just sync the trigger to the waypoint, and the AI following wouldn't move beyond that waypoint until the trigger was activated.

A simple trigger could be an area trigger synced to your friendlies waypoint,  when the enemy enter the area ahead it will trigger and unlink the waypoint and

the friendly you have will move forward and follow the waypoint.

 

Is that generally what your after?

 

When you have the chance review my AI compilation list, its a massive reference for everything AI related:

https://forums.bistudio.com/forums/topic/165560-ai-compilation-list-of-addonsmodsscripts-threads-for-arma3/?page=1

  • Like 1

Share this post


Link to post
Share on other sites
12 minutes ago, Gunter Severloh said:

Hello, Welcome to Bis forums!


Normally you would just sync the trigger to the waypoint, and the AI following wouldn't move beyond that waypoint until the trigger was activated.

A simple trigger could be an area trigger synced to your friendlies waypoint,  when the enemy enter the area ahead it will trigger and unlink the waypoint and

the friendly you have will move forward and follow the waypoint.

 

Is that generally what your after?

 

When you have the chance review my AI compilation list, its a massive reference for everything AI related:

https://forums.bistudio.com/forums/topic/165560-ai-compilation-list-of-addonsmodsscripts-threads-for-arma3/?page=1

 

Not exactly.

 

To go into further detail would be that I am playing blufor, the enemy is opfor. I'd like to kill an opfor target and upon his death all opfor units to stop what they're doing and move to the location near his body (the waypoint). Right now I have a trigger for his death and a waypoint I want opfor to move to but they ignore the trigger and move there when I start this mission. I don't have any predefined intstructions for every unit before this trigger other than follow their leader.

 

Syncing the trigger and the waypoint doesn't do anything, they just ignore the trigger and move there when the mission starts.

Share this post


Link to post
Share on other sites

You need a trigger with an area covering the Reds who have to reach the position. OFFOR present.

condition (same as your trigger or triggerActivated yourTrigger or !alive bob  ... ). could be the same trigger if you don't have an area already.

in init field:

0 = thisList spawn {
  _units= _this;
   _grps = allGroups select {leader _x in _units};

  {

     while {(count (waypoints _x)) > 0} do {  deleteWaypoint ((waypoints _x) select 0) };

     _x addWaypoint [getpos bob,0];

  } foreach _grps;

};

 

Replace getpos bob with your own position, of course.

 

  • Like 1

Share this post


Link to post
Share on other sites
23 minutes ago, pierremgi said:

You need a trigger with an area covering the Reds who have to reach the position. OFFOR present.

condition (same as your trigger or triggerActivated yourTrigger or !alive bob  ... ). could be the same trigger if you don't have an area already.

in init field:

0 = thisList spawn {
  _units= _this;
   _grps = allGroups select {leader _x in _units};

  {

     while {(count (waypoints _x)) > 0} do {  deleteWaypoint ((waypoints _x) select 0) };

     _x addWaypoint [getpos bob,0];

  } foreach _grps;

};

 

Replace getpos bob with your own position, of course.

 

 

Works perfectly, thank you!

Share this post


Link to post
Share on other sites

You can also use a hold waypoint and link it to a trigger.

The group will remain and the hold waypoints position until the triggers condition returns true.

 

Cheers

Share this post


Link to post
Share on other sites

And another alternative is to put the following in the waypoint where you want them to wait or hold.  I often use a "Talk" waypoint for this...not doing any talking, just a place to put this lockwp line.

this lockwp true;

And then in your trigger (or some script somewhere that is monitoring this condition), you unlock the waypoint.  So if the waypoints were for a unit or group named BadAssMuthaFuggas, you would put this line into the trigger activation:

BadAssMuthaFuggas lockwp false;

There are many paths up the mountain!

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

×