Basic Config Tutorial

ArmA 2 editing; configs, modeling, missions, textures, terrain etc.

Moderators: Lone Wolf, Snake Man

Post Reply
Mysteryman5150
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

Post by Mysteryman5150 » 2010-02-02 16:25:15

I am new to this forum as well as Arma 2 :D . 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.

Snake Man
Commander-In-Chief
Posts: 9338
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
Contact:

Re: Basic Config Tutorial

Post by Snake Man » 2010-02-02 20:30:48

Mysteryman5150 wrote:I am new to this forum as well as Arma 2
Welcome to PMC Tactical forum :)
What I am in search of is an "Idiots guide to Config scripting" particularly the config.cpp files.
Well that's easy, for complete beginners; config is config.cpp and scripting is the SQS or preferably SQF 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.
adjustments to top speeds of vehicles and adjust speeds on different terrains,
Well for vehicles there is config of:

Code: Select all

maxSpeed = 720;	// max speed on level road, km/h
and for different speeds for terrains, you need to specify those in the terrain config (not the vehicle's).
that would eplain what the symbols mean, i.e. ;{}[] and such, as well as how and where to use them.
Well classes are made with the {} and arrays are made with []. All config lines ends with ; character.
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.
You need to be bit more specific than that.
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."

Mysteryman5150
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

Post by Mysteryman5150 » 2010-02-02 21:42:37

@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):
class CfgPatches
{
class TAG_MySounds
{
units[] = {};
weapons[] = {};
requiredVersion = 1;
requiredAddons[] = { "CAWeapons" };
};
};
I guess all configs must start with this but here's a few questions.
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?
begin1[] = {"tag\tag_mysounds\m16_single1.wss", 1.77828, 1, 1000};
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)?
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)?
/*extern*/ class Default;
6) What does- /*extern*/ -mean and why would this line of text be used?
maxSpeed = 720; // max speed on level road, km/h
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?

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.

Snake Man
Commander-In-Chief
Posts: 9338
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
Contact:

Re: Basic Config Tutorial

Post by Snake Man » 2010-02-03 08:06:30

Mysteryman5150 wrote:a)Why no { before class CfgPatches?
Because its the start of the config, the first class.
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?
Yes. Indentation. New class is always begun with new tab.
a)Why is there nothing between the [] and why and/or when would you need to place text in there?
Hmm actually never thought about it that way, not sure if MyArray [] = {}; would work, hmm. Good question.

I've always written them as MyArray[] = {};
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?
Indentation.
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?
It tells the compiler where the config line ends. All lines end with ;, or rather all config values end with ;.

For example

requiredAddons[] = { "This", "That" };

or

requiredAddons[] =
{
"This",
"That"
};

Would both end at the ;, but not necessarily "all LINES" :)
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?
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.
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?
Well, "its just how it works" basically.
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)?
Not sure about that, but its just how I write them, I know the values work without them but I always use them.

What the numbers are at the end, well sound volume things, not 100% 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)?
Hehe sort of, I mean I guess it just empties the value, not sure exactly.
6) What does- /*extern*/ -mean and why would this line of text be used?
I never use that comment, its from cpbo or perhaps from BIS original config comments etc.
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?
Its a comment.

/*
This
is
a
comment.
*/

// and this is a comment.
Once again, I thank you and I appologize for this being so long. However, I feel like a complete idiot
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.
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."

Mysteryman5150
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

Post by Mysteryman5150 » 2010-02-03 23:06:23

@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 :D . 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.

Mysteryman5150
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

Post by Mysteryman5150 » 2010-02-13 06:46:54

@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 :D .

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.

Snake Man
Commander-In-Chief
Posts: 9338
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
Contact:

Re: Basic Config Tutorial

Post by Snake Man » 2010-02-13 08:32:51

What do you mean "doesn't transfer"?

Could you try out unRap by Kegetys, that tool works great on config.bin files.
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."

Mysteryman5150
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

Post by Mysteryman5150 » 2010-02-13 16:25:36

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests