# Find Placement From Point For Unit Type With Tests
Grammar — Find Placement From source Point For Unit Type unitType And Player player With Range range And Tests tests
Flags —Native
|Function
# Arguments
string
<gamelink::Unit> — Unit Typeint
— Playerpoint
— Sourcefixed
— Rangeint
<preset::PlacementTests> — Tests
Returns — point
native point UnitTypePlacementTestsFromPoint(
string inType,
int inPlayer,
point inSource,
fixed inRange,
int inTests,
);
# Related
Category: Unit / Placement
- Move Blockers From Point For Unit Type —
int
— UnitTypeMoveBlockersFromPoint - Move Blockers From Unit For Unit Type —
int
— UnitTypeMoveBlockersFromUnit - Find Placement From Point For Unit Type —
point
— UnitTypePlacementFromPoint - Find Placement From Unit For Unit Type —
point
— UnitTypePlacementFromUnit - Find Placement From Point For Unit Type With Tests —
point
— UnitTypePlacementTestsFromPoint - Find Placement From Unit For Unit Type With Tests —
point
— UnitTypePlacementTestsFromUnit
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:3198
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);
}
else {
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:14527
libNtve_gf_ShowHideUnit(lv_cargoUnit, false);
lv_landingPoint = UnitTypePlacementTestsFromPoint(UnitGetType(lv_cargoUnit), EventPlayer(), UnitGetPosition(lv_transportUnit), 3.0, c_placementTestCliffMask);
if (((lv_landingPoint == null) || (PlayerGroupHasPlayer(libCOOC_gf_CommanderPlayers(), EventPlayer()) != true))) {
UnitSetPropertyFixed(lv_cargoUnit, c_unitPropShields, 0.0);