User Tools

Site Tools


arma2:config:configs_general

ArmA 2 Configs In general

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";
	};
};
arma2/config/configs_general.txt · Last modified: 2024/08/01 17:01 by snakeman

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

All PMC web site download services are temporarily suspended until web site yearly fees have been recovered, want to download addons/mods? Then Support PMC.

If you are grateful for all the work PMC has done in the past 25 years, use Support PMC page.