
Basic Config Tutorial
Moderators: Lone Wolf, Snake Man
-
- Newbie
- Posts: 5
- Joined: 2010-02-02 15:09:55
- Gaming Interests: ArmA 2 (Armed Assault 2)
- Editing Interests: All, I (try) to edit everything.
Basic Config Tutorial

-
- Commander-In-Chief
- Posts: 9833
- Joined: 2000-07-31 22:01:01
- Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
- Editing Interests: All, I (try) to edit everything.
- Location: PMC
Re: Basic Config Tutorial
Welcome to PMC Tactical forumMysteryman5150 wrote:I am new to this forum as well as Arma 2

Well that's easy, for complete beginners; config is config.cpp and scripting is the SQS or preferably SQF files.What I am in search of is an "Idiots guide to Config scripting" particularly the config.cpp files.
Config is what makes an addon, the configuration which tells game engine what the 3d model, wrp or other "entity" is.
Scripting is all sorts of commands you can use in the game engine.
"Config scripting" is wrong term.
Well for vehicles there is config of:adjustments to top speeds of vehicles and adjust speeds on different terrains,
Code: Select all
maxSpeed = 720; // max speed on level road, km/h
Well classes are made with the {} and arrays are made with []. All config lines ends with ; character.that would eplain what the symbols mean, i.e. ;{}[] and such, as well as how and where to use them.
You need to be bit more specific than that.I am also looking for a little more description on the text structure, as well as when you mod vanilla arma2 (no addons required) how do you know what vanilla addons to use, i.e. CAweapons and such.
IF YOU WANT TO KEEP USING PMC WEBSITES INCLUDING THIS FORUM, DOWNLOAD ADDONS, READ TUTORIALS, ETC, PLEASE HELP BY SUPPORTING PMC.
Support PMC
Please help to keep PMC websites online, if domains are let to expire then it will be "game over, man!".
-
- Newbie
- Posts: 5
- Joined: 2010-02-02 15:09:55
- Gaming Interests: ArmA 2 (Armed Assault 2)
- Editing Interests: All, I (try) to edit everything.
Re: Basic Config Tutorial
I guess all configs must start with this but here's a few questions.class CfgPatches
{
class TAG_MySounds
{
units[] = {};
weapons[] = {};
requiredVersion = 1;
requiredAddons[] = { "CAWeapons" };
};
};
1)The structure-
a)Why no { before class CfgPatches?
b)why the empty space after the { between CfgPatches and the Class TAG_MySounds and then between My_Sounds and units []? Is this just for keeping the text clean looking?
2)Symbols-
a)Why is there nothing between the [] and why and/or when would you need to place text in there?
b)Same question about the Units [] ={} - Why is there nothing between the {} and why and/or when would you need to place text in there?
c)I am assuming the ; is a sort of stop text command and does this get placed at the end of every line of text? I see it used after each line but also after the last two } sybols, please explain if possible?
3)Required Addons (vanilla)-
a)How to figure out which are required from vanilla game as there are sometimes more than one config.bin file in a PBO or more than 1 PBO for, let's say weapons or wheeled vehicles, How to know which one to use to fing the addon name?
b)I have seen this line before- requiredAddons[] = {}; - That does not specify an addon but it works in the game. Does this just mean it covers all available addons, and when can it be used vs. having to specify specific addons?
4) Why did you use "" around the statement and what are the numbers in the end defining (maybe this is available in wiki where you find the class names and such)?begin1[] = {"tag\tag_mysounds\m16_single1.wss", 1.77828, 1, 1000};
5) I have found some mods where you may see this -something = "";- (something would be whatever text it is) what does the "" do in this situation (may be difficult to answer without knowing the mod)?
6) What does- /*extern*/ -mean and why would this line of text be used?/*extern*/ class Default;
7) I am guessing the // is for the program to not read the statement behind it while allowing the author to explain his intentions, am I correct?maxSpeed = 720; // max speed on level road, km/h
Once again, I thank you and I appologize for this being so long. However, I feel like a complete idiot when it comes to understanding how to write the text so that the program will understand.
-
- Commander-In-Chief
- Posts: 9833
- Joined: 2000-07-31 22:01:01
- Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
- Editing Interests: All, I (try) to edit everything.
- Location: PMC
Re: Basic Config Tutorial
Because its the start of the config, the first class.Mysteryman5150 wrote:a)Why no { before class CfgPatches?
Yes. Indentation. New class is always begun with new tab.b)why the empty space after the { between CfgPatches and the Class TAG_MySounds and then between My_Sounds and units []? Is this just for keeping the text clean looking?
Hmm actually never thought about it that way, not sure if MyArray [] = {}; would work, hmm. Good question.a)Why is there nothing between the [] and why and/or when would you need to place text in there?
I've always written them as MyArray[] = {};
Indentation.b)Same question about the Units [] ={} - Why is there nothing between the {} and why and/or when would you need to place text in there?
It tells the compiler where the config line ends. All lines end with ;, or rather all config values end with ;.c)I am assuming the ; is a sort of stop text command and does this get placed at the end of every line of text? I see it used after each line but also after the last two } sybols, please explain if possible?
For example
requiredAddons[] = { "This", "That" };
or
requiredAddons[] =
{
"This",
"That"
};
Would both end at the ;, but not necessarily "all LINES"

