...
February 25, 2008 - 23:54
Playing with Buttons

I have recently begun my crusade into modding generals after all these years that it's been out. Noticing that there aren't too many tutorials at this site, I've decided to write some basic ones up about stuff I have just learned how to do. This one is my second tutorial and I didn't really see anything addressing on the other sites I visited.

Tools Required: XCC Utilities, Notepad.

Step 1, Setting up Your ZH Directory (if you haven't done this already):
The first step in modding Zero Hour is setting up your directory so you can place your new files in it. You must locate your ZH directory, and it's location shall differ if you installed it through The First Decade or Zero Hour by itself. Most likely you cn find it through my computer -> program files -> EA Games -> (The first decade) -> Command and Conquer Zero Hour. Once you have found and entered the directory, I recomend you hit the "sort by file type" button. On the top of the lists should be folders. You should see a folder named "Data". If not, create it. Inside of this folder you should see a folder named "INI" (and if not, create it) and a folder named "English" (if not create it). *I highly recomend you make a shortcut to this folder on your desktop.* Once you enter the INI folder, you have completed the first step. However, you can go further and help out future use; if inside the INI folder you do not see the folder named "objects", then create it now. You can now minimize the folder and move on to step 2.

Step 2, Getting the Right Files:
Open up XCC mixer and navigate to your Zero Hour directory. Locate the file INIZH.big and double click on it. There are two files you need to extract now. "CommandSet.ini" and "CommandButton". Once you have extracted these to your desktop, you can move them to your zero hour directory under data/ini.  Go back to the ZH directory (if you have never done this before) and look through the list of files and you should see ENGLISHZH.big. Double click on it. Within this directory, locate the file named "generals.csf". Right click on it and extract it to your desktop. Now go to your desktop and move this file to the zero hour directory in the folders data/english.

Step 3, An Explanation of CommandButton:
There are alot of possibilities at hand which you can make by editing these two files.  The two files; CommandSet and CommandButton each have different attributes that make them very valuable.  They work hand in hand in controlling how the buttons and icons in the User Interface work.

CommandButton is the less comlicated of the two files and easier to explain how its works.  This file controls exactly what each button does.  In essence, this files contains the buttons.  Each entry in this file denotes a  specific button and the tags on help to define it.  Let's look at a typical entry shall we?

CommandButton Command_ConstructAmericaVehicleHumvee
 Command       = UNIT_BUILD
 Object        = AmericaVehicleHumvee
 TextLabel     = CONTROLBAR:ConstructAmericaVehicleHumvee
 ButtonImage   = SAHummer
 ButtonBorderType        = BUILD
 DescriptLabel           = CONTROLBAR:ToolTipUSABuildHumvee
End

The first line of code serves two purposes; the first half is to denote what kind of entry this is.  In this case it is a Command Button.  The second half is the specific name of the button.  The second line of text explains what this command does, obviously it builds a unit.  The third denotes exactly which vehcile it builds (the Humvee).  The fourth line of code is a reference to the generals .csf (the file that has the user interface text).  The exact name of line has a value which is listes in the file.  (This one is "Hum&vee".  The "&" symbol is not shown ingame, but however the next letter in the word becomes the "hotkey".  So if You press v, the command to build a humvee will be intreprited exactly the same as if you click the icon.)  The fifth line, ButtonImage, is the line in which the actual picture that is shown ingame is coded in.  The next line, buttonbordertype, tells the game what kind of button it is.  The second to last line, DiscriptLabel, is another reference to generals.csf.  This one contains the information that is shown when you hold the cursor of the icon.  It is usally a breif description of the unit.  The Final line, "End", tells that the entry is finished.

Everything that can modded in has been explained above.  You can create new entries, or edit old ones.  From this file, you can control what button builds what, and what image each button has.  You also are able to see the name of the .csf files.

Step 4, An explanation of CommandSte.ini
CommandSet.ini is in my opinion the more complicated of the two, because each entry has more in it, and also all the entries in CommandButtons.ini would be utterly useless without this file.  This file is responsible for organizing all the buttons on the user interface.  When ever you click on a unit, the icons arranged on the button are the result of this file.  They are known as the commandsets.

Each CommandSet can have a miximum of fourteen VISIBLE icons.  According one source (will cite when I find him again), any additional icons cannot be accessed by human players but can be utilized by the AI opponents.  Through manipulation, you can have more icons (remember GLA fake buildings?), but more on that later.  On the top of the file there is an explanation of which icons go where:

+--+--+--+--+--+--+--+    If you want your icons
|01|03|05|07|09|11|13|     in any specific order,
+--+--+--+--+--+--+--+    refer to this right here.
|02|04|06|08|10|12|14|
+--+--+--+--+--+--+--+

CommandSets are basically sets of buttons that make up a specific unit or building's interface.  Lets look at an example;

CommandSet AmericaDozerCommandSet
 1  = Command_ConstructAmericaPowerPlant
 2  = Command_ConstructAmericaStrategyCenter
 3  = Command_ConstructAmericaBarracks
 4  = Command_ConstructAmericaSupplyDropZone
 5  = Command_ConstructAmericaSupplyCenter
 6  = Command_ConstructAmericaParticleCannonUplink
 7  = Command_ConstructAmericaPatriotBattery
 8  = Command_ConstructAmericaCommandCenter
 9  = Command_ConstructAmericaFireBase
 11 = Command_ConstructAmericaWarFactory
 13 = Command_ConstructAmericaAirfield
 14 = Command_DisarmMinesAtPosition
End

The first Line explains what kind of entry this is; CommandSet, and the second half of it names the entry.  All of the tags for the command set are numbers which correspond to command buttons.  Notice that numbers 10 and 12 are missing.  This means there are two open squares that you can use to add another command button.  If you wanted the dozer to build say, a gla barrakcs, you would add "10 =  Command_ConstructGLABarracks ".  The end denotes that the entry is finished.

Using a combination of these two files, you can splice already existing armies by having certain things build a combination of the two.  *NOTE: the prerequisite for units and buildings is not determined by the presence of the commandbutton under the commandset, it is determined under the specific unit or buildings entry in another file.  So if you let the american command center build a humvee, it cannot do so until you have a war factory build and etc.*  I'm sure you're creative, no go think of something!

Step 5, The Sring Table editor:
I mentioned before a file named generals.csf.  You can open and edit this file by the XCC string table editor by open up XCC mixer, hitting launch/string table editor/open...generals.csf (you have to find it first).

If anything is unclear, by all means, leave a post....