Jump to content

How to simulate BFM with AI - no weapons


ScopeDope

Recommended Posts

Looking for tips on how to accomplish the following:

 

- Have aggressor aircraft engage with me in BFM

- Set ROE to no live fire

- Force aggressor to "knock it off" and RTB

 

I've tried setting PUSH AI task to "switch waypoint" + "Reatction to Threat = No reaction" but when the trigger fires for him to RTB, he just keeps turn fighting with me. Poor sport?

 

I'd really like to set up a merge -> Dogfight -> Knock it off / reset -> Ok we're done RTB type scenario. Wish we could also do this with friendly units, but alas, stuck with USAF Aggressors.

Link to comment
Share on other sites

While waiting for an answer I added AI TASK PUSH (ROE = WEAPON HOLD) to the others and it seems to work. Is this the best way then I guess?

 

Now I've run into an issue where I can't seem to make him engage again.

 

What I'd really like is for the aggressor to:

 

- Orbit a point until player reports "ready" via F10 menu

- Begin engagement until "knock it off" via F10

- Return to said orbit

- Repeat until either bingo or player reports "RTB"

 

I can get him to engage if I leave his Task = CAP and keep the F10 menu out of it, but when I send him to orbit and report ready he just flys to the next WP, then goes home.

 

edit: I think my problem might be due to the fact if I give him no armament/guns he just doesn't want to try to engage at all. Just fly in a straight line. I don't really want him to shoot at me, but if I give him weapons and ROE = hold, I get the same passive action. Is there anything to be done or are we stuck with another DCS limitation?


Edited by ScopeDope
Link to comment
Share on other sites

I've been working on this for hours now and unless someone has a genius way to do this, I've settled on setting both units to immortal and actually shooting at each other.

 

I do however have a problem with my "looping" behavior that I want. After the first engagement, if either a/c are hit, or manually selected by the F10 menu, "knock it off" condition is applied and the agressor resets to the starting position and begins an orbit. When player selects "ready" from F10, the engagement begins again. This time, however the same "knock it off" condition will not fire when either aircraft are hit, nor when manually selected via F10.

 

Can someone look at the miz and tell me what's going on? I am clearing the flag that sets the knock it off, so it should fire again, but I can't tell what's wrong.

CAP 1v1.miz

Link to comment
Share on other sites

In testing, it seems that there are 2 roadblocks to what I'm trying to do. One is that UNIT HIT isn't a repeatable action, it is basically ON/OFF and can't be reset to OFF as far as I can tell. Also, it seems that GO TO WAYPOINT won't work a second time? So the engagement is limited to 2 tries, unless I put in a bunch of duplicate waypoints with different numbers and then figure out how to create some kind of trigger system to send him to different waypoints each time.

Link to comment
Share on other sites

Hi ScopeDope. You'll need to write some .lua in order to make this situation happen. What you're looking for is called an event handler, which will detect the "hit" event every time.

HitHandler = {}
function Handler:onEvent(event)
if event.id == world.event.S_EVENT_HIT 
then
trigger.action.setUserFlag('86', true) 
end

 

You can then create a standard GUI trigger looking for flag 86 to become true, indicating either you or the bandit has been hit.

 

3 SWITCHED CONDITION (Knock it off, NO EVENT)

============

FLAG IS TRUE (86)

FLAG IS FALSE (87)

============

MESSAGE TO ALL ('Knock it off, knock it off, return to your hold points.', 10)

AI TASK PUSH (*Bandit ROE =weapon hold*)

AI TASK PUSH (*Bandit REACTION TO THREAT = NONE*)

AI TASK PUSH (*Bandit go to hold point containing an orbit in advanced waypoint actions, with flag 1 as a stop condition*)

FLAG OFF (86)

FLAG ON (87)

RADIO ITEM ADD ('Fight's On', 1)

 

To re-engage-

 

3 SWITCHED CONDITION (Fight's on, NO EVENT)

================

FLAG IS TRUE (1)

================

AI TASK PUSH (*bandit ROE weapon free*)

AI TASK PUSH (*bandit REACTION TO THREAT = EVADE FIRE*)

AI TASK PUSH (*bandit CAP*)

**note- in your CAP triggered action, check the "stop condition" box and set the stop condition to IS USER FLAG 86 true; this will discontinue the cap tasking on it**

RADIO ITEM REMOVE (Fight's On)

FLAG OFF (86)

FLAG OFF (87)

FLAG OFF (1)

 

Add the event handler via a DO SCRIPT trigger at mission start, then after a second call the event handler using a second DO SCRIPT.

 

***EDIT***

Realized after consideration this could add multiple instances of the radio trigger for multiple hits. Adding a second flag check (FL87) should prevent this. A duplicate FLAG OFF(86) was also added to the "fight's on" trigger to cover accidental hits after "knock it off."


Edited by feefifofum
Link to comment
Share on other sites

  • 1 year later...
  • 3 months later...

*BUMP*

I've also tried to get this to work with no success.

I set up a once trigger with a condition time more than 30s and a do script which had the lua within it and it did not execute.

 

I added a putText action in to the script so it would notify if a hit occurs and I never see it. In fact, I put a putText action at the beginning of the lua code above to say it was executing the lua and that never printed either.

 

Only if I put the ONLY code in the do script being a putText saying "test" did it execute. So the issue is the lua somehow. Even though the putText is above the code provided in this thread it did not execute which suggests it checks the code before executing it and if it is no good it runs nothing.

 

I'm new to this lua DCS mission scripting and I can't find any great info for getting started and understanding how to put a lua script into a DO SCRIPT action.

 

I also tried adding a second knock-it-off switched condition trigger for a hard deck which had a condition logic of:

 

unit <pilot> in trigger zone <engagement zone>

unit <pilot> altitude below 10000

or

...and the list of other pilots in the AI only engagement scenario doing the same as above.

 

I seem to have assumed wrongly that if no "OR" is specified, that it is an implied AND above?

 

Because it seemed as soon as the AI flight entered the zone at 16000ft the hard deck knock it off triggered.

 

Does it cater for such logic as [ [ condition 1] && [ condition 2 ] || [ [ condition 3 ] && [ condition 4 ] ]

 

I've used bash style notation above so hope it makes sense.

 

Otherwise I guess I will need several knock it off statements, one per AI pilot unit in the engagement, not ideal :(

Link to comment
Share on other sites

  • Recently Browsing   0 members

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