Thursday, 13 February 2014

Config Viewer - What Is It and How to Use It

The config viewer is your one stop shop for everything to do with classnames. As we have talked about in previous tutorials, every item in the game has it's classname. This is the way the editor and the engine can call up a weapon or piece of clothing and store it's variables and properties.

The beauty of these classnames are that (for the most part) they are incredibly straight forward to read and work out what they pertain to. For example;

"arifle_Katiba_F"

We know that this is the Katiba Assault Rifle (The Opfor standard). The "_F" simply denotes that it is a base weapon with no attachments.

But how do we access the config viewer. Let's set up a basic sample tutorial to demonstrate it.

Firstly, open up the editor and place a single infantry unit of any faction. Once this is placed, hit PREVIEW to get into the game. Now hit the pause button to open up the editor's unique pause screen and options. As can be seen on the image below. There is a little container to the bottom-centre that contains buttons for different Editor options. The one we want is called config and is highlighted below:


Once the config button is pressed, and after a short delay, the config viewer should appear. At first this can seem a little intimidating. We won't be focusing too much on the right hand panel but it is helpful to understand what this is.

The left hand panel is known as the navigation pane. This is where we can see the tree structure for ArmA's configuration files. There are hundreds of files and folders here but for our purposes there are 3 main folders to focus on:

CfgWeapons
CfgVehicles

CfgMagazines

These folders contain everything we need to add majority of clothing, armors, weapons and ammunition. If you double click on one of these folders, lets use CfgWeapons for now, you'll see your screen go a little berserk as it brings up new data all over the place. In the navigation pane (left hand side) lots of new items will have appeared and they will all be slightly indented from the original folders and in bright white font. These are our classnames for all the weapons and attachments in the game. But just before we delve into that, let's talk about the other panels on our screens.


That large panel consuming majority of the screen is the preview or details pane. This mess of items and colours is the actually properties of the item. These aren't changeable but offer a brilliant amount of detail about the items such as health, muzzle velocity, even description data. This panel is what we will need to use to work out what type of ammo our weapon takes. As we'll discover a little later. It can be quite a dawning task at first.


Just below the details pane are two screen-length text boxes. The top most box is the Path Box. The path is the storage location of the item currently being viewed. this is very helpful as it allows us to easily copy the classname and paste it into anywhere required.
The box below is the Parents Box. This particular weapon, a suppressed Katiba with a sight and grenade launcher, is what is known as a Child. A child is a sub-type of a Parent. Parent's being the base weapon, in this case, a standard Katiba rifle.

Now to test this works we can copy the classname of one of the weapons and copy that into the Debug Console shown below. If everything works as it should then out soldier should now be outfitted with whatever weapon we chose from the config viewer. In this case, a suppressed Katiba with a sight and grenade launcher:









That is how to make use of the config editor to find and utilise classnames. But there is one more thing to know about using the config viewer; Ammunition.

Ammunition is not a simple task, unlike weapons and armour, ammo classnames are very specific, too specific in fact. If we open up the CfgMagazines folder, a new set of classnames can be seen... And they are far from basic.



 It can be very difficult to try and work out exactly what classname and object to use. This is where the details panel comes in very handy. On the image above it can be seen that one line in particular is highlighted. This line is known as the DescriptionShort. It provides a very breif description of exacftly what the object is. But for ammunition it also shows what weapons are used in it. With a little bit of common sense you can usually narrow down most assault rifles as having either 30 or 20 round mags. Then we can either just check each object or use a slightly different method.

Back on the Katiba's object page, you may not have noticed the description line in the centre (It's the longest line on the panel and in pink). This mentions that the Katiba uses a 6.5x39mm magazine. We can relate this with the 65x39 classnames. It takes a little work but eventually we can get the right ammo for the right guns. These methods work for pretty much any infantry weapon that is currently fire-able in the game.

Adding the magazines is fairly easy, but to test it works. Here it is again; Simply open up the Debug Console from the pause menu and type in the following command

player addMagazine "Classname"

Classname for Katiba series: "30Rnd_65x39_caseless_green"

And if it worked then our soldier should now be able to reload his weapon with the correct magazine like so:



And that's everything needed to understand and utilise the Config Viewer. Below is all the code used within this tutorial
//----------------------------------------------------------------------
Katiba Classname and Ammo
"arifle_katiba_F"
 "30Rnd_65x39_caseless_green"

 Adding Weapons and Ammo
player addWeapon "Classname"
player addMagazine "Classname"

Config Folder Names
CfgWeapons
CfgVehicles
CfgMagazines

//----------------------------------------------------------------------