Jump to content


[Tutorial] Adding New A New Unit to A General


No replies to this topic

#1 Chrizz

    E-Studios™ 2012

  • Gold Member
  • 2012 posts
  • Projects: C&C3: Tiberium Icestorm

Posted 19 September 2005 - 13:18

I figured someone might as well write a tutorial on adding units, since I had enough trouble figuring it out on my own. The first thing you're going to need is a .BIG file unpacker. There are lots to choose from, if you know where to look (I personally have been using Xentax). Once you have that, extract the .INI files to your generals directory. The one that we're going to look at to start with is FactionUnits.ini (This should be in your Generals\Data\INI\Object directory).

In case you don't know (And yes, you are a n00b if you don't), you can open a .INI file with Notepad or Wordpad or any other basic text editor. The first thing you'll see is a comment from the programmers regarding the nature of this file. Read it. Anything with a semi-colon (One of these -> ; ) before it is a comment. Comments are not run in-game as code, they're there for the sole purpose of do***annotation.

Okay, now, the first OBJECT you'll see, is AmericaParachute. I doubt you're really interested in editing this, so let's skip to something you can edit and see immediate results (assuming you haven't changed your start map file). Use your text editor's search function to find AmericaVehicleHumvee. Note the naming convention. All units in C&C Generals follow this. For instance, there's ChinaTankBattlemaster, GLAInfantryRebel, AmericaVehicleComanche, etc.

All objects have several attributes you can modify. Let's look at the one that will let you see immediate results (Hopefully you've found AmericaVehicleHummer by now); the MODEL attribute. You'll find this under the CONDITIONSTATE of NONE. In other words, this is what the Humvee will look like when nothing special has happened to it (like damage, or upgrades). Okay, change AVHUMMER in the model field to.. hmm.. CVPoliceCar. Assuming your file is in the correct place, you can now start up Generals and look at the opening scene in the main screen.
Ooh. Ah. You've changed the model of the Hummer. Feel special? Good.

Before we move on, a side note: A list of all models can be found in W3D.BIG. The naming convention is as follows (We'll refer to AVHUMMER):
A for America
V for Vehicle
HUMMER is the name of the object.
In other words, the first two letters are the faction and unit type, the last blog of text is the model's name.
Moving on!

Okay, so you think you're real special, eh? You've modified the model for the Humvee. Now you want more. Understandable, let's start a new unit. Vehicles are the simplest, in my opinion, to implement, so let's copy the good 'ol Humvee (everything from the header down to the part before the line that seperates it from the next object) and paste it at the bottom of the file so you can find it easy.

First things first, let's change the name. Call it whatever you want, I'll call mine AmericaVehicleCopCar (Not real original, but it's simple). You can change the portraits and such, if you want, but I'm just going to skip to my first main point: the weapon. Scroll down to the section titled ***DESIGN parameters *** and find WeaponSet. Note that there are actually two weaponsets, one for before you upgrade to TOW Missiles, and one for after the upgrade. For now, just edit the first one. Set WEAPON = PRIMARY HumveeGun to WEAPON = PRIMARY BuggyRocketWeapon
Next, let's change how it moves. Locomotors control every aspect of unit movement in Generals. Scroll down to *** ENGINEERING Parameters ***. Find where it says Locomotor = SET_NORMAL HumveeLocomotor. Okay, now change that to Locomotor = SET_NORMAL TechnicalLocomotor
What we currently have, assuming you've followed along, is a unit that looks like a cop car (if you didn't change the humvee back to it's default model), fires GLA Rocket Buggy missiles, and moves like a GLA Technical (Moves fast, catches some decent air on good-sized bumps).

I know what you're thinking: "Okay, so I've made a unit, now how do I get it in the game?" Just hold on a second and I'll tell you.
Go back to your .BIG extractor and pull out CommandButton.INI and CommandSet.INI. Open up CommandButton, for starters, because now we're going to make a new button to build your unit. Search for ConstructAmericaVehicleHumvee. This is obliviously the button that builds Humvees. It's exactly what you see in the USA's War Factory. Copy the whole thing and paste it right below the original.

First things first, change the name. I called mine ConstructAmericaVehicleCopCar. You can call yours whatever you want, but I strongly suggest following naming convention for easy searching later. The Command = field tells the game what it wants the button to do, in tis case, build a unit. Leave that alone. The Object = field tells it what it's building. Change this to the name of your unit (In my case, AmericaVehicleCopCar). The TextLabel is the name in the tooltip that pops up when you highlight it ("But wait, I don't have a tooltip yet..." Hold that thought). Change this to CONTROLBAR:ConstructAmericaVehicleCopCar or whatever your unit's name is tacked onto the end. We'll come back to tooltips later. For the button image, you can make it something different, or just leave it alone. The next entry, like the comment says, just tells the user what the button does. Don't bother messing with it unless you like confusing people. Finally, the DescriptLabel is the second half of the tooltip. Once again, modify it to fit the name of your unit. We'll come back to this too.

Fingers cramping yet? Mine are. Anyway... Next, open up CommandSet.INI, we need to tell the War Factory to use this button. First, refer to the comment at the top to understand the button layout, then search for AmericaWarFactoryCommandSet. This is the list of buttons that the US War Factory uses. Note that buttons 6-8 are not in use, and #9 is commented out (apparently a feature of the Multiplayer Test that was removed). You can use any of these button slots (even 9) to put in your button. I suggest you just copy the line of text for slot 5 and change it to reflect your button's name. That was easy, eh?

Okay, time to finish this unit off. Now you're going to need a .CSF editor. Many C&C sites have them available for download. .CSF files are what Generals uses to store it's tooltips and other text blogs. Once you have an editor, open up ENGLISH.BIG and extract generals.CSF. This should go in your Generals\Data\English directory. Open the file with your CSF editor. Find the CONTROLBAR section and look up a tooltip similar to yours. Copy the name, insert a new string, and change the name to reflect the appropriate tooltip entry. (NOTE: There ARE one or two tooltips on the unit itself, you may want to go back and change these too) Make them say whatever you want. You can tell them the button will give them a million dollars if they click it, if that's what you want. I suggest you use an existing tooltip as a template, though.

Okay, that done? Everything saved? You're now ready to test your unit. Load up Generals and skirmish against a computer as USA. Note the new button on your War Factory. Build your new whatever it is that you called it. Attack the enemy with it.
Woo, you've made your own unit. Now go make more! Or, change more of the details about your unit. No, I do not intend to go into more detail on this subject, so you're on your own now. Experiment! That's what modding is all about. Don't be afraid to change a value, even if you don't think it'll work. Most of all, have fun, but try to remember that sleep and food are required for survival.

By Shiv



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users