We all know the SetStockEx function has a buildFlags argument that gives the scripter a bit of control over the building placement of the AI.
There is a list of different options in the BuildAI.galaxy file which can be combined to produce specific results.
I would like to combine all our knowledge about these options so we can get a better understanding of what our technical possibilities and limitations are.
First of all most of the options can be split into three categories:
avoid/near
close/far
location
The avoid/near part is obvious, do you want the building placement to be NEAR the spot you specify or AVOID that spot.
The close/far part is not obvious. At least not to me. Close and far usually mean a relative distance. Relative to what is unclear...
As for the location options, let's take a look at them individually:
- PowerOrCreep: the meaning seems obvious, but how does it work exactly in relation with the close/far options. This option is helpful for new pylons to avoid Close- and FarPowerOrCreep to have them build outside of an existing power field, for more coverage.
- Factory: I assume this means any building capable of producing units. So you can either build more factories right next to them, or have your tech buildings avoid them, I guess. No idea about the close/far thing.
- Defense: I'm thinking defensive buildings, but not 100% sure.
- Dropoff: not a clue.
Now let's move on to the other options.
- Resource: available in the near/avoid variety. Used for building themain building near the resources, or building defensive structures near the workers to give some harassment protection.
- ChokePoint: also available in the near/avoid variety. This is a popular one. You can have the AI build buildings near the choke point/ramp with this one. However, since it's NEAR and not AT, you will never be able to get the AI to wall off his ramp with only this.
- ValueSpace: comes with the minor and major options. Not sure what it does, but I'm guessing it takes into account to amount of free space around the spot.
- CanLower: this is usually given to supply depots, to let the AI know this building won't block unit movement after being build.
- OnVespeneGas: obvious on. Only works on geyser buildings.
- OnlyHere: no idea, the AI doesn't seem to build the building at all if this flag is set.
- IgnoreDanger: no idea either. Does it normally take danger into account? How? What is the result? What is danger exactly?
If there is any information you have that could make this post more complete, please post it so we can have a reference for all AI developers out there.
PS Some months ago, I saw a YouTube video of an AI developer who managed to get his AI to build Pylons all around the edge of his base. Anyone know who that was, or how he did it? Was it just with the build flags or is there another way to control building placement?