DCS Mission Editing Tools and Discussion

Resurrecting and knocking the cobwebs off this thread in hopes for some help.

I need help on FARPs with the Apache. I can create a FARP, add the three critical items (M939, Refueler, HMMV) to get refueling…

…but I cannot get the right ingredients to do an Apache repair at the FARP upon return of a flight.

Yes, I’ve RTFM, at least anything that comes up under FARP in the manual. Reddit, Hoggits, YouTube. Nothing up-to-date.

The DCS User Manual pages 324-325-326 are helpful, but not all the vehicles listed. Like the M818. I’ve read where substitutions are okay, but which ones.

Also, there is reference (page 324) for the Blue Coalition to the Fuel Depot, Ammo Storage, Command Post, Tower. All are required, or are optional for a FARP? I ask because none of these are available on my refueling FARPs, and it works fine for the refueling. I know the engines must be off and the rotor stopped for repair, but how about these items? Mandatory?

FARP-comms

TIA for any help. I’ve run out of variations to try.

1 Like

:popcorn:

Most likely either @jross or @Clutch will know this one.

I haven’t tried repairs myself but a quick forum search showed that, a long long time ago on 1.2, repair wouldn’t work at FARPs unless the aircraft was actually damaged. Apparently at airfields you can repair even without damage?

Never tried to do a repair. Be interested in the answer. Wish I could help more.
I vaguely recall something about having the right type of vehicle there. But again never tried that.

I do have a ton of notes and will dig through them.

From my notes (image capture as the G-doc copy/paste is ugly):
This is old howevr

https://wiki.hoggitworld.com/view/FARPs

2 Likes

Thanks for any help on this, guys. I’m amazed that setting up a FARP for repair using current information is this difficult.

2 Likes

From the FWIW Dept. A branch of the DCS AI Micro-Management Division…

So, there I was, enjoying a sortie in my lil play tool; Operation Tora Bora-like, in Afghanistan. Needed to check on with the dude controlling the stack of fighters waiting their turn to blow things up (me and Bot were numero three; works with attack choppers too).

Normally I saddle up to the tanker nearby and have it to myself as the previous (AI) flights have topped off and are either holding or doing their thing.

I come on the tanker and there’s 6 flights in tow, getting drug along behind like a bunch of high-speed tourist. Wassup?

I digress. Seems the AI refueling logic is hosed (it always had issues). After hours of throwing stuff at the wall the best I could do is:

  • Get a single-ship of F-16 to: Refuel enroute to their IP at the AR track (if necessary; normally is as AFG is big and it is a haul from Bagram for this CAS thing), then press on and await their turn in “the stack”.

  • A flight of 2 F-16’s didn’t work: they took gas but would remain in ‘observation’ - like forever. A single-ship F-16 would work…scratching my head.

  • F-18’s would do nothing at all.

This all worked for some time. Beyond all the machinations behind the scene to get them started it’s just 2 tasks, one each for the tanker and one for the fighter: “Refueling”.

A simple test mission with no scripts, not a lick of code behind, nadda - nothing but a single flight of fighters and a tanker saw same results[1]

Crickets from ED. This was reported recently by others, along with other AI AR related aliments. I don’t visit that place much.

It kind of messes everything up for single player (likely MP coop too if any do AI AR). Maybe that’s why they came out with the ‘setUnlimtedFuel’ gizmo a little ways back - a workaround? My impression is AI AR started going South about that time. My DCS clock could be off.

Carry On

[1] If someone wants to take a look I can put a link to the mission. It’s on the Mariana’s. A sanity check of sorts.

3 Likes

Was getting AI stuff mixed into the DCS thread but seems more appropriate here…

AI aircraft attack behavior observation (may be dated a bit): The AI flight (2nd of 2) was given a target and -1 and -2 split to attack from different directions. Before they would do, sometimes, a little ‘wiggle’ (offset). My AI code did nothing here with them (beyond the JTAC/FO) running the CAS ‘stack’.

All isn’t perfect as they did NOT hit the SCUD missile I tasked them on, going after instead what ‘they’ thought was more important. I’m okay with that since the FO will assign it to me when my turn comes. The FO AI sets target priorities.

