Jump to content

Recommended Posts

Posted (edited)

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 14
  • Thanks 1
  • 2 months later...
Posted

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

  • 2 months later...
  • 3 months later...
Posted

WOW this is great!  Will it work with multiplayer CLIENT slots, or only PLAYER slots?

For example, could my friend and I each lead a flight of 3 other AI fighters in separate groups and they would each fire when we do?

Posted
On 5/22/2024 at 5:49 AM, HawkEXO said:

WOW this is great!  Will it work with multiplayer CLIENT slots, or only PLAYER slots?

For example, could my friend and I each lead a flight of 3 other AI fighters in separate groups and they would each fire when we do?

I have never tested it, but I think it should also work in MP.

Posted (edited)
1 hour ago, MBot said:

I have never tested it, but I think it should also work in MP.

 

Hi, just wanted to take this opportunity to thank you for this Script 🙏. I made use of it on my Rb04E training mission (on minute 12:02) and it works flawlessly:

 

 

This mission is not MP, but I do use "Client" slots rather than "Player", and the Script still works. 👍

Best regards,

 

Eduardo

Edited by Rudel_chw
  • Like 2

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600 - 32 GB DDR4 2400 - nVidia RTX2080 - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar

Mobile: iPad Pro 12.9" of 256 GB

  • 2 weeks later...
Posted

Maybe I'm doing something wrong, but the wingmen still attack the same target (even if I change first line in the script "local single_attack = true" to "local single_attack = false"). Do I need to do something else?

  • Recently Browsing   0 members

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