Jump to content

Rb 04E AI "Launch When I Do" Script


MBot

Recommended Posts

Our recent discussion on the Rb 04 made me think about better ways to allow single players to execute saturation attacks on warships (not that this is currently needed with the Rb 04 😉). So I went ahead and put together this little script.

What this does is to allow AI wingmen that are in formation to launch their Rb 04 anti-ship missile on cue when the player launches his own. No further radio commands or mission editor task setting required.

 

 

Setup for mission: Initialize the script using your preferred method in the mission editor (Do Script or Do Script File trigger). That's it.

Use: If your AI wingmen are in formation (considered within 200 m of player altitude and within 5000 m distance), they will automatically launch their Rb 04 when you do and immediately return to formation. Having your wingmen in a stable formation and aiming precisely at your target helps everything to go as smooth as possible (just like you would do with a human wingman).

Due to the way DCS works, AI can launch anti-ship missiles only on actual targets (no bearing launch only). The script will consider the closest target within 10° of your nose to be your intended target and that is what the AI will attack. If you launch into empty ocean, you wingmen will not launch as they need an actual target. Beware, if you launch on a friendly ship, your wingmen will do so too!

The default setting is that everybody in the flight launches on the same (the closest on your nose) target (saturation attack). If you want to attack a group of ships that are close together (convoy attack), you can change the first variable in the script to single_attack = false. Now your wingmen will distribute their fire amongst the targets.

The script is fixed to Rb 04E, as it is a very simple weapon to aim. It won't work with other missiles (RBS 15) as it doesn't really make much sense with more complex targeting.

Of course the AI might still show some wonky behaviour, but that just is DCS AI.

I didn't really stress test this that much, so if you find any scripting errors please let me know.

I hope you enjoy 🙂

Rb04_AI_LaunchWhenIDoScript.lua

 


Edited by MBot
  • Like 12
Link to comment
Share on other sites

  • 2 months later...

Thank you for this script. So nice that I don't have to try and force the AI to do what it should 🙂

System: MSI Z370 | i7 8700K | 32GB DDR4 | RTX 2080Ti | TM Warthog | Logitech Pro Rudder Pedals | Oculus Rift S

 

 

Modules: FC3 | UH-1H | SA342 | Spitfire | AJS-37 | F-5E | A-10C | M-2000C | AV-8B | F/A-18C | F-14 | C-101 | F-86F | MiG-21 | MiG-19P | MiG-15 | F-16C | JF-17 | L-39 | Mi-8MTV2 | KA-50 | Christen Eagle II | Yak-52 | Bf 109 K-4 | NTTR | Normandie | Persian Gulf | The Channel

Link to comment
Share on other sites

  • 2 months later...
  • Recently Browsing   0 members

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