March 09, 2009 - 03:07
How to Make an Unlockable Units With Generals Points

So you’ve made units before, and maybe you made some really cool units.  So cool, that you might be a little greedy and not want everyone to use it.  Perhaps someone has to “prove” themselves before they can use it, because you just don’t want any average Joe walking the streets to be able to sit down and get the unit right away, right?  Well, if you’re an elitist and you want only the leet to be able to build your unit, than making the unit unlockable via generals points is the perfect option.  This tutorial is your first glimpse into the generals points, and this is probably the most basic thing you can do with them.
This tutorial is for modders who accomplished the basics of generals modding (added a new unit, worked with command button.ini, and worked with commandset.ini).  If you have not done these things, I suggest you go ahead and read those tutorials first.

This tutorial works with the following .INIs:  The object .ini of your choice, command button.ini, commandset.ini and a new .ini; Science.ini.  This process is pretty similar to create a new unit, only with a few extra steps.  So first things first, go make your unit, and get the .inis out and ready to use.

Back already?  Ok, you did good.  Once your units is ingame and working fine, the first thing your going to want to do is make the science entry for purchasing with the general’s point.  Below is an example and is typical of what  you want to do.

Science SCIENCE_Pathfinder
 PrerequisiteSciences = SCIENCE_AMERICA SCIENCE_Rank3
 SciencePurchasePointCost = 1
 IsGrantable = Yes
 DisplayName = SCIENCE:USAPathFinder
 Description = CONTROLBAR:ToolTipUSASciencePathFinder

The first line names the entry, and the second is the list of prerequisites required for the science,  As you can see, You need the american generic science and the rank3 science (which tells the game you have reached that rank).  Sometimes you’ll be making something that requires something, sneak attack 3 for example, which requires sneak attack 2.  So once you make a new entry, you can move on.

Now you’ll want to make a button for your new science.  This one again is from the same example, the pathfinder.  It’s pretty self explanatory, just edit it so that it fits your new unit and science.

CommandButton Command_PurchaseSciencePathfinder
 Command           = PURCHASE_SCIENCE
 Science           = SCIENCE_Pathfinder
 Object            = AmericaInfantryPathfinder
 ButtonImage       = SAPathfinder1
 ButtonBorderType  = UPGRADE ; Identifier as to what kind of button this is

Next off, you’ll need it so that the player can click your button somewhere.  The command sets use a different setup than normal commandsets, so double check to make sure you have yours aligned up.  They have 3 rows and 5 columns, with buttons 1-15.

CommandSet SCIENCE_AMERICA_CommandSetRank3
 1 = Command_PurchaseSciencePathfinder
 4 = Command_PurchaseScienceParadrop1
 5 = Command_PurchaseScienceParadrop2
 6 = Command_PurchaseScienceParadrop3
 7 = Command_PurchaseScienceA10ThunderboltMissileStrike1
 8 = Command_PurchaseScienceA10ThunderboltMissileStrike2
 9 = Command_PurchaseScienceA10ThunderboltMissileStrike3
 10 = Command_PurchaseScienceEmergencyRepair1
 11 = Command_PurchaseScienceEmergencyRepair2
 12 = Command_PurchaseScienceEmergencyRepair3

The Unit
Finally, you’ll need to go back to your unit and change it’s prerequisite so that it reflex’s the new science it requires, as seen below.  This tutorial was simple enough, now go test your stuff ingame!

   Object = AmericaBarracks
   Science = SCIENCE_Pathfinder