Ce document est également disponible en français
This toolset (this folder, these .cmd
scripts and the associated programs in the VEAF Mission Creation Tools) can be used to transform an existing DCS mission (in the standard .miz
format) into a fully functional workshop, with which you'll be able to edit, build and deploy a DCS mission with the VEAF Mission Creation Tools.
To sum it up :
my-nice-mission.miz
-> (this folder) -> my-nice-mission
folder -> my-nice-mission-VEAF.miz
This document will guide you in :
- installing the required tools and programs
- use this toolset to transform your existing DCS mission into a VEAF workshop folder
- use your new VEAF workshop folder to edit and deploy your new mission
Please read everything once without doing anything else, and then read it again, processing step after step.
Also, please don't stop before the end. Doing so would result in an unfinished VEAF workshop folder, which would of course be non-functional.
You need a few things set up on your PC for these scripts to function.
- LUA : you need a working LUA interpreter, in your PATH, ready to be called with the
lua
command - 7zip : you need 7zip, or another zip tool, in your PATH, ready to be called with the
7zip
command - Powershell : you need Powershell, and you need it to be configured to allow script execution (read this article) ; basically you need to run this command in an elevated (admin) Powershell prompt :
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine
- nodeJS : you need NodeJS to run the javascript programs in the VEAF mission creation tools ; see here
- yarn : you need the Yarn package manager to fetch and update the VEAF mission creation tools ; see here
WARNING : do not do both manual installation and Chocolatey installation
The required tools can easily be installed using Chocolatey (see here).
WARNING : you cannot both follow the manual installation and Chocolatey installation procedures, you would install the tools twice !
To install Chocolatey, use this command in an elevated (admin) Powershell prompt : Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
After Chocolatey is installed, use these simple commands in a elevated (admin) command prompt to install the required tools :
- LUA :
choco install -y lua
- 7zip :
choco install -y 7zip.commandline
- nodeJS :
choco install -y nodejs
; then close and reopen the elevated (admin) command prompt - yarn :
npm install -g yarn
You'll still need to configure Powershell for script execution (read this article) ; basically you need to run this command in an elevated (admin) Powershell prompt : Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine
WARNING : if you see a weird error about illegal characters, like in the screenshot below, you may have forgotten to run the Powershell elevation command (just above).
If you know what you're doing, or you despise chocolate (who would?) you can install the prerequisite tools manually.
Simply make sure all the tools listed above are functional before moving to the next point.
Create a folder somewhere on your disk, and name it with the name of your mission. This will be referred as the working folder.
For example, I use D:\dev\_VEAF\VEAF-OpenTraining-Caucasus
for the Caucasus Opentraining mission.
WARNING : do not use spaces or special characters in this folder's path. E.g. no Program files
or VEAF Missions
but VEAF_Missions
is OK.
Download this repository on GitHub and unpack all the files in your working folder.
It should look like this :
You must start with a DCS mission file as the basis of your VEAF scripted mission.
We provided a blank canvas for Caucasus (empty-caucasus.miz
), Syria (empty-syria.miz
) and Persian Gulf (empty-persiangulf.miz
)
Copy the mission of your choice in the root of this folder, and name it template.miz
.
If you select a mission that already has some scripts and triggers, it's ok as long as it doesn't conflict with the VEAF's own scripts and libraries. In doubt, contact me (Zip) on VEAF Discord's
If you want to reinject the VEAF scripts and triggers in a mission that already has some version of them, you must simply remove the related triggers (they should be colored) and save the mission (in the DCS Mission Editor) before using it as the starting mission.
Failing to do this will result in a non-functional mission that has too many triggers and will not load correctly.
Open the working folder in Windows Explorer (the file manager) and double-click on init.cmd
It'll ask for a mission name. This is the name of the mission you want to build (no space, no underscore, please), e.g. VEAF-test-mission
.
The name of the mission will be the name of your project. It should also be the same name as your working folder (not mandatory, but recommended).
It should not contain any space or underscore, and no trailing .miz (it's not a DCS mission file name) !
Let's say I want to initialize a new mission called "My cool and shiny mission - Caucasus".
I'll start with replacing spaces with dashes : "My-cool-and-shiny-mission-Caucasus". I'll extract a fresh copy of the VEAF-mission-directory-template
GitHub repository into a new folder called My-cool-and-shiny-mission-Caucasus
(we'll refer to this as "mission folder").
As I want to create a mission in Caucasus, and I have no existing mission, I'll rename the empty-caucasus.miz
to template.miz
in my mission folder.
Then I'll open my folder in the Windows Explorer, and double-click on init.cmd
.
At the What's the name of your mission (no space, no underscore, no accents) ?
prompt, I'll type the name of my mission : My-cool-and-shiny-mission-Caucasus
.
The script will take template.miz
(which is in fact empty-caucasus.miz
, which I renamed) as its basis, and prepare the mission folder with everything needed to compile the mission (create the .miz
file).
The script will run, and you should check for errors in its output.
At the very end, it'll pause and remind you that you should open the newly created mission file in the DCS Mission Editor, ensure that there is at least one unit of any kind on the map for each side (blue and red), add a Game Master slot, and save it.
So, let's simply do that. Start by opening the newly created mission in DCS Mission Editor.
On the main DCS Editor toolbar :
Click on the "game slots" button (1), add at least a blue Game Master
Click on the "add ground unit" button (2), add at least a ground unit for each side (blue and red)
Save the mission (3)
The mission is now ready, in a DCS mission file (ending with .miz
).
We'll need to run the extract.cmd
script to safely store the content of the mission file into the src
folder of our working directory.
To do that, simply double-click the extract.cmd
script in the Windows Explorer, and wait until the end. The script will pause when it's done, so you can look at its output and eventually close the window.
Now that you have a working directory with everything needed to build and maintain a VEAF mission, you should read this document to understand the build -> edit -> extract cycle.
You can also run the scripts with parameters from the command line.
In a command shell, ensure that you're in the mission working directory (this folder)
simply type init.cmd
, followed with a space and the name of the mission you want to build (no space, no underscore, please).
E.g. init.cmd VEAF-test-mission
.
By default, the script looks for a template.miz
file and uses it as the basis for the new mission.
It's possible to specifiy a specific file as the template ; for example : init.cmd My-cool-and-shiny-mission-Caucasus empty-caucasus.miz
By setting a value to the LUA_SCRIPTS_DEBUG_PARAMETER
environment variable, it is possible to tune the logging level of the trigger injector LUA script.
Possible values are :
-debug
: debug level, additional information-trace
: trace level, everything is written
This is useful to understand why a specific run does not work
If your 7zip tool is not in your PATH, you can set its location in the SEVENZIP
environment variable. It's a string which should point to the 7za
executable (e.g. c:\tools\7zip\bin\7zip.exe
)
In the same way, you can set its location of the LUA executable in the LUA
environment variable. It's a string which should point to the lua
executable (e.g. c:\tools\lua\bin\lua.exe
)
If you set the NOPAUSE
environment variable to "true", then the pauses in the script will not be marked.
Please see this document.