GREG - Random Air Battles

Home > User Files > GREG - Random Air Battles
DCS: World 2.5
F/A-18C Hornet
GREG - Random Air Battles

GREG - Random Air Battles

Author - Ltp0wer
Date - 30.01.2020 02:05
GREG Random Air Battles (version b)

Supporting the F-14, F-15, F-16, F/A-18, Mig-29A/G/S, Su-27, Su-33, J-11, JF-17, Viggen, Mirage, F-5, and Mig-21.

Want to practice air to air combat but can't decide which plane to fly?
Greg will decide for you.

Are you sick of shuffling the planes around in your tired, old "practice3.miz" file to feel some freshness?
Greg will handle the planes and where they are, you just worry about flying.

1) Open this mission in the mission editor and delete the aircraft you don't own.
2) Start the mission and select the "RANDOM" Su-25t role on the RED side.

Within seconds, you will be flying a random aircraft in a random battle.
Greg will spawn all units, INCLUDING YOU, at random speeds and altitudes, after the mission has loaded.

You can easily flip between flying random aircraft to flying your favorite again and again against random targets to really hone your skills.

How does is it work:
    Greg will generate groups of planes for each side inside the two zones called "blue_spawn" and "red_spawn".
    These groups will be assigned waypoints heading toward their coalition's bullseye.
    Move the bullseyes around to change the respective side's target destination.
    Move the zones around or change the size of them to control where the planes spawn.
    To start, the zones are placed miles apart for random, hot vs hot bvr engagements.
    For a greater challenge, put both zones and both bullseyes all on the same exact spot.
    Friendlies and enemies will spawn all amongst each other.
    You can find the AI with your RWR. If you're having trouble, play around with the zone sizes until you find a good balance.
    AWACs will randomly be available.

*Sel ect Random Player Aircraft:
    Greg can't figure out what the player owns, so he scans the map for flyable aircraft that are set to "late activation" to add to the player's plane list.
    He can't scan aircraft set to "Client" so I needed to place AI aircraft for him in the mission.
    FOR THE RANDOM PLAYER AIRCRAFT TO WORK, you need to delete the aircraft you don't own or don't want to fly in the mission editor.

    To sel ect the random player aircraft option after starting the mission, choose the Su-25T role labelled "RANDOM" on the red side.
    Once loaded, you'll be in a Su-25t and the first scripts will load, setting up Greg.
    Then the main Greg script will load. Your system will hang for a period of time 5 to 20 seconds, depending on how many units you're spawning and how powerful your PC is.
    Then you will be in your aircraft ready for battle!
For Nerds/Deeper customization:
    In the mission editor, go to the triggers page.
    There are two triggers, the first for settings, the other for the main Greg script
    On the first/settings trigger, labelled "SETTINGS", there are 3 script runs.
    The first, "(--DON'T EDIT---)", is where all the aircraft and other things are defined. You shouldn't edit this unless you know what you're doing.

    The second, "(--EDIT LISTS---)", contains lists covering which units, missions, and start types are allowed for blue, red, and the player.
    Before we continue, it is easiest to press Ctrl+A in the script text box to select all so you can copy and paste the whole code to a text editor.
    One of the lists looks like this:
        [Group.Category.AIRPLANE] =
    This is the airplane units list for the red side. You can see that we have disabled the MiG-23 and the P-51s by adding two dashes (--) in front of those options.
    Closer to the bottom of the same (--EDIT LISTS) script, you will find the player lists. There is a list for start types called:
        ["STARTS"] =
    To enable airbase spawning (everything but "turnpoint"), airbases need to be set in the mission editor for the coalitions needing bases to spawn at.
    Click on the name of an airbase in the mission editor and set the coalition to the side you want. Greg will try and use the closest airbase to the spawn zone.
    The third DO SCRIPT, "(--SETTINGS)", contains all the settings for Greg. There are two sets of identical settings. 1 for the blue/blue side and 1 for the red.
    It looks like this:
        guns_only = 0 (This will remove all equipment fr om pylons leaving aircraft with their internal guns. You can also select the "RANDOM GUNS ONLY" Su-25t)
        smoke_targets = true (Greg will put blue smoke on blue ground and naval targets and red smoke on thems)
        player_side = "random" (this can be set to "red", "blue", or "random")
        disable_player = false (if you want to use your own player unit in the mission editor with your favorite loadout, disable_player = true will still spawn all the other greg units).
        choose_player_from_mission = true (you might have noticed a list of aircraft for the player in the lists script. If I didn't want to place all those units I made you delete, I'd set this to false and greg would refer to the list instead)

        --blue SETTINGS
        greg_settings =
            [coalition.side.BLUE] =
                ["unit_per_group"]         = {["min"] = 1, ["max"] = 2}, --how many units spawn in each group. aircraft groups have a dcs cap of 4
                ["plane_group_number"]     = {["min"] = 1, ["max"] = 1}, --how many plane groups to spawn
                ["heli_group_number"]     = {["min"] = 0, ["max"] = 1}, --(spawn between 0 and 1 heli groups)
                ["ground_group_number"] = {["min"] = 0, ["max"] = 0},
                ["awacs_enabled"]         = -1,                             --0 is off, 1 is on, anything else is random.
                ["spawn"]                 = trigger.misc.getZone("blue_spawn"), --sets spawn to the blue_spawn zone
                ["target"]                 = coalition.getMainRefPoint(coalition.side.BLUE), --sets the target for blue groups to the blue bullseye
    After editing the settings for both groups, launch the mission.
    Once loaded, the first scripts will load, setting up Greg.
    Then the main Greg script will load. Your system will hang for a period of time 5 to 20 seconds, depending on how many units you're spawning and how powerful your PC is.
    Then you will be in one of the allowed player aircraft ready for battle!

    GREG Stands for "GREG Random Engagement Generator", and is a project I've had a lot of fun working on.
    I got inspired to make this because I really enjoyed the F/A-18 BVR 8v8 instant action mission but quickly grew tired of the predictability after playing it a few dozen times.
    I used some sounds provided to the hoggit community by deadlyfishes. He's the guy behind the very popular "Through the Inferno" missions.
    I'd check out his website,, if you haven't heard of it. It's awesome.
    Thanks deadlyfishes!
    This mission is an offshoot of my original GREG mission, "GREG - Gulf Random Engagement Generator", which currently runs a way older version of Greg.
    I wanted to create this mission to focus on air to air combat and increase the testing base by moving to Caucasus.
    It's also a proof of concept showing one possibility of how Greg can be setup.
    I am a novice programmer so I'm sure it's full of bugs, but it's been a blast!
    Let me know what you think!
Change log:
    --Initial release
    --JF-17 support added to GREG
    --Select "RANDOM GUNS ONLY" option fr om role menu to empty all pylons on all aircraft
    --Radio is much more reliable for communicating with wingmen and awacs
    --Greg will use all loadouts that come with the game for generated aircraft
    --Updated AWACS spawning, hopefully it will be less of a sitting duck
    --Complete GREG restructure. Put all unit definitions and most settings into tables so they can be accessed dynamically.
    --Units more reliably spawn with an appropriate speed for their altitude (hopefully no more viggen blackouts)
    --Release of version b
  • License: Freeware - Free version, Do Not Redistribute
  • Language: English
  • Size: 420.62 Kb
  • Downloaded: 630
  • Comments: 2