Skip to content

Adding missions to Tour GitHub

a-455 edited this page Sep 4, 2022 · 9 revisions

Adding a mission to the Tour organisation

Request access to the Organization from a server admin for if you have not done already (https://github.com/Tour-of-Teamrespawn)

Environment config

ONE TIME SETUP (per Windows user) - These steps assume you are starting from scratch, and these sections only need to be done the once per Windows user profile. So unless you buy a new PC or create a new user account it is just a one-time config.

Prerequisites

Install git for Windows (https://git-scm.com/download/win). During the installer, make sure to change the git editor from VIM to "Visual Studio Code" to make further editing easier.You can then just next/next all the way through the rest of the installer wizard.

(OPTIONAL, but highly recommended) Install VS code (https://code.visualstudio.com/download), or other editor of your choice with native Git integration. VS Code will make life easier if you set it as your preferred program for all available extensions & file types. You can then install some useful extensions by clicking the 5th icon from the top (Extensions) on the far left hand bar/pane and searching for them. The ones that are most useful for ARMA stuff (for me) are:

  • SQF formatter
  • SQF Language
  • Arma 3 CfgFunctions
  • PowerShell (for build script)

Configure Git user & email

Once git (and optional VSCode) are installed, hit Windows, search for and open "PowerShell", either a normal one or inside VS Code (but not as admin). Then you can run the below, changing your username & email that you want to attach to commits:

# Configure your Git username/password to attach to commit messages
git config --global user.name "my_username"
git config --global user.email "my_email_123@gmail.com"

Per mission config

Below are the steps to initialise a mission folder with Git and add it to the Tour GitHub organisation. This process will only need to be completed ONCE PER-MISSION.

Initialise Git for your mission

Firstly, make you you do NOT binarize your mission.sqm so that Git can properly track the changes to it, line by line.

Open PowerShell (can use VS Code integrated powershell terminal or default blue one) and run the below, making sure to:

  • Ensure the $MissionFolderRoot actually points to the right folder and there is no trailing ""
  • Replace mission name as appropriate for your mission
  • Ensure the $MissionFolderName does not have a version in! Be sure to leave the world name as it is (otherwise the ARMA editor will break)
# Substitue the below path to make YOUR user names & mission name
cd "C:\Users\my_windows_username\Documents\Arma 3 - Other Profiles\my_arma_username\missions\30_tour_power_surge.Enoch"
git init
git add .
git commit -m "Initial commit"

Add to GitHub organization

Steps:

  • Go to the GitHub Organization (https://github.com/Tour-of-Teamrespawn) in your browser
  • Click the green NEW button, to create a new git repository
  • Set the repository NAME to be the mission folder name (e.g. with example above: 30_tour_power_surge.Enoch)
  • Ensure it is PUBLIC access (open source <3)
  • Finish & create

You can then go to your new (empty) GitHub repository and copy the commands from GitHub page saying: "…or push an existing repository from the command line"

Example commands for repository name of test

git remote add origin https://github.com/Tour-of-Teamrespawn/test.git
git branch -M main
git push -u origin main

Once you have entered the commands without issue, if you refresh GitHub in your browser you and the rest of the Tour should now see your code!