ArmA 2 Forum, ArmA 2 Home, ArmA 2 Config, ArmA 2 File Formats, ArmA 2 Missions, ArmA 2 3D Modeling, ArmA 2 Scripting, ArmA 2 Terrain, ArmA 2 Texturing, 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"; }; };