Interesting. They do seem to poke and prod at the AI from time-to-time. Cool.

My flight was the third one to check in. Was given a delay/expect tasking time of 19 minutes (watch the gas gauge!). Not shown here as in this debug mode as my position isn’t needed, only the comms interface (F10 | Other…)

Is there any kind of ELI5 guide on how to use MOOSE stuff? I’m finding it extremely frustrating because all the documentation assumes the reader is a professional coder, the examples are ambiguous, I follow the examples in the documentation to the letter and have it not work only for someone on their Discord to say “the way you’re doing it requires altering the code.” What do you mean “the way I’m doing it” I’m doing it verbatim as ya’ll told me to, and how am I to know code alteration when I’m not a professional coder? Sheesh.

A lot of the basic stuff, like how you need one specific line of code for the next to work, or how one item in the line of code needs to match with certain others, which lines need “local” in front of them and which ones don’t, what can be changed what can’t be changed, etc. is missing.

1 Like

I have tried some basic stuff with Moose, and can attest that the learning curve is somewhat steep depending the skills in Lua, DCS Scripting and programming in general. And the sparsity of the general DCS scripting documentation does not help either. Moose on the other hand has pretty good autogenerated API documentation once you know the basics and the lay of the land.

One possible remedy could be to ask AI to get you started and even produce snippets to try, or modifications to existing code. I just tried querying Gemini with “Do you know how to use Moose framework for DCS World?”, and got pretty convincing reply describing the framework, getting started, and even simple helloworld example app. Of course it will be happy to answer any questions arising.

I am sure the other AI providers will do also. The answers can vary a lot though, so it may be good idea to ask for a second opinion from another AI. For DCS scripting just copy pasting back and worth will probably do, but there are also tools that automates code file editing.

And then there are forums and discord to ask from the others. I bet we can get some questions answered here if need be.

1 Like

Discord has been…sometimes helpful sometimes condescending. I’ve mulled asking AI but I’m unfamiliar with the coding language Moose uses. Does it have name?

1 Like

Yes, it is called Lua language. It is quite small and concise scripting language used in many games. The AI LLMs should have very good knowledge of it, and chatting about it is probably a good way of learning the language nowadays.

There’s also language reference and older version of the main book on it freely available on its web page.

I am not a coder, just copy paste most of the stuff I use. What I always do is look at the Mission examples for the different MOOSE modules then copy and/or adapt what is shown. It works most of the time and you can do some pretty cool stuff without a lot of effort.

My most used modules are probably CTLD, the Mantis IADS, and respawn functions for tankers, AWACS etc. For example it makes it very easy to always have a recovery tanker following the CSG around as well as a rescue helicopter alongside the carrier. If the S-3B runs out of fuel it will recover and despawn then a new one will launch. It’s pretty nifty.

2 Likes

First, I preface all of this with: I am not, nor have I ever been, a programmer.

Big subject. Moose has, or had, a set of YT videos at some time. Not sure about a website.

Next, I don’t use Moose for the simple reason I don’t think it’s necessary for me and I want more flexibility. But that flexibility comes at a price. With things like Moose you tend to get forced into that ‘lane’. Note that once you become more comfy with lua this isn’t such an issue.

If you haven’t yet look at ‘mist’, written by the individual that maintains the wiki DCS scripting ref (a must) at:

https://wiki.hoggitworld.com/view/Simulator_Scripting_Engine_Documentation

It is updated often/regularly.

Moose is I suppose what one (a pro) would call a ‘framework’. lua is a lot like c to me (I think it translates directly into c, which is why it can be pretty fast - good in performance dependent situations like games).

‘Frameworks’ are nice in that they bundle things up into neat little ‘objects’ for you - they hide things. I think Moose is an attempt to make a language that is not OOP (Object Oriented Programming - BIG subject), well, OOP.

I guess you could say it’s all ambiguous by design?

Won’t rehash the history of OOP here but I skipped Moose because I wanted complete control and know exactly what was going on ‘under the hood’. I do use some of the same mechanics Moose is built on. Just not very often.

lua is powerful really. Again it’s like c before C++ (an OOP variant of c); you are free do ANYTHING, including get yourself into a big fury mess. lua is like c using function pointers - which were considered taboo 40 years ago but, so what? In a game it’s about performance, not being ‘correct’.

