
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
I am new to this forum as well as Arma 2
. I have been playing about 1month. I have some modding experince from Fallout 3 but no scripting experience at all. What I am in search of is an "Idiots guide to Config scripting" particularly the config.cpp files. I have looked on community.bistudio and found alot of info but it is extremely scattered and not user freindly to newbie scripters. I am looking for help, being that I am new to scripting and trying to grasp writing config.cpp. I would like to make adjustments to top speeds of vehicles and adjust speeds on different terrains, and this will just be a start for me to get my feet wet. If I can pick it up pretty good I would consider moving on to other ideas and maybe eventually get into some mission modding. I was wondering if someone could point me in the direction of some literature that would eplain what the symbols mean, i.e. ;{}[] and such, as well as how and where to use them. 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. I am starting to make some sense of it now that I found the info on this site, as it is structured much better than the community.bistudio site is. Thank you again for any help.

-
- Commander-In-Chief
- Posts: 9784
- 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.
Important PMC Tactical Forum New User Registration please read new info here.
PMC since 1984
Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel
PMC Tactical forum Advanced Search is power.
"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."
PMC since 1984
Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel
PMC Tactical forum Advanced Search is power.
"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."
-
- 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
@Snake Man- Thank you for the welcome and the help. I looked over the sound mod tutorial and it was very helpful. I will use some of the info from there for examples (sorry if this turns out a bit long, I'm just trying to get some details):
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?
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)?
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.
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: 9784
- 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
Important PMC Tactical Forum New User Registration please read new info here.
PMC since 1984
Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel
PMC Tactical forum Advanced Search is power.
"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."
PMC since 1984
Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel
PMC Tactical forum Advanced Search is power.
"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."
-
- 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
@Snake man- Thank you very much. You have provided more descriptive info in 2 posts and your sound config tutorial than I was able to find in the in the last 2 weeks I have been researching this info on the many other sites
. As I said before community.bistudio is a great tool and full of information, however, it seems to be scattered about and not very newbie freindly for someone learning to build your own configs and scripts. Thanks again and I will definately refer people to this site (unless I get in trouble in the other forums for doing so) if I see questions you may be able to help them with.

-
- 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
@Snake Man- I just wanted to drop a line to thank you again. I have done some config modding and am starting to really get the hang of it now. I have played with some vehicle variables as well as some soldier and weapon class variables. I haven't created anything that I would consider a releasable mod but it is still fun to tinker around with it
.
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 [] = {
. That really frustrated me for a bit until I figured out why my mods where not working if I based it off the vanilla PBO. I only tell you this because it may be a helpful tip to put somewhere on your PMC editing wiki site.
Anyway thanks again for all the help.

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: 9784
- 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
What do you mean "doesn't transfer"?
Could you try out unRap by Kegetys, that tool works great on config.bin files.
Could you try out unRap by Kegetys, that tool works great on config.bin files.
Important PMC Tactical Forum New User Registration please read new info here.
PMC since 1984
Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel
PMC Tactical forum Advanced Search is power.
"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."
PMC since 1984
Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel
PMC Tactical forum Advanced Search is power.
"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."
-
- 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
It appears that if you use Armaunbin to turn a config.bin into a config.cpp, the armaunbin will drop the required [] symbols during the transfer. therefore if you try to do any editing you must then manually add every [] where required before you rePBO the file. I will definately try out the keytags version but I was just trying to share this info with any other newbies who come along and can't figure why thier PBO wouldn't work when repacked if they used Armaunbin to unbinarize the file.