Using the MOOSE framework is very easy, and this document provides you with a detailed explanation how to install and use MOOSE within your missions.
yFor reference, You can find the source code of MOOSE framework on GITHUB. It is free for download and usage, since it is released under the GNU 3.0 open source license policy. You don’t need to use the source code as an end-user, but it may help to sneak into the code and understand how certain things are working :-)
You can use the MOOSE framework with a normal text editor. This is perfectly okay. But you won’t have IntelliSense enabled, which is an interactive documentation system that helps you to code correctly! Therefore, it is highly recommended you use the Eclipse LDT editor, which is explained below.
The LDT environment or “Eclipse Lua Development Tools” is a fully integrated development environment for LUA developers.
It is recommended to use the LDT as your mission design editor using MOOSE.
The MOOSE framework is documented using the lua documentation standard within the MOOSE code. As a result, every class, method and variable is documented within the source, and mission designers can write mission script lua code that is intellisense(-ed) … What that means is that while you are coding your mission, your object and variables (derived from MOOSE classes) will list interactively the methods and properties of that class interactively while coding …
This highly increases the quality and the speed of your scripting.
In order to efficiently use the MOOSE framework, it is highly recommended that you learn a couple of basic principles of lua.
I recommend you learn the basic lua principles following this lua tutorial.
We’re not asking you to become an expert in lua, leave that to the experts, but, you’ll need to have some basic lua coding knowledge to “understand” the code, and also, to understand the syntax.
Therefore, I suggest you walk through this lua quick guide.
Ignore the lua environment setup. DCS comes with a pre-defined lua environment.
The delivery of MOOSE follows a structured release process. Over time, new features are added that can be used in your mission.
Unzip the files into a directory of your choice, but keep the folder structure intact.
Also, you’ll notice that there are two files included:
These are include files that you need to include within your mission. These files contain ALL the MOOSE code in one file. See a more detailed explanation below.
Now you should have a working LDT on your system. Don’t skip this step, LDT is a game-changer.
You need to configure your Eclipse LDT environment and link it with the Moose code. This will enable you to start developing mission scripts in lua, which will be fully intellisense enabled!!!
Please follow the steps outlined!
The LDT editor has a concept of Workspaces, which contains all your settings of your editing environment, like views, menu options etc, and your code… Nothing to pay attention to really, but you need to set it up! When you open EclipseLDT for the first time, it will ask you where to put your workspace area…
Here, we will create a New Project called Moose_Framework in your LDT environment.
The project details are already defined within the MOOSE framework repository, which is unzipped in your local Moose folder on your PC. We will link into that directory and automatically load the Project properties.
(All the other settings are by default ok).
The Moose Development/Moose directory should be flagged as the *Source Directory. (It is listed totally on top.) This is important because it will search in the files in this directory and sub directories for lua documentator enabled lua files. This will enable the intellisense of the MOOSE repository!
As a result, when you browse to the Script Explorer, you’ll see the following:
The framework comes with demonstration missions which can be downloaded here, that you can try out and helps you to code.
These missions provide examples of defined use cases how the MOOSE framework can be utilized. Each test mission is located in a separate directory, which contains at least one .lua file and .miz file. The .lua file contains the mission script file that shows how the use case was implemented. You can copy/paste code the code snippets from this .lua file into your missions, as it will accellerate your mission developments. You will learn, see, and understand how the different MOOSE classes need to be applied, and how you can create more complex mission scenarios by combining these MOOSE classes into a complex but powerful mission engine. Some of these exact test missions are also demonstrated in a video format on the YouTube channel.
In order to design your own missions, it is recommended you create a separate directory on your PC which contains your mission files. Your mission will be designed consisting possibly out of a couple of components, which are:
Using the menu system of the DCS World Mission Editor, you need to include files in your mission (.miz) file.
However, once included, maintaining these files is a tedious task, having to replace each time manually these files when they change (due to a new release or a change in your mission script).
Therefore, the recommendation is that your create for each mission a separate folder.
The MOOSE test mission folder structure is a good example how this could be organized.
The LDT has been customized and provides a tool to automatically maintain your existing .miz files.
Note the indicated options in yellow:
This is an important step. This will link your project to the Moose_Framework project and will activate intellisense.
You can delete the possibly created SRC directory. You won’t need it at all.
As explained above, each of your missions will be stored in a separate folder. Please follow the explanation how to do that.
This can be any descriptive text explaining the title of your mission.
This will create your mission script file, the file that contains all the lua code using the Moose framework using your mission.
In the root of the MOOSE package, a file named Moose.lua can be found. In order to create or design a mission using the MOOSE framework, you’ll have to include this Moose.lua file into your missions:
Voila, MOOSE is now included in your mission. During the execution of this mission, all MOOSE classes will be loaded, and all MOOSE initializations will be exectuted before any other mission action is executed.
Find below a detailed explanation of the actions to follow:
Check the cyan colored circles:
Press the OK button.
Check the cyan colored circles:
Press the OK button.
IMPORTANT NOTE: When a new version of MOOSE is released, you’ll have to UPDATE the Moose.lua file in EACH OF YOUR MISSION. This can be a tedious task, and for this purpose, a tool has been developed that will update the Moose.lua files automatically within your missions.
This will activate a script that will automatically re-insert your mission .lua file into your mission.
TODO : Detail how hard links work, explain how they help the wworkflow
This trick will save you a lot of time. You need to install the tool … to create easily new links.
Select from the following possible links that can be created to save you time while browing through the different folders to include script files: