DCS Mission Editing Tools and Discussion

Darn you! :wink:

Ok, so the ‘condition’ is simply your position, which I update at some interval, thus there’s only 1 API call, roughly:

Every n-seconds…
function = UpdatePlayer()
PlayerPosit = PlayerUnit:getPoint()).
end
Everything else uses PlayerPosit (with guards to make sure you aren’t dead as appropriate)

Based on your post, I bet it would be a 5 minute job to change that to:

if PythonThing [is defined] then
PlayerPosit = PythonThing.position
else
…do it my way
end

Sound reasonable?

Getting the mouse coordinates would make it really handy but not sure where to get those…UI layer maybe?

Anyway, the dynamic spawning thing already works, doing it like this might not be cost effective timewise. But I’ll look at it later tonight.

Thanks a million!

Ok, let’s see if I get the idea correctly.

You would define global PythonThing in the interactive console to hold the player coordinates that would then get copied to player position?

I think that would work, and would be very concise addition. You could also call your script’s global functions directly from the console and also receive the output if need to check some variables realtime.

Here is one example what you can do with the lab(notebook) version. It demonstrates how you can alter the DCS session in realtime and also fetch information.

example notebook: realtime vehicle spawn and control

The idea with the notebooks is that you can create these code cells and then modify and run them in any order you wish or multiple times. In this case there’s a linearity present, but in development phase you can run them out of order also.

They are and they aren’t. They’re languages in how they’re used, but they lack the same level of consistency actually languages have. Even English with its insane amount of exceptions and oddities is still more consistent than programming languages.

That said, I’ve managed to get a whole bunch of timed packages to depart a carrier and shoot stuff all through scripting, but when I look at it I wonder why I spent the time to do it via scripting when I could have accomplished the same all within the Mission Editor. Still trying to figure out what advantage scripting has over standard mission building in this particular case. Ideally I would like to have these events randomized and/or repeated instead of having to bloat my lua with every single task and start time, but I haven’t advanced to that point yet.

Another “ideally” is having ground units repeatedly spawn and having AI tasked to hunt them, but the code requires assigning a specific group name to the targets, and if they’re randomly spawned I won’t know the group name.

2 Likes

Awesome!

That’s kinda what I did a ways back, only a more crude version using zones (each ‘campaign’ is generated from1 mission file; is really treated as 1 BIG database and can run in a debug mode)

Looking forward to digging into it

1 Like

Probably little difference here. lua scripts are reusable across multiple missions and maps for starters. Off the top of my head…(this isn’t exact syntax - I don’t have time to proof read it - but you should get the idea)

DoAttackInZone = function(GroupNames, name_of_zone)

for i = 1, #GroupNames do

local name = GroupNames[i]
local zonePosit = trigger.getZone(name_of_zone).point
local radius = trigger.getZone(name_of_zone).radius
local group = Group.getByName(name)

– fill out the task with above values
local task = EngageTargetsInZone = {
id = ‘EngageTargetsInZone’,
params = {
point = zonePosit,
zoneRadius = radius,
targetTypes = see above post(s)
priority = number – 0 or whatever you want, see API
}
}
grpController = group:getController()
grpController:pushTask(task)
end
end

In the ME, for any mission:

Place a trigger zone
Create n-groups
DoScript AttackInZone ( { “Larry”, “Moe”, “Curly”, etc}, “badGuysZoneName”)

Ah that makes sense. With a standard set of unit/group/zone names most things can be simply copied over. I tend to name everything based off of geographic references so while I could port things over, I’d have a lot of editing to do in the code.

With the release of the Marianas WWII map and the addition of USS Enterprise '66 to my Vietnam War Vessels mod, I feel the need to explore mission or rather showcase building further.

Mind you, I’m blissfully unaware of the challenges of the following idea, so I thought I ask this group for advice: how to approach the mission, what tools and libraries to use, and probably most importantly, what to forget immediately as it’s not achievable.

So, in my mind I have two Carrier Groups cruising east of the Marianas. In the south centered around CVA-31 Bon Homme Richard and a second generic Essex carrier, ‘Dixie Station’. In the north centered around CVAN-65 Enterprise and a second generic Essex carrier, ‘Yankee Station’. Dixie Station is supposed to hit targets on Guam, representing South Vietnam. Friendlies around, limited AA, basically no SAM threat. Yankee Station is supposed to hit targets on Saipan and Tinian and other islands around, opposing MiG-21MF and SA-2s and heavier AAA concentrations.

