Ever wanted to change the units of a race? Maybe you’ve tried is but found out that the computer does not know how to handle the new units. In this tutorial i will show you how to fix that problem with a custom AI.
Setup
First lets make sure that there are 2 players in this map.
- Go to Scenario > Scenario Properties
- Set Player 1 to User and Player 2 to Computer
- Then go to the Forces tab and check Fixed Player Settings
Creating the Custom AI
Now we have to create the ai.
- Open the AI Editor
- Give the AI a name
- Set Race to Custom
Heroes
We also need to assign 3 Heroes for the AI
- Go to the Heroes Tab
- Select 3 hero’s
- Make sure that the AI’s tech tree can build these 3 heroes.
Buildings and Units
We now are going to tell the AI what Buildings and Units they should have.
- Go to the Building Tab
- Select a Base Building. This building will for example be a Town Hall.
- Now select a Gold and Lumber Worker. Make sure these workers can gather the selected resource.
- Now for the Build Priority. We start with the Units you should start with. So add the Base Building and some Workers.
- Now lets make sure that the AI is going to train some more workers in that start. Add 2 more workers to the list below the other 5.
- By now you will need more food. Add a building that provides food to the que.
- Now lets train some more workers.
- Now add all the units and buildings you want them to build. Make sure it is the right order. For example don’t place the Workshop before the Keep.
Attack Groups
Now we are going to create attack waves. These waves happen when the all units in the attack group are accounted for.
- Delete all other groups
- Now add your own group
- Place units inside that your AI is able to train. Remember that the AI will only attack when all these units are accounted for.
Saving the AI
Now that the AI is finished you can save the AI.
- Save the AI.
- Go to the Import Editor and Import your AI.
- Open the Trigger Editor.
- Remove the Default UI script
- Now add the Action > AI > Start Melee AI Script and set it to your custom AI
- Now place the Base building and 5 workers near a gold mine.
- Test the map
Testing.
Now lets see if the AI is doing what it is supposed to do.
- Enter the Cheat: iseedeadpeople.
- Now the whole map is visible.
- Check on the progress of the AI.
I hope this tutorial helped you out to create your own Custom AI. Experiment with it a bit and create a powerful foe or ally.