You need to define all required addons what your addon will use. How to determine that, well take the cfgPatches name of the addon where are you inheriting from or using models/textures/data etc.a)How to figure out which are required from vanilla game as there are sometimes more than one config.bin file in a PBO or more than 1 PBO for, let's say weapons or wheeled vehicles, How to know which one to use to fing the addon name?
Well, "its just how it works" basically.b)I have seen this line before- requiredAddons[] = {}; - That does not specify an addon but it works in the game. Does this just mean it covers all available addons, and when can it be used vs. having to specify specific addons?
Not sure about that, but its just how I write them, I know the values work without them but I always use them.4) Why did you use "" around the statement and what are the numbers in the end defining (maybe this is available in wiki where you find the class names and such)?
What the numbers are at the end, well sound volume things, not 100% sure exactly.
Hehe sort of, I mean I guess it just empties the value, not sure exactly.5) I have found some mods where you may see this -something = "";- (something would be whatever text it is) what does the "" do in this situation (may be difficult to answer without knowing the mod)?
I never use that comment, its from cpbo or perhaps from BIS original config comments etc.6) What does- /*extern*/ -mean and why would this line of text be used?
Its a comment.7) I am guessing the // is for the program to not read the statement behind it while allowing the author to explain his intentions, am I correct?
/*
This
is
a
comment.
*/
// and this is a comment.
Yep no problems. All I could say after the initial questions is that "don't worry too much", get the config/addon working ingame first, then try to tweak it etc. You don't have to understand every little thing the first day into config editing, copy paste from original BIS or other user configs and try to get your addon working in game first.Once again, I thank you and I appologize for this being so long. However, I feel like a complete idiot
IF YOU WANT TO KEEP USING PMC WEBSITES INCLUDING THIS FORUM, DOWNLOAD ADDONS, READ TUTORIALS, ETC, PLEASE HELP BY SUPPORTING PMC.
Support PMC
Please help to keep PMC websites online, if domains are let to expire then it will be "game over, man!".
-
- Newbie
- Posts: 5
- Joined: 2010-02-02 15:09:55
- Gaming Interests: ArmA 2 (Armed Assault 2)
- Editing Interests: All, I (try) to edit everything.
Re: Basic Config Tutorial

-
- Newbie
- Posts: 5
- Joined: 2010-02-02 15:09:55
- Gaming Interests: ArmA 2 (Armed Assault 2)
- Editing Interests: All, I (try) to edit everything.
Re: Basic Config Tutorial

One important lesson I learned is that when you unbinarize a config.bin file, using ArmaUnbin, the new config.cpp doesn't transfer over any of the necessary arrays [] = {

Anyway thanks again for all the help.
-
- Commander-In-Chief
- Posts: 9833
- Joined: 2000-07-31 22:01:01
- Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
- Editing Interests: All, I (try) to edit everything.
- Location: PMC
Re: Basic Config Tutorial
Could you try out unRap by Kegetys, that tool works great on config.bin files.
IF YOU WANT TO KEEP USING PMC WEBSITES INCLUDING THIS FORUM, DOWNLOAD ADDONS, READ TUTORIALS, ETC, PLEASE HELP BY SUPPORTING PMC.
Support PMC
Please help to keep PMC websites online, if domains are let to expire then it will be "game over, man!".
-
- Newbie
- Posts: 5
- Joined: 2010-02-02 15:09:55
- Gaming Interests: ArmA 2 (Armed Assault 2)
- Editing Interests: All, I (try) to edit everything.