Serc – User

From Bohemia Interactive Community
Revision as of 20:21, 4 July 2009 by Serc (talk | contribs) (coding)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

//i am a comment
notCommentedAttribute = notCommentedValue; // commented
// commentedAttribute = commentedValue

Block Comment

/* i an a comment block
and it works over multiple lines
until its over */

notCommentedAttribute = /* commentedValue */ notCommentedValue;

Formatting

Many ways of formatting, matter of taste and standards blah

Variant1

class name { attribute = value; };

Variant2

class name { attribute = value; };

Variant3

class name {attribute1 = value;};

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"; }; };