# [![VEAF-logo]][VEAF website] Mission Creation Tools

[![Badge-Discord]][VEAF Discord]

Warning: Veaf Mission Creation Tools (VMCT) have been updated to from version 4.65.0 to 5.0.0

This is a major update, and it is not backward compatible with previous versions.

## What's new ?

Mainly, the way the scripts are loaded and packaged has changed.

Before version 5, the scripts were individually loaded with a specific action for each script, in the static load trigger.

This meant that each time we wanted to change the VMCT structure (add, remove, merge modules), we had to update the static load trigger, and break all the existing missions.

Now, the VMCT have a compile command that put all the modules together in a single file, and this file is loaded via a single action in the static load trigger.

If we add or delete modules, we just have to recompile the VMCT, and all the existing missions will be updated.

## Can I still use the old version ?

Yes, you can still use the old version, but you will not be able to use any new features or bug fixes.

If you let your missions untouched, they will still use the latest 4.x.x version of the VMCT.

In this version, the way the modules are loaded is via multiple actions, as it is in your mission.

## How to update my existing mission ?

You can update your existing mission by following these steps:

- build your mission statically with the old (4.x.x) version of the VMCT; store this somewhere for a few minutes
- edit your `package.json` file and change the version of the VMCT from `^4.0.0` to `^5.0.0`
- delete the `yarn.lock` file if it exists
- make a copy of your .miz file (the one you just built), edit it in the mission editor and remove the 6 VMCT triggers (see below)

  [![4.x.x-triggers-to-remove]][4.x.x-triggers-to-remove]
  
- use the mission converter to inject the (new) VMCT triggers into this mission; **warning: get the new mission converter [from GitHub](https://github.com/VEAF/VEAF-mission-converter)!**
- don't forget to **open and save your converted mission in the DCS mission editor**! Failure to do this would result in a mission running perfectly on a client PC (solo) but failing to load the scripts on a multiplayer server!
- change your `build.cmd` and `extract.cmd` script by comparing them to those generated by the mission converter
- copy the generated mission (with the triggers) in your mission folder
- use the `extract.cmd` script to extract the mission in the `src` folder
- rebuild the mission (with the new VMCT) using the `build.cmd` script
- test the mission (look in the log file, check for errors about symbols like "attempt to index global 'veaf' (a nil value)")

## Contacts

If you need help or you want to suggest something, you can:

* contact [Zip on Github]
* go to the [VEAF website]
* post on the [VEAF forum]
* join the [VEAF Discord]


[Badge-Discord]: https://img.shields.io/discord/471061487662792715?label=VEAF%20Discord&style=for-the-badge
[VEAF-logo]: https://veaf.github.io/documentation/images/logo.png
[VEAF Discord]: https://www.veaf.org/discord
[Zip on Github]: https://github.com/davidp57
[VEAF website]: https://www.veaf.org
[VEAF forum]: https://www.veaf.org/forum

[documentation-old]: ./old_documentation/_index.md
[documentation-site]: https://veaf.github.io/documentation/
[documentation-repo]: https://github.com/VEAF/documentation

[4.x.x-triggers-to-remove]: ./README-5.0.0.png
