# Create Units Facing Point

Grammar — Create count|Number type|Unit for player player at pos facing facing|Point (flags)
FlagsAction

Creates units facing a specified point. Use the “Last Created Unit” and “Last Created Units” functions to refer to the created units.

# Arguments

  • int — Count
  • string [ gamelink::Unit ] — Type
  • int [ preset::Unit_Create_Style2 ] — Flags
  • int — Player
  • point — Point
  • point — Facing

Returns — unitgroup

unitgroup libNtve_gf_UnitCreateFacingPoint(
	int lp_count,
	string lp_type,
	int lp_flags,
	int lp_player,
	point lp_pos,
	point lp_facing,
);

Category: Unit / Basic

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L441
libNtve_gf_UnitCreateFacingPoint(lp_qty1, lp_type1, 0, gv_p2_ZERG_ORANGE_NW, RegionGetCenter(RegionFromId(11)), PointFromId(858))
// L443
libNtve_gf_UnitCreateFacingPoint(lp_qty2, lp_type2, 0, gv_p2_ZERG_ORANGE_NW, RegionGetCenter(RegionFromId(11)), PointFromId(858))
// L445
libNtve_gf_UnitCreateFacingPoint(lp_qty3, lp_type3, 0, gv_p2_ZERG_ORANGE_NW, RegionGetCenter(RegionFromId(11)), PointFromId(858))
// L6648
libNtve_gf_UnitCreateFacingPoint(1, "VikingFighter", 0, gv_pLAYER01_USER, RegionRandomPoint(RegionFromId(30)), RegionGetCenter(RegionFromId(23)))
// L6652
libNtve_gf_UnitCreateFacingPoint(1, "VikingFighter", 0, gv_pLAYER01_USER, RegionRandomPoint(RegionFromId(25)), RegionGetCenter(RegionFromId(23)))
// L6656
libNtve_gf_UnitCreateFacingPoint(1, "VikingFighter", 0, gv_pLAYER01_USER, RegionRandomPoint(RegionFromId(28)), RegionGetCenter(RegionFromId(23)))
// L6771
libNtve_gf_UnitCreateFacingPoint(1, "Phoenix", 0, gv_pLAYER02_PROTOSS, RegionRandomPoint(RegionFromId(23)), RegionGetCenter(RegionFromId(30)))
// L6776
libNtve_gf_UnitCreateFacingPoint(1, "VoidRay", 0, gv_pLAYER02_PROTOSS, RegionRandomPoint(RegionFromId(23)), RegionGetCenter(RegionFromId(30)))
// L604
libNtve_gf_UnitCreateFacingPoint(1, lv_defenderType, 0, gv_p07_ZERG_INFESTED, UnitGetPosition(lp_overlord), gv_infestationDefenderLocation[lp_colonyIndex][lp_defenderIndex])
// L4532
libNtve_gf_UnitCreateFacingPoint(1, "BroodLord", 0, gv_p07_ZERG_INFESTED, PointWithOffsetPolar(PointFromId(4173), lv_broodLordDistance, AngleBetweenPoints(PointFromId(644), PointFromId(4173))), UnitGetPosition(UnitFromId(97)))
// L4535
libNtve_gf_UnitCreateFacingPoint(1, "BroodLord", 0, gv_p07_ZERG_INFESTED, PointWithOffsetPolar(PointFromId(565), lv_broodLordDistance, AngleBetweenPoints(PointFromId(645), PointFromId(565))), UnitGetPosition(UnitFromId(96)))
// L5916
libNtve_gf_UnitCreateFacingPoint(1, "Marine", 0, gv_pLAYER_01_USER, PointWithOffsetPolar(UnitGetPosition(lv_crate), RandomFixed(2.0, 4.0), ((90.0 * IntToFixed(lv_i)) + 45.0)), UnitGetPosition(lv_crate))
// L5919
libNtve_gf_UnitCreateFacingPoint(1, "Diamondback", 0, gv_pLAYER_01_USER, PointWithOffsetPolar(UnitGetPosition(lv_crate), RandomFixed(5.0, 6.0), (UnitGetFacing(lv_crate) + 90.0)), UnitGetPosition(lv_crate))
// L5920
libNtve_gf_UnitCreateFacingPoint(1, "Diamondback", 0, gv_pLAYER_01_USER, PointWithOffsetPolar(UnitGetPosition(lv_crate), RandomFixed(5.0, 6.0), (UnitGetFacing(lv_crate) - 90.0)), UnitGetPosition(lv_crate))
// L1858
libNtve_gf_UnitCreateFacingPoint(1, "PortJunker", 0, gv_p06_JUNKERS, RegionRandomPoint(RegionFromId(28)), PointFromId(838))
// L2064
libNtve_gf_UnitCreateFacingPoint(1, "PortJunker", 0, gv_p06_JUNKERS, RegionRandomPoint(RegionFromId(29)), PointFromId(847))
// L2350
libNtve_gf_UnitCreateFacingPoint(1, "ScrapSalvage1x1", 0, gv_p05_SCRAP, UnitGetPosition(EventUnit()), UnitGetPosition(EventUnit()))
// L411
libNtve_gf_UnitCreateFacingPoint(1, "Medivac", 0, gv_p08_DOMINION, lp_spawnLoc, lp_dropLoc)
// L3843
libNtve_gf_UnitCreateFacingPoint(libNtve_gf_DifficultyValueInt(3, 3, 6, 8), "VikingFighter", 0, gv_p08_DOMINION, PointFromId(1561), PointFromId(1552))
// L3897
libNtve_gf_UnitCreateFacingPoint(libNtve_gf_DifficultyValueInt(2, 2, 4, 5), "VikingFighter", 0, gv_p08_DOMINION, PointFromId(1561), PointFromId(1552))
// L3987
libNtve_gf_UnitCreateFacingPoint(libNtve_gf_DifficultyValueInt(3, 3, 4, 2), "VikingFighter", 0, gv_p08_DOMINION, PointFromId(1565), PointFromId(1553))
// L3991
libNtve_gf_UnitCreateFacingPoint(libNtve_gf_DifficultyValueInt(0, 0, 4, 6), "Wraith", 0, gv_p08_DOMINION, PointFromId(1565), PointFromId(1553))
// L4043
libNtve_gf_UnitCreateFacingPoint(libNtve_gf_DifficultyValueInt(2, 2, 2, 2), "VikingFighter", 0, gv_p08_DOMINION, PointFromId(1565), PointFromId(1553))
// L4047
libNtve_gf_UnitCreateFacingPoint(libNtve_gf_DifficultyValueInt(0, 0, 1, 2), "Battlecruiser", 0, gv_p08_DOMINION, PointFromId(1565), PointFromId(1553))
// L5169
libNtve_gf_UnitCreateFacingPoint(1, "Hyperion", 0, gv_pLAYER07_HYPERION, PointFromId(270), PointFromId(1117))
// L2158
libNtve_gf_UnitCreateFacingPoint(1, "CommandCenterFlying", 0, 0, PointFromId(862), PointFromId(863))
// L5219
libNtve_gf_UnitCreateFacingPoint(11, "Zergling", 0, gv_p02_ZERG, PointFromId(793), RegionGetCenter(RegionFromId(64)))
// L5223
libNtve_gf_UnitCreateFacingPoint(2, "Zergling", 0, gv_p02_ZERG, PointFromId(793), RegionGetCenter(RegionFromId(64)))
// L5232
libNtve_gf_UnitCreateFacingPoint(4, "Zergling", 0, gv_p02_ZERG, PointFromId(793), RegionGetCenter(RegionFromId(64)))
// L5237
libNtve_gf_UnitCreateFacingPoint(3, "Zergling", 0, gv_p02_ZERG, PointFromId(793), RegionGetCenter(RegionFromId(64)))
// L5244
libNtve_gf_UnitCreateFacingPoint(3, "Zergling", 0, gv_p02_ZERG, PointFromId(793), RegionGetCenter(RegionFromId(64)))
// L426
libNtve_gf_UnitCreateFacingPoint(1, lp_unitType, 0, lp_player, lp_spawnLoc, lp_moveTarget)
// L2699
libNtve_gf_UnitCreateFacingPoint(1, "SpecialOpsDropship", 0, gv_pLAYER03_DROPSHIPS, PointFromId(398), PointFromId(397))
// L2707
libNtve_gf_UnitCreateFacingPoint(1, "SpecialOpsDropship", 0, gv_pLAYER03_DROPSHIPS, PointFromId(400), PointFromId(395))
// L2715
libNtve_gf_UnitCreateFacingPoint(1, "Raven", 0, gv_pLAYER01_USER, PointFromId(151), PointFromId(150))
// L2937
libNtve_gf_UnitCreateFacingPoint(1, "Raven", 0, gv_pLAYER01_USER, PointFromId(151), PointFromId(150))
// L3022
libNtve_gf_UnitCreateFacingPoint(1, "SpecialOpsDropship", 0, gv_pLAYER03_DROPSHIPS, PointFromId(398), PointFromId(397))
// L4739
libNtve_gf_UnitCreateFacingPoint(1, "ZerglingBurrowed", 0, gv_p2_ZERG, RegionRandomPoint(RegionFromId(47)), UnitGetPosition(gv_artifact))
// L4745
libNtve_gf_UnitCreateFacingPoint(1, "ZerglingBurrowed", 0, gv_p2_ZERG, RegionRandomPoint(RegionFromId(48)), UnitGetPosition(gv_artifact))
// L4752
libNtve_gf_UnitCreateFacingPoint(1, "ZerglingBurrowed", 0, gv_p2_ZERG, RegionRandomPoint(RegionFromId(49)), UnitGetPosition(gv_artifact))
// L4900
libNtve_gf_UnitCreateFacingPoint(1, "HydraliskBurrowed", 0, gv_p2_ZERG, PointFromId(1040), PointFromId(75))
// L4903
libNtve_gf_UnitCreateFacingPoint(1, "HydraliskBurrowed", 0, gv_p2_ZERG, PointFromId(1042), PointFromId(75))
// L4906
libNtve_gf_UnitCreateFacingPoint(1, "HydraliskBurrowed", 0, gv_p2_ZERG, PointFromId(1044), PointFromId(75))
// L4684
libNtve_gf_UnitCreateFacingPoint(1, "Battlecruiser", 0, gv_pLAYER_01_USER, PointFromId(139), UnitGetPosition(UnitFromId(137)))
// L4685
libNtve_gf_UnitCreateFacingPoint(1, "Battlecruiser", 0, gv_pLAYER_01_USER, PointFromId(179), UnitGetPosition(UnitFromId(137)))
// L4686
libNtve_gf_UnitCreateFacingPoint(1, "Battlecruiser", 0, gv_pLAYER_01_USER, PointFromId(183), UnitGetPosition(UnitFromId(137)))
// L6930
libNtve_gf_UnitCreateFacingPoint(1, "Medivac", 0, gv_p01_USER, RegionRandomPoint(gv_briefingSlaughterAreas[lv_i].lv_terranRegion), RegionGetCenter(gv_briefingSlaughterAreas[lv_i].lv_zergRegion))
// L6936
libNtve_gf_UnitCreateFacingPoint(1, "VikingFighter", 0, gv_p01_USER, RegionRandomPoint(gv_briefingSlaughterAreas[lv_i].lv_terranRegion), RegionGetCenter(gv_briefingSlaughterAreas[lv_i].lv_zergRegion))
// L5698
libNtve_gf_UnitCreateFacingPoint(1, "Feederling", 0, gv_p2_ZERG, UnitGetPosition(lv_unit), UnitGetPosition(lv_unit))
// L5703
libNtve_gf_UnitCreateFacingPoint(1, "Feederling", 0, gv_p2_ZERG, UnitGetPosition(lv_unit), UnitGetPosition(lv_unit))
// L5708
libNtve_gf_UnitCreateFacingPoint(1, "Feederling", 0, gv_p2_ZERG, UnitGetPosition(lv_unit), UnitGetPosition(lv_unit))
// L6907
libNtve_gf_UnitCreateFacingPoint(1, "Feederling", 0, gv_p2_ZERG, UnitGetPosition(lv_unit), UnitGetPosition(lv_unit))
// L6912
libNtve_gf_UnitCreateFacingPoint(1, "Feederling", 0, gv_p2_ZERG, UnitGetPosition(lv_unit), UnitGetPosition(lv_unit))
// L6917
libNtve_gf_UnitCreateFacingPoint(1, "Feederling", 0, gv_p2_ZERG, UnitGetPosition(lv_unit), UnitGetPosition(lv_unit))
// L7632
libNtve_gf_UnitCreateFacingPoint(1, "Feederling", 0, gv_p2_ZERG, UnitGetPosition(lv_unit), UnitGetPosition(lv_unit))
// L9489
libNtve_gf_UnitCreateFacingPoint(1, UnitGetType(autoDAE3AF3E_var), 0, gv_p1_USER, RegionRandomPoint(RegionFromId(129)), PointFromId(2182))
// L9874
libNtve_gf_UnitCreateFacingPoint(1, UnitGetType(auto10E9F90C_var), 0, gv_p1_USER, RegionRandomPoint(RegionFromId(131)), PointFromId(364))
// L10245
libNtve_gf_UnitCreateFacingPoint(1, UnitGetType(autoB237AF64_var), 0, gv_p1_USER, RegionRandomPoint(RegionFromId(132)), PointFromId(22))
// L6572
libNtve_gf_UnitCreateFacingPoint(1, "Mutalisk", 0, gv_pLAYER_P10_LEVIATHAN, PointFromId(1327), RegionGetCenter(RegionFromId(14)))
// L6574
libNtve_gf_UnitCreateFacingPoint(1, "Mutalisk", 0, gv_pLAYER_P10_LEVIATHAN, PointFromId(1328), RegionGetCenter(RegionFromId(14)))
// L6576
libNtve_gf_UnitCreateFacingPoint(1, "Mutalisk", 0, gv_pLAYER_P10_LEVIATHAN, PointFromId(1329), RegionGetCenter(RegionFromId(14)))
// L6578
libNtve_gf_UnitCreateFacingPoint(1, "Mutalisk", 0, gv_pLAYER_P10_LEVIATHAN, PointFromId(1330), RegionGetCenter(RegionFromId(14)))
// L6580
libNtve_gf_UnitCreateFacingPoint(1, "Mutalisk", 0, gv_pLAYER_P10_LEVIATHAN, PointFromId(1331), RegionGetCenter(RegionFromId(14)))
// L6582
libNtve_gf_UnitCreateFacingPoint(1, "Mutalisk", 0, gv_pLAYER_P10_LEVIATHAN, PointFromId(1332), RegionGetCenter(RegionFromId(14)))
// L6584
libNtve_gf_UnitCreateFacingPoint(1, "Corruptor", 0, gv_pLAYER_P10_LEVIATHAN, PointFromId(1333), RegionGetCenter(RegionFromId(14)))
// L6586
libNtve_gf_UnitCreateFacingPoint(1, "Corruptor", 0, gv_pLAYER_P10_LEVIATHAN, PointFromId(1336), RegionGetCenter(RegionFromId(14)))
// L6588
libNtve_gf_UnitCreateFacingPoint(1, "BroodLord", 0, gv_pLAYER_P10_LEVIATHAN, PointFromId(1334), RegionGetCenter(RegionFromId(14)))
// L6590
libNtve_gf_UnitCreateFacingPoint(1, "BroodLord", 0, gv_pLAYER_P10_LEVIATHAN, PointFromId(1335), RegionGetCenter(RegionFromId(14)))
// L455
libNtve_gf_UnitCreateFacingPoint(1, lp_unitType, 0, gv_nextWavePlayer, RegionRandomPoint(lp_location), PlayerStartLocation(gv_pLAYER_USER))
// L533
libNtve_gf_UnitCreateFacingPoint(lp_qty, lp_type, 0, gv_pLAYER_ZERG_MAIN, libNtve_gf_PointOffsetTowardsPoint(UnitGetPosition(lp_nydus), 1.0, UnitGetPosition(gv_artifact)), UnitGetPosition(gv_artifact))
// L2513
libNtve_gf_UnitCreateFacingPoint(libNtve_gf_DifficultyValueInt(4, 3, 4, 5), "Zergling", 0, gv_pLAYER_ZERG_SPECIAL, RegionRandomPoint(RegionFromId(11)), PlayerStartLocation(gv_pLAYER_USER))
// L2515
libNtve_gf_UnitCreateFacingPoint(libNtve_gf_DifficultyValueInt(0, 1, 1, 1), "Hydralisk", 0, gv_pLAYER_ZERG_SPECIAL, RegionRandomPoint(RegionFromId(11)), PlayerStartLocation(gv_pLAYER_USER))
// L3969
libNtve_gf_UnitCreateFacingPoint(1, gv_zergDefenders[lv_unitIndex].lv_unitType, 0, gv_pLAYER_ZERG_SPECIAL, RegionRandomPoint(gv_zergDefenders[lv_unitIndex].lv_spawnRegion), PlayerStartLocation(gv_pLAYER_USER))
// L4219
libNtve_gf_UnitCreateFacingPoint(1, "Overlord", 0, gv_pLAYER_ZERG_SPECIAL, RegionRandomPoint(RegionFromId(5)), PlayerStartLocation(gv_pLAYER_USER))
// L4222
libNtve_gf_UnitCreateFacingPoint(1, "Overlord", 0, gv_pLAYER_ZERG_SPECIAL, RegionRandomPoint(RegionFromId(6)), PlayerStartLocation(gv_pLAYER_USER))
// L4225
libNtve_gf_UnitCreateFacingPoint(1, "Overlord", 0, gv_pLAYER_ZERG_SPECIAL, RegionRandomPoint(RegionFromId(7)), PlayerStartLocation(gv_pLAYER_USER))
// L4228
libNtve_gf_UnitCreateFacingPoint(1, "Overlord", 0, gv_pLAYER_ZERG_SPECIAL, RegionRandomPoint(RegionFromId(8)), PlayerStartLocation(gv_pLAYER_USER))
// L4231
libNtve_gf_UnitCreateFacingPoint(1, "Overlord", 0, gv_pLAYER_ZERG_SPECIAL, RegionRandomPoint(RegionFromId(9)), PlayerStartLocation(gv_pLAYER_USER))
// L2630
libNtve_gf_UnitCreateFacingPoint(1, "Scourge", 0, gv_p3_ZERG, PointWithOffsetPolar(UnitGetPosition(gv_tHEONEZERATUL), RandomFixed(15.0, 25.0), lv_real), UnitGetPosition(gv_tHEONEZERATUL))
// L2638
libNtve_gf_UnitCreateFacingPoint(1, "Scourge", 0, gv_p3_ZERG, PointWithOffsetPolar(UnitGetPosition(gv_tHEONEZERATUL), RandomFixed(15.0, 25.0), lv_real), UnitGetPosition(gv_tHEONEZERATUL))
// L2647
libNtve_gf_UnitCreateFacingPoint(1, "Scourge", 0, gv_p3_ZERG, PointWithOffsetPolar(UnitGetPosition(gv_tHEONEZERATUL), RandomFixed(15.0, 25.0), lv_real), UnitGetPosition(gv_tHEONEZERATUL))
// L2655
libNtve_gf_UnitCreateFacingPoint(1, "Scourge", 0, gv_p3_ZERG, PointWithOffsetPolar(UnitGetPosition(gv_tHEONEZERATUL), RandomFixed(15.0, 25.0), lv_real), UnitGetPosition(gv_tHEONEZERATUL))
// L2664
libNtve_gf_UnitCreateFacingPoint(1, "Scourge", 0, gv_p3_ZERG, PointWithOffsetPolar(UnitGetPosition(gv_tHEONEZERATUL), RandomFixed(15.0, 25.0), lv_real), UnitGetPosition(gv_tHEONEZERATUL))
// L2672
libNtve_gf_UnitCreateFacingPoint(1, "Scourge", 0, gv_p3_ZERG, PointWithOffsetPolar(UnitGetPosition(gv_tHEONEZERATUL), RandomFixed(15.0, 25.0), lv_real), UnitGetPosition(gv_tHEONEZERATUL))
// L2679
libNtve_gf_UnitCreateFacingPoint(1, "Overseer", 0, gv_p3_ZERG, PointFromId(597), UnitGetPosition(gv_tHEONEZERATUL))
// L2687
libNtve_gf_UnitCreateFacingPoint(1, "Mutalisk", 0, gv_p3_ZERG, PointWithOffsetPolar(UnitGetPosition(gv_tHEONEZERATUL), RandomFixed(15.0, 25.0), lv_real), UnitGetPosition(gv_tHEONEZERATUL))
// L2695
libNtve_gf_UnitCreateFacingPoint(1, "Mutalisk", 0, gv_p3_ZERG, PointWithOffsetPolar(UnitGetPosition(gv_tHEONEZERATUL), RandomFixed(15.0, 25.0), lv_real), UnitGetPosition(gv_tHEONEZERATUL))
// L2704
libNtve_gf_UnitCreateFacingPoint(1, "Scourge", 0, gv_p3_ZERG, PointWithOffsetPolar(UnitGetPosition(gv_tHEONEZERATUL), RandomFixed(15.0, 25.0), lv_real), UnitGetPosition(gv_tHEONEZERATUL))
// L4420
libNtve_gf_UnitCreateFacingPoint(1, "Zergling", 0, gv_p05_ZERG_LOW_GROUND_NOAI, RegionRandomPoint(RegionFromId(45)), PointFromId(230))
// L4423
libNtve_gf_UnitCreateFacingPoint(1, "Baneling", 0, gv_p05_ZERG_LOW_GROUND_NOAI, RegionRandomPoint(RegionFromId(45)), PointFromId(230))
// L4425
libNtve_gf_UnitCreateFacingPoint(1, "Roach", 0, gv_p05_ZERG_LOW_GROUND_NOAI, RegionRandomPoint(RegionFromId(45)), PointFromId(230))
// L4426
libNtve_gf_UnitCreateFacingPoint(8, "Zergling", 0, gv_p05_ZERG_LOW_GROUND_NOAI, PointFromId(682), RegionRandomPoint(RegionFromId(45)))
// L4427
libNtve_gf_UnitCreateFacingPoint(8, "Zergling", 0, gv_p05_ZERG_LOW_GROUND_NOAI, PointFromId(684), RegionRandomPoint(RegionFromId(45)))
// L5190
libNtve_gf_UnitCreateFacingPoint(1, "Tassadar", 0, gv_p10_ABANDONED_STRUCTURES, PointFromId(164), PointFromId(400))
// L5437
libNtve_gf_UnitCreateFacingPoint(1, "Overlord", 0, gv_p05_ZERG_LOW_GROUND_NOAI, RegionRandomPoint(RegionFromId(34)), PointFromId(627))
// L5443
libNtve_gf_UnitCreateFacingPoint(1, "Mutalisk", 0, gv_p05_ZERG_LOW_GROUND_NOAI, RegionRandomPoint(RegionFromId(34)), PointFromId(627))
// L5449
libNtve_gf_UnitCreateFacingPoint(1, "Scourge", 0, gv_p05_ZERG_LOW_GROUND_NOAI, RegionRandomPoint(RegionFromId(34)), PointFromId(627))
// L5455
libNtve_gf_UnitCreateFacingPoint(1, "Overseer", 0, gv_p05_ZERG_LOW_GROUND_NOAI, RegionRandomPoint(RegionFromId(34)), PointFromId(627))
// L5563
libNtve_gf_UnitCreateFacingPoint(1, "Zealot", 0, gv_p01_PLAYER, PointWithOffsetPolar(PointFromId(156), ((IntToFixed(lv_i) * 2.0) - 10.0), (PointGetFacing(PointFromId(156)) - 90.0)), PointFromId(370))
// L5567
libNtve_gf_UnitCreateFacingPoint(1, "Zealot", 0, gv_p01_PLAYER, PointWithOffsetPolar(PointWithOffsetPolar(PointFromId(156), 2.0, PointGetFacing(PointFromId(370))), ((IntToFixed(lv_i) * 2.0) - 10.0), (PointGetFacing(PointFromId(156)) - 90.0)), PointFromId(370))