The role of the player is mostly being a observer, though at a later stage flying a plane from one of the carriers should be possible. If multiplayer is easily achievable, I’d take that, but it’s not a necessity.

On (modded) planes for the Stations:
Dixie - A-4E, F-8E, A-1H, UH-1H, CH-47F
Yankee - A-4E, A-6A, F-4B, F-8E, RA-5C

How should I approach this project? Clearly just putting units down in the editor and drawing a few waypoints will fall short. I wouldn’t expect to implement full cycle-ops either, but somehow a mix where small strike groups are hitting targets. Happy to read any advice!

1 Like

Hmm. Sounds like: you want Assets-A (from CV A) to attack stuff in Area-A (same for B). And you don’t want to fly a plane until some condition is met, just F2 around (or from the Air boss [if available]).

I’ll assume the targets (for any asset) will vary. And do this all from the Mission Editor too.

First off the top of my head (note all I use the mission editor for lately is to load scripts: my memory is suspect here):

  • Create a ‘set’ of assets (one set for A and one for B). Send each to, perhaps, Engage In Zone.

  • Decide on some max number you want to have active on a given run. Store this value either in a flag or a global value.

  • Write a random number script that returns True no more than the max number of times; you never know how may will ‘fly’ on that run of the mission

(PS: How to get this reply text to put in Tabs?)

if math.random(100) > 50) then
if count < maxCount then – count & maxCount are globals
setFlag(x) where x is associated with a Activate Group trigger.
count = count + 1
return true
end
end
return false
You could expand on the above a lot but too hard to read here…

Note the setFlag full API is:
trigger.action.setUserFlag(flag, value)

Late activation should apply to you also, but you won’t know when your late activation will be (it’s random). If you want control of when it happens…hmm…don’t think a F10 item (radio item) would work cos you have to be in a cockpit (activated) to get the menu. Another global?

Global values
I won’t delve into the why’s/why not’s of using globals but you can reduce the ‘pollution’ of the global space (to one value - helps when you’re debugging) like so:

ON MISSION START trigger
MyTable = { count = 0, maxCount = n}

Then in the above it would be MyTable.count = MyTable.count + 1, etc.

Thanks, that provided a good start. I have not yet implemented your advice completely, I focused on a basic mission cycle that potentially runs endlessly. I face now three slightly different challenges:

  1. How do I detect that the mission is complete, e.g. that the surviving planes are back aboard the carrier, or all have been shot down?
  2. How do I get them to fly to the target at all? The with ChatGPT assist created function assignStrike doesn’t really work yet …
  3. How do I equip them with different loadouts depending on the mission picked?

I have placed the mission at https://tetet.de/dcs/missions/vwv-showcase-001-miz.zip but it needs the 2.7 GB heavy Vietnam War Vessels 2.0 mod (Latest Release Candidate: https://tetet.de/dcs/mods/TeTeT%20VietnamWarVessels%202.0.0-2025-07-20.zip) and the Vietnam Asset Pack from tobsen and Eightball.

The central lua script is at https://tetet.de/dcs/missions/vwv-showcase.lua and holds all the logic currently.

Cheers,
TeTeT

1 Like

I looked into that very early but I realized the mission ends, well, when I am done flying it; I don’t have any concept of ‘score’ (who/what has been destroyed or when). Essentially there’s no BDA as in my research this was often of questionable veracity.

However, END MISSION trigger action is supposed to work.
See this YT (it add some conditions based on cockpit params IIRC)

LINK: End mission Video

In my off-the-cuff example you create them all, up front, like any other - a ‘set’ of strikers if you will, complete with routes to a target with a task (bomb, attack group, engage in zone), and back home.

However, setting them to late activation prevents them from flying. You could create a few, many, dozens, all with some variety (route, loadout, type of acft, etc). Only n-groups will fly on each run based on the random thingy.

Using the ME, only, seems you would have to create another ‘layer’ to your triggers…maybe:

