Simple repository for the latest version of the Tour dev helper script that can automatically update the version of your mission, pack it as a PBO, upload your mission to the Tour server, and then start a local dedicated server instance with your new mission loaded for LAN testing.
Prerequisites for this helper script are as follows:
- ARMA 3 installed.
- ARMA 3 Tools installed.
- Tour server access to upload files via FTP. (Ask an admin for CPDeluxe access if you do not have this already).
- ARMA 3 dedicated server installed. (Optional - To aid faster local development)
- Copy the
build.ps1
&build.config.ps1
files from this repository, to the root of your mission folder.- e.g.
C:\Users\user\Documents\Arma 3 - Other Profiles\ARMA_User\missions\30_tour_mission_name.Altis\build.ps1
.
- e.g.
- If you want to use the start local dedicated server option, copy the
server.cfg
file to your Arma 3 install folder if you do not have one already.- NOT your mission folder! It should go in the same directory where the
arma3server.exe
/arma3server_x64.exe
is located. - Replace
MY_PLAYER_ID
in the file with your Arma 3 ID to get admin/debug console. - If you already have a server.cfg or equivalent config file, ensure that you have a
Missions
class defined. See below for example:
- NOT your mission folder! It should go in the same directory where the
class Missions
{
class TestMission01
{
template = MISSION_NAME.WORLD;
difficulty = "veteran";
class Params {};
};
};
- Open the
build.config.ps1
file in your text editor and make all the variables are set correctly. If required, see Variable reference for more information. - Create or edit
init.sqf
in the root of your mission folder. Then add a comment anywhere in theinit.sqf
with the format###MISSION_VERSION 0.1
leaving###MISSION_VERSION
exactly as-is and replacing0.1
with the current mission version.- The version currently MUST be in the format of
X.X
whereX
is one or more digits [0-9
]. - The comment can be either a line
// comment
or multi-line block/* comment */
type.
- The version currently MUST be in the format of
- Ensure that ALL other files with a reference to the mission name and version in are updated to match the right format you set for
$MissionName_WithV
. If it does not exactly match, then it won't update or change a reference.
- Open a PowerShell terminal (can be the integrated terminal in VS Code).
- Navigate to your mission folder with
cd "c:\path\to\mission\folder"
. - Enter and run:
.\build.ps1
. - Follow the on-screen script prompts, explanations for which are:
- Increment version and pack PBO.
- With automatic or manual versioning. Manually specifying version would be used to say "build / release this as version 1.0" for example.
- Set non-playable version tag
- Default is no tag, meaning that this version has been tested and is good for public server play.
- Other option is to manually specify a tag, such as
beta
orRC1
so that server admins can filter out test versions.
- Upload newly incremented & packed PBO to Tour server (requires step 1 to be chosen in this run).
- Specify Tour server IP (if environment variable
TOUR_SERVER_IP
is not defined). - Specify Tour FTP port (if environment variable
TOUR_SERVER_PORT
is not defined). - Specify Tour FTP username (if environment variable
TOUR_FTP_USERNAME
is not defined). - Specify Tour FTP password (if environment variable
TOUR_FTP_PASSWORD
is not defined).
- Specify Tour server IP (if environment variable
- Start local dedicated server with newly packed / incremented PBO.
- Increment version and pack PBO.
- (OPTIONAL) Use the script self-updater to save a few clicks copy & pasting from GitHub.
- Enter and run:
.\build.ps1 -Update
- Enter and run:
It can get a little tedious to enter the Tour IP, FTP port, FTP user/pass each time you run the script, so there is the option to use environment variables to save entering them every run. There are various ways to set these variables, but I will cover three below. It is important to note that this so you don't have to type it out every time but is 100% not required at all for the script to work.
Choose ONE of the following options:
- Manually setting via PowerShell
- Manually setting via Windows GUI
- Using a PowerShell profile script that runs each time you open that PowerShell window
This is the easiest option, however I have seen that it can take a LONG time to apply (1-4 minutes) so be patient and as long as it doesn't throw an error then you'll be good to go.
Just open the terminal you will use to run the build script normally as your normal user (not as Admin) and enter:
[Environment]::SetEnvironmentVariable("TOUR_SERVER_IP", '1.2.3.4', "User")
[Environment]::SetEnvironmentVariable("TOUR_SERVER_PORT", '8821', "User")
[Environment]::SetEnvironmentVariable("TOUR_FTP_USERNAME", 'MyCPDusername', "User")
[Environment]::SetEnvironmentVariable("TOUR_FTP_PASSWORD", 'Password123!', "User")
Restart your VS Code / PowerShell and then you should be good to go.
This is the same as above but using the GUI, assumes Windows 10/11.
- Click Start or press Windows Key
- Search for & open the Settings App
- Search for "Environment"
- Select the option "Edit environment variables for your account"
- In the pop-up window, click "New"
- Enter the variable name
TOUR_SERVER_IP
- Input the correct value
- Repeat step 6 for
TOUR_SERVER_PORT
TOUR_FTP_USERNAME
TOUR_FTP_PASSWORD
- OK all open windows
- Done
Now restart any VS Code or PowerShell windows to get the new variables.
Open PowerShell from where you would normally run the build script, this would probably be using VS Code's integrated terminal if you use that (drag up from the bottom from between the blue/grey border and select the terminal tab) or just the normal PowerShell window if you don't.
The first step is to create the parent directory if it doesn't already exist:
# Check the path where this PS would load a profile from, including file name
# You will notice this will be different when run from VS Code terminal and the native (blue) one
Write-Host $profile
# Create the parent directory, including any missing intermediates
mkdir $profile.substring(0,($profile).LastIndexOf('\'))
Then you will need to either manually create the file listed in that $profile
variable OR run the below to create it, replacing below with actual values.
# Create a new profile file, with specified contents
New-Item $profile -Value @"
# e.g. '12.23.34.45'
$ENV:TOUR_SERVER_IP ='ENTER_TOUR_IP'
$ENV:TOUR_SERVER_PORT = 8821
# if you have single quotes (') in your password, you can swap it below for doubles (")
$env:TOUR_FTP_PASSWORD = 'MY_PASSWORD_FOR_CPDELUXE'
$env:TOUR_FTP_USERNAME = 'MY_USERNAME_FOR_CPDELUXE'
"@
# Open up the file with your default text editor to check
Invoke-Item $Profile
If it all looks OK, then you can restart VS Code / PS and try to run the build script. If all is well it will not prompt you any more (until you change your CP Deluxe password!).
NOTE: If you get an error saying something like "Scripts are not allowed on this system" then you will need to open PowerShell "As Administrator" and run: Set-ExecutionPolicy Unrestricted -Force -Confirm:$false
and then close & re-open.
This section is just a reference for the script variables that can be set, split into standard variables:
$MissionName_withV
is likely to be the only thing you need to change if you have installed everything with default settings. Make sure you leave out the version number (e.g.1.0
) but keep thev
.$Arma3InstallFolder
is just the directory where Arma 3 is installed to. (No trailing\
).$Arma3ToolsFolder
is where your Arma 3 Tools is installed. (No trailing\
).$OutputPath
is where the script will save the PBO. Defaults to your MPMissions folder to ease local testing.$FileBank_EXE
is the path to FileBank, which part of the Arma 3 Tools Steam download.
...and dedicated server variables:
$A3_Server
is the file path to the Arma 3 server exe.$A3_Server_Config
is the file path to theserver.cfg
file.$ClientModList
is the list of REQUIRED mods for your clients. Those in the default list are all Tour standard, though it is not an exhaustive list. (MUST ALREADY BE INSTALLED FROM WORKSHOP).$ServerModList
is the server-side only mod list. (MUST ALREADY BE INSTALLED FROM WORKSHOP).