# Get AI Suggested Build Loc

FlagsNative | Function

# Arguments

  • int — Player
  • point — Center
  • string<gamelink::Unit> — UnitType
  • int — BuildFlags

Returns — point

native point AIGetBuildingPlacement(
	int player,
	point center,
	string aliasUnitType,
	int buildFlags,
);

Category: AI Advanced / Construction / Functions

# Examples

mods/starcoop/starcoop.sc2modbase.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);