Jump to content

How to get AI to move to next waypoint after a 'Command attack area'


Recommended Posts

GSHWK_Houndstone_Hawk
Posted

Hi. As the title suggests, I'm having issues in getting the AI to finish patrolling and getting to next waypoint.

 

My mission is mp3/jpeg-heavy and too big to post here but I've initially had a low priority waypoint 2 with a Command Attack Area MCU t/linked from it (set to High priority, same altitude as WP, to attack air targets and timing set to 4 minutes). After enemy engagement, they will continually patrol, ignoring the 4 minute time scale (so what good that time scale box is I do not know).

 

So I decided to run an event trigger 'OnKilled' from the enemy AI planes, to a Trigger Counter  MCU (number set to correspond to the number of AI enemy), then T/link this counter to a Trigger Deactivate, then in turn, t/link the deactivate to the Command Attack Area MCU. That didn't work.

 

Next I tried replacing the Trigger Deactivate with a Force Complete MCU ('OnKilled' (e/l) from AI enemy -> Trigger Counter (t/l) -> Force Complete, then obj/link to friendly AI.

This didn't work.

 

Am I missing something quite obvious? Do i link waypoint 2 from the force complete in someway?

 

Any help as per usual would be great.

 

HH

 

AEthelraedUnraed
Posted (edited)

After a command expires, an entity doesn't automatically revert to its previous command. If you want the aircraft to go to a next waypoint once the 4m AttackArea expires, you should use an OnAreaAttacked message with the waypoint as target.

 

If you want to use other criteria to proceed with the mission, use a Force Complete (as you tried), but follow this up with a 1s timer that links to the next waypoint. To explain, Force Complete cancels whatever command the flight currently had, whether that's an AttackArea, a Waypoint or whatever else. Since a flight can only have one active command, it means it cancels *all* commands. Therefore, you need to give the proper command again after the ForceComplete. The 1s timer makes sure it actually happens afterwards and not 1ms before.

Edited by AEthelraedUnraed
  • Like 1
  • Thanks 1
  • Upvote 1
Posted

I use Sketchs command stop works 9/10 times...

 

image.jpeg

  • Upvote 2
Posted

I would recommend this...

 

Spoiler

image.png.d0c7ee0becfb066f8818ec70b7115f7e.png

 

Trigger your attack area as you like. Waypoint, Checkzone, etc.

When enemy plane is damaged or killed, use "onDamaged" or "onKilled" to trigger 1 minute timer, giving you enough time to see it go down if PK occurs.

You can also use a complex trigger with "FiredRockets" "DroppedBombs", BingoBombs", etc. to trigger the egress if it's a ground attack.

1 minute timer triggers "Deactivate" to command attack area and a 1 second timer

1 second timer triggers Force Complete to Player AC, clearing the Attack Area command from it's AI memory, and another 1 second timer.

The last 1 second timer triggers new Waypoint to leave the area.

 

This also works for the Escort Command which is more persistent.

Formation commands are not cleared by Force Complete as some have stated.

This always works unless there is a temporary AI bug.

The only down side is that you get a radio message saying "Return to formation and resume the mission" from the Force Complete command

 

  • Thanks 1
GSHWK_Houndstone_Hawk
Posted
9 hours ago, Jaegermeister said:

I would recommend this...

 

  Reveal hidden contents

image.png.d0c7ee0becfb066f8818ec70b7115f7e.png

 

Trigger your attack area as you like. Waypoint, Checkzone, etc.

When enemy plane is damaged or killed, use "onDamaged" or "onKilled" to trigger 1 minute timer, giving you enough time to see it go down if PK occurs.

You can also use a complex trigger with "FiredRockets" "DroppedBombs", BingoBombs", etc. to trigger the egress if it's a ground attack.

1 minute timer triggers "Deactivate" to command attack area and a 1 second timer

1 second timer triggers Force Complete to Player AC, clearing the Attack Area command from it's AI memory, and another 1 second timer.

The last 1 second timer triggers new Waypoint to leave the area.

 

This also works for the Escort Command which is more persistent.

Formation commands are not cleared by Force Complete as some have stated.

This always works unless there is a temporary AI bug.

The only down side is that you get a radio message saying "Return to formation and resume the mission" from the Force Complete command

 

This is wonderful sir and just what I was looking for. Thank you so much once again for your time & efforts. Very much appreciated indeed. ?

  • Upvote 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...