Condition
If flagTrue(“1st squadron”)
AND flagTrue(“1st squadron loadout dumb bombs”)
Action: activateGroup (1stSqdrn_DumbBombs")

OR – This is an OR condition. Need to duplicate the 'If flagTrue(…) for each

If flagTrue(“1st squadron”)
AND
flagTrue(“1st squadron loadout smart bombs”)
Action: activateGroup (1stSqdrn_smartBombs")

OTW, I don’t think there’s any way to manipulate loadouts via triggers (without scripts). Given some reasonable defaults the user can them modify when in the cockpit (or change it completely).

ME experts I’m sure have a better way but the above is why, after about an hour with the ME, I went to scripts.

I find managing ‘modules’ (separate tables and files) of lua code easier to keep track of and read/decipher (and more reusable across maps an missions)

However…

Managing loadouts is a chore all by itself. I do it offline (but still with scripts) and it’s a royal PAIN[1], which is why I created sets of defaults, say 4-8 different loads for each platform based on some criteria (normally just the situation, the category - or type - of platform, etc)[2]. Seems to me that managing loadouts would mean duplicating the 'Re-arm, Re-fuel" functionality all over again. I compromised.

[1] The possible number of loudouts get BIG fast. So I have defaults (the player can select) and then change to taste in the cockpit. There’s more to it but it gets long.

[2] I wrote a tool (C# GUI) that exports the loadouts from aircraft (within a mission file) and turns that info into tables that are then selected from. This is way beyond our scope here though.

2 Likes

If you want to get into Moose, they have a cool system for this. It takes a bit of setup as you basically do it like this in lua:

  1. Create an airwing at an airbase or carrier
  2. Assign squadron(s) to the airwing(s)
  3. Assign mission types to the squadrons
  4. Assign payloads to the mission types

Let’s say you want to have VFA-87 as a squadron, doing SEAD. In the ME you place one Hornet down with the group name “VFA-87” and you reference that name in the lua. Then you place one more Hornet down with the group name “SEAD” (or whatever you want to name the payload), select the payload desired, and in the payload lua you reference that “SEAD” group name.

Then you can frag them to go on a mission with programed start time, ingress point and/or egress point (trigger zones), target “findbygroupname” or “findbyunitname” and the name of the group/unit you want attacked. If you have multiple targets you can prioritize them. By default flights are spawned as pairs. I haven’t figured out how to do 3-ships or 4-ships yet. It’s OPS.AUFTRAG in their system.

At the moment I’m trying to figure out how to make this more dynamic, say when random ground units spawn. I assume I will have to type out all the potential targets in the priority list so the AI will skip the ones that aren’t spawned and target the ones that are, but I’ve noticed lua scripting sometimes gets hung up in that process, gets to the valid entry, but doesn’t execute.

2 Likes

Sounds cool. Yeah, to me it’s about defining things then making associations; it’s a large, complex database where you have, or create, functions to do stuff.

That…is the ‘fun’ part. Things (complexity) starts to ramp up at about that point :wink:

Pretty cool though when stuff happens that I didn’t expect…was sitting in the Phantom at (Nelis, or somewhere, forget the campaign), look up and see a contrail way up high…(BLD northwest bound) then a Mirage taxi’s by…

Or a gun opens up on my Apache, from within a small village, as I cruise by. Have to keep my eyes open cos it can happen anywhere.

Got a boat-load of ‘stuff’ now (in 4 campaigns, still doing the DCS imitation of Johnny Appleseed, sprinkling ‘hints’ about for another 3 ). Waiting to complete my rendition of Desert Storm if they ever finish that map.

3 Likes

Sounds great @jross , a bit of (unplanned) variety goes a long way for replayability.

Thanks @Clutch for the pointer to Moose, I think I will try that for the strike missions and their loadouts.

Meantime I discovered my mistake in naming: @jross recommended on mission end, but what I actually meant is a single strike mission end, and then the next ‘mission’ shall roll.

With help of chatGPT I now have a basic check for carrier recovery of a group implemented, albeit a bit brittle (if I recall all the strange stuff that can happen from arma 3). Unfortunately I seem to still have a fundamental logic problem in my code, as a recovered group is immediately tasked with the same task as before… Another entertaining evening can be expected :slight_smile:

Current script is at https://tetet.de/dcs/missions/vwv-showcase.lua , sample mission is now 002 at https://tetet.de/dcs/missions/vwv-showcase-002.miz

2 Likes

Hi,

I just downloaded and watched MOOSE_MISSIONS/Ops/Airwing/Airwing - 100 - CVW9 Tunb Island at develop · FlightControl-Master/MOOSE_MISSIONS · GitHub play out for some 10 minutes. If I can achieve a similar result with my mod and Moose, I’m all for it :slight_smile: Air groups spawn/activate dynamically on the carrier, do their job, recover and despawn/deactivate. All I could wish for right now. Let’s see this evening if I can hijack that demo mission!

On my logic error in the script, there was a simple state variable ‘active’, a boolean. That was of course insufficient for describing the state of the air group, which could be anything from readying, launching, en route, bombing, returning, recovering and parking.

3 Likes

Downloaded and checked it out. The way it appears to set things up looks very familiar; makes sense given the API lying underneath.

What I didn’t notice (I’m not fully versed in Moose) is: no additional ‘atmospheric’ elements (audio, AI planes and ships) ; full map population thing; communications system with AI ‘agents’ (too many to list); some rudimentary help with your AI wingman; etc.

Also noticed the CV deck was ‘barren’; Moose may have run into the same issue I did when the dynamic deck crew thing dropped. However with my flight, plus those other units scheduled to fly, etc, along with the deck crew, it looks busy enough for me.

I wanted something that required nothing more than:

  1. Run an app
  2. Select a campaign (from multiple maps) with a basic ‘theme’ that progresses along a timeline.
  3. Click an aircraft and select “go”
  4. Load the mission in DCS
  5. Click ‘Fly’
  6. Never exactly the same every time; I don’t want to know where everything is, or might be, or when/if they will appear. A ‘fog of war’ sorta thing. At least a little.
  7. Not destroy my aging PC performance-wise

You never have to open the mission editor - no ME or scripting required, zilch. Essentially a game within a game I guess - noting that by default there is NO game element in DCS.

Keeps me busy :slight_smile:

2 Likes

Yep I’m using the same plus some others to create a WW2 Marianas sandbox with scheduled Allied flights and, hopefully, Axis ground units that periodically spawn at random locations within zones. I was hoping to dispatch all the Allied flights with random timing as well, but that gets tricky with the carrier turning into/out of the wind at specific times.

2 Likes

Well, getting random ground unit templates and with random routes to spawn in random zones was really easy. Now I’ve got a random-target-spawn playground with AI helping out with some of the interdiction. Though in the jungles of the Marianas it’s impossible to find anything unless it shoots at you.

One thing I’d like to do is have arty shell a zone if any enemy units are detected in it, but I don’t know how to set that up. I might be able to do that without scripting now that I think of it. I’ll have a dig in the ME’s triggers.

2 Likes

Ref. my post above concerning the AI attack behavior:

Confirmed. There’s a bit about landing in that video that I wasn’t are of. Progress.

2 Likes

After dabbling around with MOOSE for a bit, it seems to make life a bit easier for DCS mission making, but there’s a cost in intransparency. I now have two carriers (Bon Homme Richard and Enterprise '66) launch a strike each, the strikes hit their respective targets on Guam and Sapain, and return to boat. From the ground (in-country) I use Agana as Pleiku stand-in and operate O-1s, A-37s, A-1s out from there to hit some infantry and torpedo boats. The defenses are basically non-existent right now, but for four MiG-21MF primarily for eye candy, guarding North Vietnam aka Saipan.

There are however some problems I observed:

  1. Frequent collisions on the way to target. The A-4s seem to not fly a rigid formation but something more fluid and it leads to splashes into the sea. Can be as many as four out of eight planes, from what I observed.
  2. When adding escorts to the strike against North Vietnam/Saipan there is some variety on what happens next. I had the escorts (VSN F-4B) try to catch up with the Scooters and then turn around half way, flying back to Big E. They eventually rendezvoused on the way back of the Scooters. Another time an A-4 crashed into the sea and the Scooters and Phantoms circled the carrier for the time I observed. Another time it seemed to have worked.
  3. The FAC-A mission of the O-1 makes the Bird Dog orbit some 7-10km away from the infantry, probably some detection range. For purely asthetics I would prefer the smoke rocket equipped Bird Dog fire a few at the infantry to mark them, and only then call the Dragonflys in.

Overall I’m surprised how well it still goes, merely 372 lines of lua, mostly MOOSE methods, result in a nice battlefield IMO and a good showcase for the mod. It’s one thing to test the assets in isolation, and another to see if come all together (and at times fail spectacularly ;))

1 Like