# Build
Grammar — Build count|Number units of type unitType|Building in player player’s town town with priority priority using build flags flags|Build Flags
Flags —Native
|Action
Instructs the AI to build some buildings of the specified type.
# Arguments
int
— Playerint
— Priorityint
— Townstring
<gamelink::Unit> — Unit Typeint
— Countint
— Flags
Returns — void
native void AIBuild(
int player,
int priority,
int town,
string aliasUnitType,
int count,
int flags,
);
# Related
Category: AI Advanced / Construction / Actions
- Build —
void
— AIBuild - Train —
void
— AITrain - Research —
void
— AIResearch - Make Always —
void
— AIMakeAlways - Make Once —
void
— AIMakeOnce - Clear Build Queue —
void
— AIClearBuildQueue - Clear Train Queue —
void
— AIClearTrainQueue - Clear Research Queue —
void
— AIClearResearchQueue - Clear Stock —
void
— AIClearStock - Enable Stock —
void
— AIEnableStock - Set StockEx —
void
— AISetStockEx - Set Stock —
void
— AISetStock - Set StockOpt —
void
— AISetStockOpt - Set StockUnitNext —
void
— AISetStockUnitNext - Set StockTown —
bool
— AISetStockTown - Set StockExpand —
bool
— AISetStockExpand - Set StockAlias —
void
— AISetStockAlias - Set StockFree —
void
— AISetStockFree - Default Economy —
void
— AIDefaultEconomy - Default Expansion —
void
— AIDefaultExpansion
# Examples
mods/warcoop/warmeleeai.sc2mod — base.sc2data/TriggerLibs/Orc/Orc.galaxy:9
int count=qty-has;
if(count>0){
AIBuild(player,c_makePriorityTown,townid,unitid,count,c_nearChokePoint);
}
}