• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Clueless about AI

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
How to design a AI build order for custom maps? And how to make it "rebuild"?

I'm making a strategy map like Greece and Lords of Europe, but am clueless about how to make a computer expand.

I'm not sure, but lets say it can only have 1 base. Then at intervals of 10 seconds it goes through a list of a building order and build the one with highest priority.

Priority:
1. Granary
2. Barraacks
3. Farm
4. Farm
5. Upgrade
6. ...

How do I make such a list and check if it has such a building?
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
I was more looking for making my own, but I don't want to create a massive page of if-statements...

if barrackCount < 1 then
buildbarrack...
elseif farmCount < 1 then
buildFarm
elseif farmCount < 2 then
buildFarm
endif
etc, bust be some way to arrange that in a struct or something and simply loop through it, or better yet not even loop through it, just find the index which based on events that are to be done.
 
Status
Not open for further replies.
Top