Skip to content

Building CBA from source (HEMTT)

jonpas edited this page Oct 17, 2023 · 5 revisions

This page describes how you can setup your development environment for CBA, allowing you to properly build CBA and utilize file patching, using HEMTT. For Mikero tools, see Building CBA from source.

Requirements

  • Arma 3
  • Arma 3 Tools (available on Steam)
  • Run Arma 3 and Arma 3 Tools directly from Steam once to install registry entries (and again after every update)
  • [Windows] PowerShell v3.0+

Getting Source Code

To actually get the CBA source code on your machine, it is recommended that you use Git. Tutorials for this are all around the web, and it allows you to track your changes and easily update your local copy.

You can clone CBA with any Git command line client using the following command:

git clone https://github.com/CBATeam/CBA_A3.git

If you just want to create a quick and dirty build, you can also directly download the source code using the "Download ZIP" button on the front page of the GitHub repo.

Setup and Building

Initial Setup

Execute setup.bat in tools folder (Windows) or download this HEMTT binary and place hemtt in project root (Linux).

File Patching Setup

Not available on Linux as there is no officially supported Arma 3 client for Linux.

Navigate to tools folder in command line.

cd <path-to-cloned-repository>/tools

Create the following links manually. First, create x folder in your Arma 3 directory. Then run the following command as admin, replacing the text in brackets with the appropriate paths:

mklink /J "[Arma 3 installation folder]\x\cba" "[location of the CBA project]"

You can also use provided setup.py if you have a P-drive setup by following the same instructions. P-drive is not required for HEMTT or file patching!

Create a Test Build

To create a development build of CBA to test changes or to debug something, execute build.bat (Windows) or run $ hemtt build (Linux) in the root folder. This will populate the addons folder with binarized PBOs. These PBOs still point to the source files in their respective folders however, which allows you to use file patching. This also means that you cannot distribute this build to others.

To start the game using this build, you can use the following modline:

-mod=x\cba

Create a Release Build

To create a complete build of CBA that you can use without the source files, execute build_release.bat (Windows) or run $ hemtt build --release (Linux) in the root folder. This will populate the releases folder with binarized PBOs that you can redistribute. These handle like those of any other mod.

File Patching

File patching is fully supported just like with Mikero Tools.

Disable CBA Function Caching

Reference Disable CBA Function Caching.

Restrictions

Reference Restrictions.

Clone this wiki locally