609_Relentov Posted July 26, 2023 Posted July 26, 2023 (edited) Greetings script writers and users. I've made available my OpForAC lua script in the User Files downloads section. This script will spawn 1-4 opposing force AI aircraft (repeatable), which can be fighter, attack, bomber, trainer aircraft, or helicopter types. AI aircraft types, engagement scenarios (i.e. BVR, ACM) and pre-set spawn distances are selectable from the F10 menu, under the F10 menu item: "Spawn AI OpFor Aircraft At Will". See the image below to see some of the F10 menu items. Basically, I wrote this script to simplify creating training/practice missions with opposing aircraft to fly and fight against. I wanted to avoid having to create multiple sets of late activation opposing AI aircraft types, with various loadouts, and all the triggers to spawn them. So this script was written to allow a Player (for single mission) or Client (for single or multiplayer mission) to call up opposing AI aircraft at will, without having to create any in the mission. Also, it has some options that will persist as long as the mission is active (i.e. it does not write to a file, but to tables), including: - AI aircraft skill (default = random) - AI aircraft altitude AGL (default = random) - AI aircraft direction towards your player/client aircraft (default = 180 degrees from you) I've had fun with it, and thought why not share, as some of you may find it fun as well for practicing against opposing AI aircraft. Here's the link to the script in user files: https://www.digitalcombatsimulator.com/en/files/3332275/ Good luck and have fun. AKA_Relent *** Features: *** Version 1.5 AI OpFor aircraft coalition will be opposing the coalition of the aircraft or helicopter the client (MP) or player (SP) spawns in. OpForAC script now works for dynamic spawn slots in MP missions The same AI OpFor aircraft type can be re-spawned as many times as desired. One to four AI OpFor aircraft can be spawned at a time. AI OpFor aircraft load-out depends on engagement scenario (e.g. for jet fighters: BVR vs ACM) AI OpFor aircraft skill defaults to "Random" but can be changed via 'Options' menu. Note that the updated AI skill persists for the initiating player name, for the duration of the mission. AI OpFor aircraft altitude AGL defaults to "Random" but can be changed via 'Options' menu using pre-se t low/medium/high altitudes AGL. Note that the updated AI altitude AGL persists for the initiating player name, for the duration of the mission. AI OpFor aircraft spawn directly in front of client/player aircraft with a reverse heading towards the initiating client/player aircraft by default, but the starting point can be changed via Options menu. Note that the updated AI starting point setting persists for the initiating player name, for the duration of the mission. AI OpFor aircraft spawn at a random altitude ~3k-26k feet AGL by default but can be changed to pre-se t altitudes via Options menu; AI helicopters spawn at ~500 feet AGL. AI OpFor aircraft spawn at a distance fr om the initiating aircraft of ~90 miles for BVR engagements, ~25 miles for ACM, ~12 miles for helicopters and WW2 aircraft. Once an AI OpFor aircraft returns to a friendly/neutral base and lands, it will be de-spawned once the aircraft stops (there is a function that checks for this every 120 seconds). A maximum of 24 AI OpFor aircraft can be spawned and active (alive) at a time, as defined by the glbMaxOpForSpawnable variable; If you attempt to spawn AI OpFor aircraft and it would cause the total number of active (alive) AI OpFor aircraft to exceed this maximum number, you will see a message telling you they cannot be spawned, until the number of active AI OpFor aircraft is reduced by attrition or they land and de-spawn. You can prevent OpFor AI aircraft fr om spawning in or travelling through an exclusion zones, so they do not readily attack players focused on non air-to-air activities; Simply create one or more circular trigger zones that include "Exclusion Zone" or "exclusion zone" in the trigger name. Edited June 14 by 609_Relentov updated version to 1.5 1
609_Relentov Posted July 29, 2023 Author Posted July 29, 2023 Just checking in, as it’s been a few days since release. Wondering if anyone’s having issues with the script, and if it’s performing as expected.
609_Relentov Posted July 29, 2023 Author Posted July 29, 2023 I re-uploaded a new Zip, now version 1.3.2 I was play-testing and noticed that there were two identical scenario menu items for the Su-24M bomber AI spawning, which was causing neither to work. I fixed it and now you have two scenario options: F1. Intercept w/IR Missiles (90 mi) F2. ACM w/IR Missiles (25 mi) For some easy gunnery practice, etc.
Phantom711 Posted August 24, 2023 Posted August 24, 2023 Hey.. as I mentioned in the other thread, I tried out that script. Please note, that I had just started to "play" around with the Mission Editor, but I had used triggers already and implemented your script in a SP mission as advised. When I start the mission, I do get the message that the script is active. I can go through the comm menu but then nothing happens. Am I supposed to do something else after the last menu (number of aircraft)? vCVW-17 is looking for Hornet and Tomcat pilots and RIOs. Join the vCVW-17 Discord.
609_Relentov Posted August 25, 2023 Author Posted August 25, 2023 @Phantom711 no, once you select the number of aircraft, the AI should spawn. Did you try again with a different AI aircraft type? Did it work then? What was the aircraft type and scenario chosen where you had this happen, I can try to replicate. I have had this happen in the past during development if I messed up somewhere in method used to build the AI aircraft group, but I tried to test all aircraft type/scenarios. Can you share how you set up the trigger to load the script? i.e. trigger, condition, action. You said this is a SP mission, does this mean it has one Player and no Clients? Or does it have one or more Clients, but you are playing it in SP mode (i.e. launch mission, not "Launch Multiplayer Server")?
609_Relentov Posted August 26, 2023 Author Posted August 26, 2023 @Phantom711 Actually, I ran some tests and there seems to be a bug with running the script in SP missions where you have one Player aircraft. It's working if you have one or more Client aircraft, so I apparently didn't do full regression testing with SP "Player" missions with my last bunch of changes (sorry about that). For now, if you can just change the aircraft you use to Client instead of Player, it should work. I'll need to spend some time debugging where this stopped working for SP "Player" missions. I tried an older version of the script and it worked, but there were significant changes, so it will take me a while. Thanks in advance for your patience.
Phantom711 Posted August 26, 2023 Posted August 26, 2023 (edited) Thanks for your reply. yes, it was a pure SP mission with me as a player aircraft. so seems like an easy workaround then. I will try tomorrow. Edited August 26, 2023 by Phantom711 vCVW-17 is looking for Hornet and Tomcat pilots and RIOs. Join the vCVW-17 Discord.
609_Relentov Posted August 26, 2023 Author Posted August 26, 2023 I re-uploaded a new Zip, now version 1.3.3 I fixed the issue where opposing AI aircraft were not spawning if the mission loading the script is a single player mission with one Player and no Clients. The AI aircraft should now spawn upon request. Also fixed an issue where the MiG-19P was not loading IR missiles based on the scenario; now it loads them correctly. 1
Phantom711 Posted August 28, 2023 Posted August 28, 2023 Nice...thanks. Vice versa I tried setting the mission as a MP mission and the script worked . This also got me into trying to use my laptop as a dedicated server for the first time, which worked quite well. Two ideas, if you are open to suggestions: 1. Make it an option to have a random aircraft type spawn (random modern, random 70s etc). Maybe throw in a friendly aircraft every once in a while so it would make for a nice VID scenario. I know, the later would open a new can of worms though. 2. Add a "repeat" option on the first page of the "comms menu" so one doesn`t need to go through the whole chain again if one wants to continue to fight with the same setting. vCVW-17 is looking for Hornet and Tomcat pilots and RIOs. Join the vCVW-17 Discord.
609_Relentov Posted August 28, 2023 Author Posted August 28, 2023 (edited) Hey Phantom, I’m always open to suggestions, I like the idea of adding an option for random aircraft per category, etc. Not sure about adding friendlies, as they (I.e. blue and red AI) would immediately start attacking each other, lol. I have pondered seeing if I could spawn a friendly wingman as part of my group, so I have help against the OpFor AI, but haven’t done enough testing yet to see if it’s possible dynamically. The “Repeat” option sounds interesting, too…. I’ll give them some thought, thanks for the suggestions. Edited August 28, 2023 by 609_Relentov
609_Relentov Posted February 16, 2024 Author Posted February 16, 2024 (edited) I uploaded a new Zip, now version 1.4 I added two features: - Once an AI OpFor aircraft returns to a friendly/neutral base and lands, it will be de-spawned once the aircraft stops (there is a function that checks for this every 120 seconds) - A maximum of 24 AI OpFor aircraft can be spawned and active (alive) at a time, as defined by the glbMaxOpForSpawnable variable; If you attempt to spawn AI OpFor aircraft and it would cause the total number of active (alive) AI OpFor aircraft to exceed this maximum number, you will see a message telling you they cannot be spawned, until the number of active AI OpFor aircraft is reduced by attrition or they land and de-spawn Also made two fixes: - Previously the call signs for the spawned OpFor aircraft were fixed (e.g. Enfield11), and hadn't given it much thought, until I was testing and switched sides. Then I saw a bunch of "Enfield11" aircraft all over the place :). So, for OpFor aircraft spawned on the blue/alllied side, they will use more dynamic in-game call signs. Those on the red/axis side will use dynamic numeric call signs. - With the changes to the SA-342, the OpFor SA-342L and SA-342Mistral were spawning with no/missing weapons. They were corrected such that both are now SA-342L, one with cannon/rocket load out, one with Mistral loadout. Edited February 16, 2024 by 609_Relentov
609_Relentov Posted February 25, 2024 Author Posted February 25, 2024 (edited) I uploaded a new Zip, now version 1.4.1 I made a very minor update, namely, to bump up the starting unit and group ids used to assign to newly spawned AI aircraft, to reduce the chance they are assigned to ids for existing aircraft in the given mission. Edited February 28, 2024 by 609_Relentov
609_Relentov Posted July 5, 2024 Author Posted July 5, 2024 I uploaded a new Zip, now version 1.4.2 Changes include: - With the release of Heatblur's F-4E Phantom, I updated all of the existing F-4E AI OpFor aircraft to be spawned to use the new Heatblur F-4E-45MC. - For the Vietnam/70's era aircraft (e.g. F-4E, F-5E, Mirage F1, MiG-21Bis) and some trainer aircraft (e.g. C-101, L-39), I changed the spawn choices where only IR missiles are loaded on OpFor aircraft to include either all aspect (AA) or rear aspect (RA) missiles - For bomber OpFor aircraft, I added options to spawn them from a shorter distance (e.g. 25 miles) in addition to the current longer distance (e.g. 90 miles)
AKA_Clutter Posted July 13, 2024 Posted July 13, 2024 Great job (as usual) Rel. 1 ---------------- AKA_Clutter Win 10 Pro, Intel i7 12700k @4.6 GHz, EVGA RTX 3080 FTW, Ultra 64 GB G.Skill DDR4 3600 RAM, Acer 27" flat screen, HP Reverb G2, TM Warthog HOTAS with Virpil warBRD base, MFG Rudder Pedals, Virpil TCS Rotor Base with AH-64Dcollective, TrackIR 5 Pro w/Vector Expansion, PointCTRL.
609_Relentov Posted June 14 Author Posted June 14 I uploaded a new Zip, now version 1.5 Changes include: - Updated script to work with dynamic spawn slots in multiplayer missions - Added the OH-58D as a helicopter OpFor aircraft type, one option with stinger AA missiles, and one without - Added the CH-47A as a helicopter OpFor aircraft type 1
Recommended Posts