Skip to content

DEV Setup

Saveliy Tronza edited this page Jan 23, 2021 · 10 revisions

Repository setup

  1. If it's first time you run powershell scripts, you must allow powershell to run scripts on your computer. To do this, open powershell and type: set-executionpolicy -Scope CurrentUser -ExecutionPolicy Bypass You only need to do it once at your computer.
  2. Set up the repository in the folder where arma saves editor missions.
  3. Run devsetup.ps1 in repository root.

Folder structure

src - This folder contains all mission source code. Treat it same as you would treat a MyMissionName.Altis folder of your custom mission.

Vindicta-Addon - This folder contains files for the addon part of our project.

Vindicta.Altis, Vindicta.Malden, etc - These folders must be opened with Arma editor as if they were actual missions. Don't put anything else there manually, it won't be added to the created PBO files.

Updating stringtable.xml

stringtable.xml is located in configs folder. If you want to edit it, change it there. For changes to take effect, run updateStringtable.ps1 file, it will copy stringtable.xml to all mission folders.

Adding files to mission root

If you need to add files to mission root (such as Vindicta.MapName folder), you must edit devsetup.ps1 and tools\builder\config.json. If you don't do so, they won't be added to the created mission PBO files. Adding these files might be needed because Arma or certain addons expect certain files to be in mission root, such as init.sqf, description.ext, cba_settings.sqf and similar. Make sure you don't commit changes to .sqm files if you don't intend to change them!

Adding new maps

Create a folder which follows pattern Vindicta*.mapName in repository root and add a mission.sqm there, then run devsetup.ps1 again. After that add new configuration entry to tools/builder/config.json missionFolders array: Values have the following meaning:

  • folder - Must directly match to the folder name within repository root.
  • CfgMissionsEntry - the CfgMissions class name, which will be used for server rotation.
  • mapName - Map name in the game, same as the map name in folder name.
  • briefingName - Mission name which will be shown in the mission selection screen. This kind of configuration lets us create multiple map variants per each map.

How folder structure works

When you run devsetup.ps1, symbolic links are created from all Vindicta.mapName\src folders to src folder. Files such as description.ext and similar just contain a preprocessor #include command to include src\description.ext into them. With this approach we can open, edit and run all maps in the Arma mission editor.

VS Code

  1. Get VS Code: https://code.visualstudio.com/
  2. Install extensions (using the Extensions tab on the left) SQF Language and SQFLint:
    image
  3. Install the OOP-Light extension from here: https://github.com/Sparker95/vscode-sqf-oop-light/releases . Download the .vsix file, go to VS Code, press F1, type vsix and push Extensions: Install from VSIX. Make sure you open the Outline view: View->Open View...->Outline.
  4. Go to File/Open Workspace and navigate to vscode.code-workspace file in the project root

You can run unit tests, including compiling classes, directly in VSCode (using SQF-VM). To do this, press F1, type tasks, click Tasks: run task and then Tests: All. You can also run tasks by using Terminal menu -> Run Task.
Annotation 2019-05-18 134401

The VSCode workspace includes:

  • snippets to help with writing OOP_light classes
  • exclusions to help SQF-lint ignore some false positives
  • tasks for a few things, including copying around the sqm file, building the PBO, and running test code

Debugging addons

  1. Load all mods here: https://steamcommunity.com/sharedfiles/filedetails/?id=1729568870 Annotation 2019-05-18 132848
  2. Disable BattlEye!

  3. Don't dare to step into SQF territory without Arma Debug Engine armed. Just don't.

Building the mission PBOs only

  1. Run builsMissions.ps1in project root.
  2. PBO files for individual missions will be in folder _build\missions\separatePBO

Building the whole add-on

  1. Run tools\Builder\builsMissions.ps1
  2. Run tools\Builder\buildAddons.ps1
  3. The folder with created addon is _build\addon\Vindicta, it can be uploaded to Workshop or loaded as an addon with Arma launcher.
  4. If you edit only the files in Vindicta-Addon, you can skip step 1 on following builds, but it must be run at least once.

Source Code Documentation (outdated!)

You can access the .html documents for all our functions in \Docs\HTML folder. This should be your main source of information about function arguments. We use Natural Docs to generate documentation for functions: https://www.naturaldocs.org/ You can rebuild the documents yourself with \Batch\NaturalDocs.bat . You must install Natural Docs on your PC prior to that and add it to your PATH.

Logging

The project uses a custom mod for logging (arma-ostream, installed as part of the requirements above). This separates out logging from different modules into different rpt files. Log Expert is a program that can help with viewing the logs: https://github.com/zarunbal/LogExpert