Moose and such give you a bag of tools so you don’t have to grow a tree, mine ore from the ground - all to make a hammer. It gives you a hammer. Just not the one I want.

Not sure any of that helped. In the end, IMO, if the code does what you want it to do - and you understand it - then it is ‘good code’. Many would disagree with that.

The REALLY annoying bit using lua in DCS is the lack of a) a debugger and b) lua requires another application to run (ie; DCS) - lua is embedded. So testing is arduous. I’ve found a debugger that does the minimum (it has bugs).

If you use external lua source files [1] then: somewhere on this forum I explained how to get around the issue of testing DCS code without the EXTREMELY annoying cycle of:
1 Edit code
2 Delete: Trigger | Do Script File | load file “myscript.lua”
3 Save mission
4 Create new tigger with Do Script FIle | load file “myscript.lua”
5 Save mission
6 Run.

That gets old fast. The method I describe skips 2 - 5.

[1] I, personally, find it difficult to ‘organize’ myself without using external script files.

1 Like

‘local’ vs not local is about ‘scope’. If it’s not ‘local’ to the block of code it is contained in, then it is ‘global’ - that variable must be unique/is ‘available/accessible’ to the entire system. Deemed a bad thing. Bad practice. Everything in DCS is global, really. Your code is part of a hierarchy.

I recommend you get Visual studio code (or the like) and install a debugger extesion (I use the one from devCat - but open to suggestions if someone knows a better one). Without a debugger it will remain a huge mystery.

MIST is no longer actively developed afaik, the final version was released last year IIRC, it should be v4.5.126. It’ll still work for the most part of course but with future DCS updates stuff might break and it won’t get fixed if it does.

Moose can do a lot more, has better documentation and a ton of example missions on their github page.

That’s essentially how I’ve been doing it, for example from here.

There’s a “code it” example that for the most part works until I get to the conflict zones, specifically this bit:

GROUP:FindByName( “Blue Border” )

Which of course doesn’t work because the example said to place trigger zones not groups, while also being quite ambiguous about it: Is a “border” a literal border or a trigger zone encompassing the whole airspace? Is the “draw” and “polygon” comments referring to the draw tool’s polygons? (They’re referring to placing trigger zones apparently but communicating it extremely poorly).

Upon asking on their discord they give me a totally different code for the same thing. I ask why it’s different and they say the example is for a specific demo mission, but no such thing is stated anywhere on that page, nor a link to said demo .miz file on that page either…

This frequently happens where I copy-paste something and it doesn’t work as copied because it needs to be tweaked this way or that which isn’t explicitly stated anywhere in their tutorials/documentation/examples.

Like if I want to use a script to have parking spots marked at Buchel the documentation has this useful line (I wanted to blacklist certain parking slots because the RAT script was spawning them in nonsensical places, and needed the parking slot IDs to do so):

Buchel:MarkParkingSpots(FighterAircraft, mark)

But of course copy-paste doesn’t work, because the full code needs to look like this:

local Buchel = AIRBASE:FindByName(AIRBASE.GermanyCW.Spangdahlem)
Buchel:MarkParkingSpots(FighterAircraft, mark)

Except nothing in the documentation for that specific function tells me the first line needs to exist for the second line to work. I don’t know how I’m supposed to know what I’m not told, as it were.

Does it not still use the same underlying API? Mist and Moose are both 'wrapper’s around that API (documented on that site, there may be others). You can edit a copy of Mist (I don’t use that either) but not so much Moose, though I may be wrong on that point as I only skimmed through it.

That’s where I look at the demo missions or ask a squadron mate who is an actual programmer and has written some cool stuff for our squadron.

Most of the modules have demo missions here:

1 Like

Are you using Moose? The above isn’t familiar to me. I use the API directly. I can guess at what they are doing but I wont be much help as Moose is a layer above the API.

Yeah, I’m not doing any of that^^
I’m happy when I can get fighter patrols going or launch interceptors when someone enters a zone etc.
I’m not doing anything for singleplayer which makes it somewhat easier to create missions and since I’m lazy I also tend to load off stuff to a game master so that I don’t have to script anything too complex.