# Get AI Suggested Build Loc
Flags —
Native
|Function
# Arguments
int
— Playerpoint
— Centerstring
<gamelink::Unit> — UnitTypeint
— BuildFlags
Returns — point
native point AIGetBuildingPlacement(
int player,
point center,
string aliasUnitType,
int buildFlags,
);
# Related
Category: AI Advanced / Construction / Functions
- Get Default Build Flags
- Player Has Resources —
bool
— AIHasRes - Tech Count —
int
— AITechCount - Known Unit Count —
int
— AIKnownUnitCount - Get AI Suggested Build Loc —
point
— AIGetBuildingPlacement
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:3196
for ( ; ( (autoB7BAE201_ai >= 0 && lv_iterUnitCreate <= autoB7BAE201_ae) || (autoB7BAE201_ai < 0 && lv_iterUnitCreate >= autoB7BAE201_ae) ) ; lv_iterUnitCreate += autoB7BAE201_ai ) {
if ((UnitTypeTestAttribute(lv_unitToCreate, c_unitAttributeStructure) == true)) {
lv_createPosition = AIGetBuildingPlacement(lp_player, UnitGroupCenterOfGroup(UnitGroup(null, lp_player, RegionEntireMap(), UnitFilter((1 << c_targetFilterStructure), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0)), lv_unitToCreate, -1);
if ((lv_createPosition == null)) {
lv_createPosition = UnitTypePlacementTestsFromPoint(lv_unitToCreate, lp_player, UnitGroupCenterOfGroup(UnitGroup(null, lp_player, RegionEntireMap(), UnitFilter((1 << c_targetFilterStructure), 0, (1 << c_targetFilterMissile), (1 << (c_targetFilterDead - 32)) | (1 << (c_targetFilterHidden - 32))), 0)), 0.0, c_placementTestCreepMask | c_placementTestPowerMask | c_placementTestFogMask | c_placementTestIgnoreBlockersMask | c_placementTestIgnoreInvisibleMask | c_placementTestZoneMask | c_placementTestCliffMask | c_placementTestDensityMask);