(**) Editing the AI (ZH)
June 01, 2007 - 09:53
This tutorial will teach you how to edit the AI in Generals Zero Hour. I especially say Zero Hour, because Generals uses a different way of AI scripting.

Some generals information:
Generals (and Zero Hour) AI attack in waves. These are noted from 1 to 5. Wave 1 attacks are earlier in the game then wave 5 attacks. Wave 5 attacks always have much more and stronger units in them the wave 1 attacks. Easy AI only goes until wave 3. Medium goes to wave 4. Hard goes to wave 5.
Most teams use 3 paths that are in (almost) each map. These are CenterPath, FlankPath and BackdoorPath. Center is the most direct way from his base to his enemy's base. Flank is mostly from the side, and Backdoor is mostly from the other side, or from behind. If you play a map without these 3 paths, they always go directly to the enemy's base.

What do you need:
-FinalBig or XCC Mixer: these are to extract the files you need.
-Generals Zero Hour WorldBuilder (standard with each game): this is used for editing the AI.
-SkirmishScripts.SCB: this is the magic file you are going to edit.

Got everything? Ok, let's start Razz
First you need to find the SkirmishScripts in your Zero Hour directory. If it is correct, you will find it in YourZHDirectory/Data/Script.
NOTE: Always make a backup of your original SkirmishScripts!

Now you have found it, start up WorldBuilder. After it is loaded, go to Edit-->Edit Player List. After this is opened, make sure there aren't any players in the list. Then you click on the button "Add Skirmish Players". Now the list is filled with all armies from the game. Click OK so you close the window.

Go to Edit-->Scripts. Now you will see a window with some buttons and folders with all armies in Generals Zero Hour. Before we are going to import the SkirmishScripts, de-select the "Auto Verify" option. This make importing and exporting scripts a lot faster.

Click on the "Import" button to import your script file. Search for your SkirmishScripts, and import it. This may take a while. If you have done it correct, you now can expand each folder into many sub-folders. It may look very confusing and overwhelming, but it isn't that difficult when you understand it. And above all, we not are going to edit those in this tutorial.

Click OK to close the window. Now go to Edit-->Edit Teams. Now a new window will open. In the left collum you have all armies. In the right column you have nothing (yet). This is the window where you can edit all the teams the AI builds (attack teams, dozers, supply units, etc.).

Click in the left column on the army you want to edit. Now the right column will be filled with all the teams this army can (and will) build. The teams the AI uses to attack you are like this:

AAA B CCC Wave DDD E

I will explain this code:
AAA = the army name (IE, America is USA, GLA is GLA, China is China)
B = the AI level that uses this attack (E is easy, M is medium, H is hard)
CCC = the number of the wave (as explained above)
DDD = the type of attack (mostly it says tanks or artillery)
E = the path the team takes to your base (C is center, F is flank, B is backdoor)

NOTE: you don't have to stick to this code, but it is useful so you can see which team is in which wave and uses which path.

Double-click on the team you want to edit, and a new window will pop up. You will see a lot of things you can edit. For the this tutorial, we only will edit middle part of this window, which is also the most important.

You can see a few columns which are called "Min", "Max" and "Unit Type". Min is minimal, and it says the minimal amount of units to be build of this type in this team. Max is the same as min, only it is the maximum amount of units. Unit Type is where you can select the type of unit to be build.

For each unit you must set it's Min, Max and Unit Type. As you can see, you can have a max of 7 units in 1 team. This is well enough, because else the teams would get to large. Edit the teams you want, and to close the Teams window, click OK, or all your work will be lost.

Go to Edit-->Scripts again. It may take a while to load this, so be patient. Once it is loaded, click on the "Export Script(s)" button.
A new window will pop up.
NOTE: Select the "Export all scripts" option, or only the selected scripts will be exported!
You may notice that the OK button is missing. This is EA's fault, but if you look good, you can see the top of the button on the bottom of the window. Click on it to export your scripts.

Now select your original SkirmishScripts, and click Save or OK. Now close WorldBuilder, start up Generals Zero Hour, select a skirmish map and the AI level you changed teams from, and test it Smile

This was it all. Editing the AI in Generals Zero Hour is a bit more complicated the in RA2/TS, but when you know how to script a bit, you can do a lot of nice things.

I will create a tutorial about editing the base-building AI soon... Wink