» Current News
» Archive News
» View All Tips
5. Be sure to simplify your scripts. For example, if you want to execute a script every few seconds, you do not need an expiration timer or counter, set it to evaluate every few seconds and uncheck the "Deactivate upon success" checkbox.
» Contact Us
» Atomic Wiener Dog
» CNC Reneclips
» Project Perfect Mod
» The Finest Hour
» Warhammer40k: DoW SDI
» YR Argentina
Adding new upgrades
Title: Adding new upgrades
Difficulty: Novice AI Scripter
Author(s): SDI Team
Game Type: Both Regular Generals and Zero Hour
Getting the AI to use new upgrades is actually only one script action - yet the IF conditions for this
may be irritating for new scripters. That's what this tutorial is for..
We will assume that you will want to add the Hover Crusader upgrade - obviously only for this scenario.
First the usual procedure: Open World Builder, go to Edit > Player List, click the "Add Skirmish Players"
button then click "Ok". Then go to Edit > Scripts and click "Import Scripts". Now find your SkirmishScripts.scb
file which should be in your Command and Conquer Generals (Zero Hour?)\Data\Scripts\ directory.
For Regular Generals users
Open the "USA Upgrades" folder which is in the "SkirmishAmerica" player folder.
Now, just to understand the logic, double click the "USA TOW Upgrade" script,
then go to the "Script conditions" tab.
Now you'll see four script conditions - this is what they are doing:
1. "Counter 'USA Defcon' IS Greater Than Or Equal To 2" checks if the defcon counter is at least 2
The defcon counter is governed by death counters. it determines when and how much bonus cash it will
recieve and also which teams to build. It rotates from 1 to 5 and back again over and over depending on the battle.
2. "Counter 'USA Defcon' IS Not Equal To 5" makes sure that this doesn't go to "True" when this player's enemy has little
3. "*AND* Player has Greater Than Or Equal To unit or structure of type 'AmericaVehicleHumvee'" checks if this
player has humvees - otherwise it would be futile to purchase the upgrade.
4. "*AND* 1200 is Less Than Or Equal To number of credits possessed by Player " is pretty obvious I think,
1200 is the exact cost of the upgrade. This condition is there to ensure that the AI doesn't realize that it doesn't have enough
money to buy the upgrade - thus retrying to execute the script all the time.
Those are the script IF conditions. New upgrades should have similar conditions - this depends on balancing.
Now lets add our upgrade to the list.
Click "Ok" and while having the "USA TOW Upgrade" script selected click "Copy Script"
There will be a new script labelled "USA Tow Upgrade - C". Hit "Edit Script" (or double click it) and rename it to what your
upgrade is called, in our case it should be "USA Hover Crusader Upgrade".
Now we have to define the script conditions. For the Hover Crusader upgrade, edit the "*AND* Player has Greater Than Or Equal To unit or structure of type 'AmericaVehicleHumvee'"
script to check if we have 4 Crusaders. We then adjust the "*AND* 1200 is Less Than Or Equal To number of credits possessed by Player "
to equal the cost of our upgrade.
Finally, we go to the "Actions if true" tab and replace the "Upgrade_AmericaTOWMissile" with the Hover Crusader
Thats it. The AI will build the upgrade when the defcon is at least 2, AND when it is NOT 5, and when we have at least 4 Crusaders
Next you have to export the scripts, overwriting the "SkirmishScripts.scb" again. Done!
For Zero Hour users
This is almost the same in Zero Hour, only that the upgrade is called "USA Upgrade to TOW" and it doesn't have the defcon
condition to test it. It only checks whether it has enough credits and at least 2 humvees - thats it. So by copying that script
and editing it to your need it would certainly work. One of the easier things in ZH!
This tutorial may seem a bit of a joke to more experienced scripters, yet newbies who know nothing about scripts will find this
in combination with the "Adding new units" tutorials quite satisfying and therefore focus on the harder stuff.