Jump to content
Sign in to follow this  
bewilderbeest

Helper script when your mission is in git (source control)

Recommended Posts

Hi all,

I just wanted to share a little utility script with you that I've found really helpful when I've been editing a Wasteland misson that I keep on github.com. Using source control for ArmA missions is incredibly useful if there's more than one person wanting to make changes, and we employ this script when editing our KoS Wasteland fork of the original by 404/Fakstah/JoSchaap.

:: install.bat
::
:: This script has two functions
::
:: 'install.bat test'    - Copies the mission to your local MPMissions folder
:: 'install.bat package' - Compiles a PBO for testing with a standlone server

@ECHO OFF

:: Set your ArmA3 profile name and PBO dest dir below.

IF "%username%" == "Someone A" (
 :: Your profile is assumed to be in "Arma 3 - Other Profiles"
 SET LOCAL_ARMA_PROFILE=[Clan]SomeoneA
 :: Your local standalone server directory
 SET PBO_DESTINATION_DIR="C:\ArmaEditing\ArmA3\A3Master\MPMissions"
)

IF "%username%" == "Someone B" (
 SET LOCAL_ARMA_PROFILE=[Clan]SomeoneB
 SET PBO_DESTINATION_DIR="G:\Games\a3master\MPMissions"
)

:: General definitions

SET SOURCE_DIR="%USERPROFILE%\Documents\GitHub\Wasteland"
SET PBO_TOOL="C:\Program Files (x86)\Bohemia Interactive\Tools\BinPBO Personal Edition\BinPBO.exe"

SET LOCAL_MISSION_NAME=KOS_Wasteland.Stratis
SET TEST_DESTINATION_DIR="%USERPROFILE%\Documents\Arma 3 Alpha - Other Profiles\%LOCAL_ARMA_PROFILE%\MPMissions\%LOCAL_MISSION_NAME%"

:: end config

IF %1.==. GOTO NOARG
IF "%1" == "test" GOTO TEST
IF "%1" == "package" GOTO PACKAGE
GOTO NOARG

:: Package mode - Creates a PBO file of the mission

:PACKAGE 

ECHO "Building PBO..."

mkdir %TEMP%\%LOCAL_MISSION_NAME%
xcopy /q /s /y %SOURCE_DIR%\* %TEMP%\%LOCAL_MISSION_NAME%

echo Copied to %TEMP%\%LOCAL_MISSION_NAME%

%PBO_TOOL% %TEMP%\%LOCAL_MISSION_NAME% %PBO_DESTINATION_DIR%\
rmdir %TEMP%\%LOCAL_MISSION_NAME% /s /q

GOTO END

:: Test mode - Install Wasteland to your MPMissions folder of your profile

:TEST

ECHO "Building a test install..."

mkdir %DESTINATION_DIR%
xcopy /q /s /y %SOURCE_DIR% %TEST_DESTINATION_DIR%

GOTO END

:NOARG

echo "install.bat - Installs the Wasteland mission for testing or packaging"
echo Error: You must specify 'test' or 'package' as an argument

:END

The mission source stays in Documents/GitHub/<REPO NAME>, and the above code should become 'install.bat' in the root of your repo. This script has two modes of operation:

  1. Copy the mission to my local profile directory for editing and client testing
  2. Make a PBO and copy to my standalone server missions directory

The first mode will allow you to open the mission up in the in-game editor. For our Wasteland mission, I find I still use this way of doing things to change map content.

The second mode allows you to test any specific code you've written that is specifically for the standalone server. Wasteland in particular has a lot of specific client and server code, so checking locally in standalone mode is really necessary prior to rolling out onto your live public server.

Just throwing this out there, hopefully some of you guys will find it useful too!

Cheers,

Bewilderbeest/Nick

Share this post


Link to post
Share on other sites

Personaly i use Arma Dev for Eclipse still and installed Egit which lets me do version control using github itself. I usually flip flop between eclipse and notepad ++ though, to make matters worse im using the eclipse arma plugin that hasn't been updated in years.

Share this post


Link to post
Share on other sites

Ah interesting, so you edit a git clone of the mission directly inside your mission folders? I didn't know about the Eclipse plugin, I'm using Sublime Text 2 with a syntax highlighter for SQF files, which does the job.

Share this post


Link to post
Share on other sites

If i have my workspace set to the mission folder, otherwise i have my workspace set to the project im working on which might include a mission, script and/or mod im working on.

http://forums.bistudio.com/showthread.php?124120-ArmADev-Eclipse-Plugin

http://www.eclipse.org/egit/

http://friedenhq.org/?page_id=21

Edited by xyberviri

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×