# Distance Between Points

Grammar — Distance between p1|Point and p2|Point
FlagsNative | Function

Returns the distance between two points as a real value.

# Arguments

  • point — Point 1
  • point — Point 2

Returns — fixed

native fixed DistanceBetweenPoints(point p1, point p2);

Category: Point / Measurements

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L1675
DistanceBetweenPoints(UnitGetPosition(lp_scienceVessel), lv_target)
// L1797
DistanceBetweenPoints(gv_terraTronPosition, lv_initialOffsetPoint)
// L2408
DistanceBetweenPoints(lp_positionOfViking, gv_presetSawTargets[lv_i][lv_k])
// L6852
DistanceBetweenPoints(lv_center, lv_posTurn)
// L6876
DistanceBetweenPoints(lv_posCurrent, lv_posTurn)
// L7034
DistanceBetweenPoints(Point(0.0, 0.0), Point(lv_x, lv_y))
// L2498
DistanceBetweenPoints(UnitGetPosition(lv_pickedUnit), gv_escortRouteRallyPoints[lv_customIntValueOfUnit])
// L4099
DistanceBetweenPoints(UnitGetPosition(auto6563E3CC_var), UnitGetPosition(gv_briefingZergling))
// L4110
DistanceBetweenPoints(UnitGetPosition(auto2D2D84D2_var), UnitGetPosition(gv_briefingZergling))
// L4148
DistanceBetweenPoints(UnitGetPosition(autoC6F8DF42_var), UnitGetPosition(UnitFromId(491)))
// L4160
DistanceBetweenPoints(UnitGetPosition(autoE9C294DC_var), UnitGetPosition(UnitFromId(491)))
// L378
DistanceBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L383
DistanceBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L389
DistanceBetweenPoints(gv_trainPath[lv_currentTarget], gv_trainPath[(lv_currentTarget - 1)])
// L576
DistanceBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L581
DistanceBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L587
DistanceBetweenPoints(gv_trainPath[lv_currentTarget], gv_trainPath[(lv_currentTarget - 1)])
// L3369
DistanceBetweenPoints(gv_trainPath[lv_currentPingPoint], gv_trainPath[lv_i])
// L3383
DistanceBetweenPoints(gv_trainPath[lv_currentPingPoint], gv_trainPath[lv_i])
// L3425
DistanceBetweenPoints(gv_trainPath[lv_currentPingPoint], gv_trainPath[lv_i])
// L3439
DistanceBetweenPoints(gv_trainPath[lv_currentPingPoint], gv_trainPath[lv_i])
// L3712
DistanceBetweenPoints(lp_sourceCenter, lv_sourceAfterScaled)
// L2161
DistanceBetweenPoints(PointFromId(862), PointFromId(863))
// L494
DistanceBetweenPoints(UnitGetPosition(auto96AA0583_var), PointFromId(13))
// L530
DistanceBetweenPoints(UnitGetPosition(auto7CD40DCB_var), PointFromId(13))
// L575
DistanceBetweenPoints(UnitGetPosition(lv_probe01), UnitGetPosition(lv_canisterHarvestTarget))
// L577
DistanceBetweenPoints(UnitGetPosition(lv_probe02), UnitGetPosition(lv_canisterHarvestTarget))
// L480
DistanceBetweenPoints(UnitGetPosition(gv_tosh), UnitGetPosition(lp_medic))
// L770
DistanceBetweenPoints(UnitGetPosition(autoA878FA45_var), PointFromId(1140))
// L398
DistanceBetweenPoints(UnitGetPosition(lp_unit), lp_home)
// L1004
DistanceBetweenPoints(CameraGetTarget(gv_pLAYER01_USER), EventUnitTargetPoint())
// L4757
DistanceBetweenPoints(OrderGetTargetPoint(EventUnitOrder()), RegionGetCenter(RegionFromId(59)))
// L5286
DistanceBetweenPoints(OrderGetTargetPoint(EventUnitOrder()), RegionGetCenter(RegionFromId(59)))
// L2309
DistanceBetweenPoints(lv_a, lv_b)
// L838
DistanceBetweenPoints(UnitGetPosition(lv_u), lv_homeLoc)
// L584
DistanceBetweenPoints(RegionGetCenter(lp_region), RegionGetCenter(RegionFromId(52)))
// L585
DistanceBetweenPoints(RegionGetCenter(lp_region), RegionGetCenter(RegionFromId(53)))
// L586
DistanceBetweenPoints(RegionGetCenter(lp_region), RegionGetCenter(RegionFromId(55)))
// L612
DistanceBetweenPoints(lp_point, RegionGetCenter(RegionFromId(16)))
// L613
DistanceBetweenPoints(lp_point, RegionGetCenter(RegionFromId(19)))
// L614
DistanceBetweenPoints(lp_point, RegionGetCenter(RegionFromId(20)))
// L6979
DistanceBetweenPoints(UnitGetPosition(gv_sCV01), PointWithOffset(PointFromId(536), 0.0, 0.0))
// L7083
DistanceBetweenPoints(UnitGetPosition(gv_sCV01), PointWithOffset(PointFromId(595), 0.0, 0.0))
// L7126
DistanceBetweenPoints(UnitGetPosition(gv_sCV01), PointWithOffset(PointFromId(697), 0.0, 0.0))
// L7169
DistanceBetweenPoints(UnitGetPosition(gv_sCV01), PointWithOffset(PointFromId(742), 0.0, 0.0))
// L596
DistanceBetweenPoints(lv_rallypoint, UnitGetPosition(lp_activatedunit))
// L6635
DistanceBetweenPoints(UnitGetPosition(autoCC422DC4_var), UnitGetPosition(gv_tHEONEOMEGALISK))
// L6635
DistanceBetweenPoints(UnitGetPosition(autoCC422DC4_var), PointFromId(373))
// L8319
DistanceBetweenPoints(lv_rallypoint, UnitGetPosition(auto8DBA43E6_var))
// L515
DistanceBetweenPoints(UnitGetPosition(lv_defender), UnitGetPosition(lp_spawner))
// L2713
DistanceBetweenPoints(UnitGetPosition(gv_leviathan), lv_leviathanHomePoint)
// L7479
DistanceBetweenPoints(UnitGetPosition(auto0685ADAD_var), Point(UnitGetCustomValue(auto0685ADAD_var, 1), UnitGetCustomValue(auto0685ADAD_var, 2)))
// L7479
DistanceBetweenPoints(UnitGetPosition(auto0685ADAD_var), Point(UnitGetCustomValue(auto0685ADAD_var, 3), UnitGetCustomValue(auto0685ADAD_var, 4)))
// L512
DistanceBetweenPoints(gv_multiKillLastNukePosition, gv_multiKillLastKillPosition)
// L509
DistanceBetweenPoints(gv_multiKillLastNukePosition, gv_multiKillLastKillPosition)
// L1675
DistanceBetweenPoints(UnitGetPosition(lp_scienceVessel), lv_target)
// L1797
DistanceBetweenPoints(gv_terraTronPosition, lv_initialOffsetPoint)
// L2408
DistanceBetweenPoints(lp_positionOfViking, gv_presetSawTargets[lv_i][lv_k])
// L6852
DistanceBetweenPoints(lv_center, lv_posTurn)
// L6876
DistanceBetweenPoints(lv_posCurrent, lv_posTurn)
// L7034
DistanceBetweenPoints(Point(0.0, 0.0), Point(lv_x, lv_y))
// L2498
DistanceBetweenPoints(UnitGetPosition(lv_pickedUnit), gv_escortRouteRallyPoints[lv_customIntValueOfUnit])
// L4099
DistanceBetweenPoints(UnitGetPosition(auto6563E3CC_var), UnitGetPosition(gv_briefingZergling))
// L4110
DistanceBetweenPoints(UnitGetPosition(auto2D2D84D2_var), UnitGetPosition(gv_briefingZergling))
// L4148
DistanceBetweenPoints(UnitGetPosition(autoC6F8DF42_var), UnitGetPosition(UnitFromId(491)))
// L4160
DistanceBetweenPoints(UnitGetPosition(autoE9C294DC_var), UnitGetPosition(UnitFromId(491)))
// L378
DistanceBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L383
DistanceBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L389
DistanceBetweenPoints(gv_trainPath[lv_currentTarget], gv_trainPath[(lv_currentTarget - 1)])
// L576
DistanceBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L581
DistanceBetweenPoints(lv_currentPoint, gv_trainPath[(lv_currentTarget - 1)])
// L587
DistanceBetweenPoints(gv_trainPath[lv_currentTarget], gv_trainPath[(lv_currentTarget - 1)])
// L3369
DistanceBetweenPoints(gv_trainPath[lv_currentPingPoint], gv_trainPath[lv_i])
// L3383
DistanceBetweenPoints(gv_trainPath[lv_currentPingPoint], gv_trainPath[lv_i])
// L3425
DistanceBetweenPoints(gv_trainPath[lv_currentPingPoint], gv_trainPath[lv_i])
// L3439
DistanceBetweenPoints(gv_trainPath[lv_currentPingPoint], gv_trainPath[lv_i])
// L3712
DistanceBetweenPoints(lp_sourceCenter, lv_sourceAfterScaled)
// L2161
DistanceBetweenPoints(PointFromId(862), PointFromId(863))
// L494
DistanceBetweenPoints(UnitGetPosition(auto96AA0583_var), PointFromId(13))
// L530
DistanceBetweenPoints(UnitGetPosition(auto7CD40DCB_var), PointFromId(13))
// L575
DistanceBetweenPoints(UnitGetPosition(lv_probe01), UnitGetPosition(lv_canisterHarvestTarget))
// L577
DistanceBetweenPoints(UnitGetPosition(lv_probe02), UnitGetPosition(lv_canisterHarvestTarget))
// L480
DistanceBetweenPoints(UnitGetPosition(gv_tosh), UnitGetPosition(lp_medic))
// L770
DistanceBetweenPoints(UnitGetPosition(autoA878FA45_var), PointFromId(1140))
// L398
DistanceBetweenPoints(UnitGetPosition(lp_unit), lp_home)
// L1004
DistanceBetweenPoints(CameraGetTarget(gv_pLAYER01_USER), EventUnitTargetPoint())
// L4757
DistanceBetweenPoints(OrderGetTargetPoint(EventUnitOrder()), RegionGetCenter(RegionFromId(59)))
// L5286
DistanceBetweenPoints(OrderGetTargetPoint(EventUnitOrder()), RegionGetCenter(RegionFromId(59)))
// L2309
DistanceBetweenPoints(lv_a, lv_b)
// L838
DistanceBetweenPoints(UnitGetPosition(lv_u), lv_homeLoc)
// L584
DistanceBetweenPoints(RegionGetCenter(lp_region), RegionGetCenter(RegionFromId(52)))
// L585
DistanceBetweenPoints(RegionGetCenter(lp_region), RegionGetCenter(RegionFromId(53)))
// L586
DistanceBetweenPoints(RegionGetCenter(lp_region), RegionGetCenter(RegionFromId(55)))
// L612
DistanceBetweenPoints(lp_point, RegionGetCenter(RegionFromId(16)))
// L613
DistanceBetweenPoints(lp_point, RegionGetCenter(RegionFromId(19)))
// L614
DistanceBetweenPoints(lp_point, RegionGetCenter(RegionFromId(20)))
// L6979
DistanceBetweenPoints(UnitGetPosition(gv_sCV01), PointWithOffset(PointFromId(536), 0.0, 0.0))
// L7083
DistanceBetweenPoints(UnitGetPosition(gv_sCV01), PointWithOffset(PointFromId(595), 0.0, 0.0))
// L7126
DistanceBetweenPoints(UnitGetPosition(gv_sCV01), PointWithOffset(PointFromId(697), 0.0, 0.0))
// L7169
DistanceBetweenPoints(UnitGetPosition(gv_sCV01), PointWithOffset(PointFromId(742), 0.0, 0.0))