{"name":"CPP File Format","title":"CPP File Format","type":"topic","url":"https://community.bistudio.com/wiki/CPP_File_Format","revid":373452,"updated":"2025-05-08T11:44:17Z","aliases":[],"markdown":"The `.cpp` file extension is a generic identifier that *indicates* the contents contain pre-raPified text and *can* be raPified (binarised).\nThis is by convention only - the actual content could be binarised already and the engine would load it without failure.\n\n> [!NOTE]\n> The binarised (raPified) equivalent of `.cpp` file is `.bin` - see Config.cpp/bin File Format.\n\nThere are currently several cpp/bin files used by Bohemia Interactive:\n\n- Config.cpp/bin\n- Mod.cpp/bin\n- Product.cpp/bin\n- Resource.cpp/bin - Operation Flashpoint only\n\n### Syntax\n\nValues are set in the following format: `valueName = value;` - a semicolon always ends the line.\nThey can be present at the root of the file but more frequently than not will be defined in a **class** - note that **classes are also ended by a semicolon**.\n\n```cpp\nclass MyConfigClass\n{\n    intValue = 42;\n    floatValue = 66.6;\n    stringValue = \"text\";\n    translatedValue = \"$STR_MyStringtableKey\"; // quotes are good practice\n    arrayValueColour[] = { 1, 0, 0, 1 };\n    arrayValueRandom[] = { \"ValuesCanBeMixed\", 1, 42.0, { 0, 1, 0, 1 } };\n\n    class MySubConfigClass // subclasses are possible\n    {\n        subValue = 123456;\n    };\n}; // a semicolon ALWAYS closes a class\n```\n\nThere are **no boolean value** in config; you can define them for ease of use/readability using `#define`, usually in the first lines:\n\n```cpp\n#define true 1\n#define false 0\n\nclass MyConfigClass\n{\n    // ...\n    useTexture = true; // would have otherwise to be useTexture = 1;\n    // ...\n};\n```\n\nA commonly-edited config file is Description.ext, a file storing scenario settings - the file extension differs but the syntax remains the same.","sections":[{"heading":null,"level":1,"markdown":"The `.cpp` file extension is a generic identifier that *indicates* the contents contain pre-raPified text and *can* be raPified (binarised).\nThis is by convention only - the actual content could be binarised already and the engine would load it without failure.\n\n> [!NOTE]\n> The binarised (raPified) equivalent of `.cpp` file is `.bin` - see Config.cpp/bin File Format.\n\nThere are currently several cpp/bin files used by Bohemia Interactive:\n\n- Config.cpp/bin\n- Mod.cpp/bin\n- Product.cpp/bin\n- Resource.cpp/bin - Operation Flashpoint only"},{"heading":"Syntax","level":3,"markdown":"Values are set in the following format: `valueName = value;` - a semicolon always ends the line.\nThey can be present at the root of the file but more frequently than not will be defined in a **class** - note that **classes are also ended by a semicolon**.\n\n```cpp\nclass MyConfigClass\n{\n    intValue = 42;\n    floatValue = 66.6;\n    stringValue = \"text\";\n    translatedValue = \"$STR_MyStringtableKey\"; // quotes are good practice\n    arrayValueColour[] = { 1, 0, 0, 1 };\n    arrayValueRandom[] = { \"ValuesCanBeMixed\", 1, 42.0, { 0, 1, 0, 1 } };\n\n    class MySubConfigClass // subclasses are possible\n    {\n        subValue = 123456;\n    };\n}; // a semicolon ALWAYS closes a class\n```\n\nThere are **no boolean value** in config; you can define them for ease of use/readability using `#define`, usually in the first lines:\n\n```cpp\n#define true 1\n#define false 0\n\nclass MyConfigClass\n{\n    // ...\n    useTexture = true; // would have otherwise to be useTexture = 1;\n    // ...\n};\n```\n\nA commonly-edited config file is Description.ext, a file storing scenario settings - the file extension differs but the syntax remains the same."}],"categories":["Real Virtuality File Formats"],"groups":["Tools and File Formats"]}