Jump to content

Getting AI CAP to stay inside a zone?


moespeeds

Recommended Posts

I'm building a sort of open map for PG, where guys can log in, pick targets, and run missions in a map that's "Alive".

 

I'm really having trouble with the AI CAP.

 

Here's what I want to do:

 

Coastal airfields will have a single flight patrolling along the coast. On the tarmac, another flight or 2 will sit "AI off" and start if the airborne CAP are attacked or killed. This gives the Blue forces a chance to ambush the CAP and bomb subsequent flights on the tarmac.

 

I would like the CAP aircraft to chase any Blue AC that come into their zone, but break off and return to their WPs if the Blue forces leave the zone, or the AI CAP flies out of the zone.

 

I have tried this with multiple combinations of triggers. "ROE weapons HOLD", "Restrict A2A", "Reaction to threat", etc to no avail. I can get the CAP to stay inside their zone, but once engaged they will chase the Blue AC across the map.

 

I'd rather not get into scripting if at all possible. If there is no other option, can someone point me to a tutorial specific to this scenario? I'm willing to learn, but do not know where to start, or if it's even possible.

Moe "Moespeeds" Colontonio

vVMA 231

http://www.vvma-231.com/

Looking for a serious US based Harrier Squadron? We are recruiting!

 

Link to comment
Share on other sites

Delete the default "CAP" task and replace it with "search and engage in zone".

 

All of the default tasks like CAP, CAS, SEAD, Fighter Sweep, and Antiship basically allow AI to attack anywhere on the map that they detect their given targets. If you add a search and engage on top of it, its basically like saying "attack targets in this zone AND attack any target anywhere". So you gotta remove the ability to attack anywhere.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

You can also set a large zone that you want to be the boundary for the AI CAP and set some triggers that would make your AI flight change behaviour. In triggered actions menu add:

 

OPTION -> ROE -> WEAPON HOLD (or RETURN FIRE)

OPTION -> ROE -> WEAPON FREE

PERFORM COMMAND -> SWITCH WAYPOINT -> WP with orbit order

ENROUTE TASK -> Search and engage in zone / search and engage

 

Now make the mission detect that enemy fighters enter the zone you set up:

SWITCHED CONDITION -> PART OF COALITION IN ZONE (enemy coalition in set up zone) or PART OF GROUP IN ZONE (enemy specific group) -> FLAG ON X

SWITCHED CONDITION -> FLAG X TRUE -> AI TASK PUSH (CAP - weapons free), AI TASK PUSH (CAP - search and engage)

 

When enemy leaves the zone the following triggers should fire:

SWITCHED CONDITION -> FLAG X TRUE, ALL OF COALITION OUT OF ZONE or GROUP OUT OF ZONE (enemy flight) -> FLAG ON Y

SWITCHED CONDITION -> FLAG Y TRUE -> AI TASK PUSH (CAP - weapons hold), AI TASK PUSH (CAP - switch waypoint to orbit one)

SWITCHED CONDITION -> TIME SINE FLAG Y (20) -> FLAG OFF X, FLAG OFF Y

 

That should make the CAP flight react every time enemy flight enters the zone. Haven't tried it but I think it should work OK.

ce535d_9d347b62819c4372b3c485a4f95d2004~mv2.png
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...