PMC websites shut down September 13th 2025 unless yearly web hosting fees are paid. Please Support PMC to help keep these websites online.

Enjoyed or found this pages content useful, please Support PMC to help me keep this web page online beyond september 13th 2025 when yearly web hosting fees are due.

User Tools

Site Tools


arma2:config:configs_general

This is an old revision of the document!


Configs in general

Configs in general

Basic Config File

Syntax

no two same class names in one file. no two same attributes in one class.

class name { attribute = value; };

the attribute array class name{ attribute = value; attributeArray[] = {value1,value2,value3}; };

Inheritance

powerful tool, less typing, easier to maintain

adding attributes class parentClass; class childClass : parentClass { additionalAttribute = value; };

overwriting values from parent class class parentClass { parentAttribute = value; }; class childClass : parentClass { parentAttribute = newValue; };

Commenting

Line Comment

// This is a comment
 
notCommentedAttribute = notCommentedValue; // commented
 
// commentedAttribute = commentedValue

Block Comment

/* This is a comment block
and it works over multiple lines
until its over
*/
 
notCommentedAttribute = /* commentedValue */ notCommentedValue;

Formatting

You should always use C++ indentation so your code looks nice, use 8 character TABs on new classes and so on.

Preprocessor Commands

define

Syntax:

#define variableName value

Usage: #define BASE_COLOR {0,0,0,0}; class button { backgroundColor = BASE_COLOR; };

include

Syntax:

#include "path\to\file.hpp";

Example Config

class cfgPatches
{
	class PBONAME
	{
		requiredVersion = 1.0; // requires ArmA2 version 1.0
	};
};
 
class cfgVehicles
{
	class SoldierWB; // a basic soldier class in ArmA
	class someNewSoldier : SoldierWB
	{
		displayName = "Rambo";
	};
};
arma2/config/configs_general.1309440952.txt.gz · Last modified: 2011/06/30 13:35 by snakeman