====== ArmA 2 Configs In general ======
[[https://www.pmctactical.org/forum/viewforum.php?f=50|ArmA 2 Forum]], [[:arma2|ArmA 2 Home]], [[arma2:config|ArmA 2 Config]], [[arma2:file_formats|ArmA 2 File Formats]], [[arma2:missions|ArmA 2 Missions]], [[arma2:modeling|ArmA 2 3D Modeling]], [[arma2:scripting|ArmA 2 Scripting]], [[arma2:terrain|ArmA 2 Terrain]], [[arma2:texturing|ArmA 2 Texturing]], [[arma2:tools|ArmA 2 Tools]]
**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";
};
};