Do you want to improve your server configuration experience for DayZ? Look no further! This quick guide will teach you how to use VS Code and validate your missions thoroughly. Let’s get started!
Intro
In the text I’ll refer to the editor as VS Code because it’s more recognizable, but I’m actually using VSCodium[vscodium.com] which is FLOSS and telemetry free. You can pick any VSCode-based editor and the workflow will be the same.
Installation
- First you need the editor, if you don’t already have it, you can download VS Code from the site[code.visualstudio.com] or get VSCodium from the link above.
- Next, we encounter a minor inconvenience: the extension we want to install requires Java[www.java.com] 17 or newer to work. You can check wether you meet requirements by typing
java –version
in command line. If you have an older version or don’t have Java at all, you can download it from the link above or with one command if you use Windows 11:
winget install Microsoft.OpenJDK.21 - Now we can install the extension. Open the editor, go to the Extensions and try to search for “dayz”. You will find DayZ CE Schema which we’ll install:
After the installation your editor is ready for DayZ missions!
Opening a mission
Use File -> Open Folder (or Ctrl+K Ctrl+O) and select mission folder, alternatively you can just drag the mission folder into the editor window:
Expansion setup
- Expansion comes with its own events, types and spawnable types so we copy the whole expansion_ce folder from template[github.com] into our mission and open expansion_types.xml:
At the top of the file you will see a warning and if you press Ctrl+. a menu with available fixes will pop up. We get the warning because expansion_types.xml is in the mission folder but hasn’t (yet) been added to cfgeconmycore.xml so will have no impact on server economy. - Pick “Add file to the mission” quick fix and expansion_types.xml will be added to cfgeconmycore.xml. Unfortunately applied changes aren’t saved automatically, so press Ctrl+K S to save them. The warning will disappear and expansion types are now part of the mission. You can repeat similar process for events and spawnabletypes or copy lines from the cfgeconmycore.xml provided in the template.
- Now go back to the expansion_types.xml. You will see a huge list of category “vehicleparts” doesn’t exist errors. This happens because Expansion mission template is slightly outdated ¯\_(ツ)_/¯. vehicleparts category was removed from cfglimitsdefinition.xml in 1.23 patch. Thanks to extensive validation we found this problem without even running a server and examining logs! If you place cursor at the beginning of the name and press Ctrl+Space to trigger autocompletion you can see all available categories. We need to change vehicleparts to lootdispatch.
There is no way to fix this error automatically, but we can use Search&Replace (Ctrl+F) to replace all categories at once. - Let’s take a look at problems in expansion_events.xml. NOTE: VS Code can validate only opened files, you won’t get errors for a file without opening (or previewing it) it!
At the top of the list we get the warning Type with classname “Truck_01_Covered_Grey” does not exist because … well, there really is no grey variant of V3S ¯\_(ツ)_/¯. Sometimes you will see false positive errors of this type because casing doesn’t match what’s in the types files so extension can’t find the classname, but this time it appears to be a legit warning. You can remove this child line or just ignore it. Next we can see a bunch of Event … is not referenced in cfgeventspawns.xml these notifications are a friendly reminder that we have not yet copied contents of the cfgeventspawns.xml provided with the template into our mission. - Drag the cfgeventspawns.xml provided with the template into your editor. At the top of the file you will see a message that file is not part of the mission, but you can copy its contents. To do this open code actions popup and pick suggested action. You are copying new events, so it doesn’t matter in which order we add them to the file. I prefer top for visibility. After saving changes to the mission cfgeventspawns.xml, diagnostic messages for events disappear. Now you can close the file from the template.
- Copy expansion folder from the template to the mission in order to finish minimal Expansion setup.
Weapon mod setup
- Assuming you’re lucky and a mod author provides a types file with the mod, you can drag the file into the editor and the familiar reminder will pop up. The file is not part of the mission but you can copy it with a single click. Note that custom files are copied to the db folder and VS Code automatically switches to the copied file.
In my case, fortunately, the file doesn’t contain any errors, but it does have ♥♥♥♥♥♥ formatting. You can easily fix the formatting by pressing Alt+Shift+F, but make sure you format the file from the mission, not the external one. - You can add spawnabletypes in a similar way. Note that there is autocompletion for classnames in spawnabletypes files (use Ctrl+Space to trigger it):
Other features
- Navigation. DayZ mission is a set of interconnected files and features like Find References and Go to Declaration help you move between them more quickly. You can access these features from the context menu by right-clicking on symbols:
“Peek …” interface also allows you to quickly edit another file next to the reference without switching document tabs (I use Alt+F12 to peek preset definition): - Linked editing. VS Code helps you maintain integrity of references in your mission files. For example, you can rename a truck spawn event in events.xml and its name in expansion_events.xnl and cfgeventspawns.xml will change accordingly. You can preview changes without applying them.
Note that renaming (F2) an event leaves the “Vehicle” part intact, because events can have arbitrary names but must start with specific prefixes to work properly.
And that wraps up our share on DayZ: VS Code for Mission Configuration Quick Start Guide. If you have any additional insights or tips to contribute, don’t hesitate to drop a comment below. For a more in-depth read, you can refer to the original article here by Baltic 9, who deserves all the credit. Happy gaming!