• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger Help- All Units in Region:Move instantly to Center of Another Region

Status
Not open for further replies.
Level 27
Joined
Feb 22, 2006
Messages
3,052
Except you can't move a unit to a region, just a point in that region.
If you want the exact relative position, you could do:
  • Trigger
  • Events
  • ---Your Events here---
  • Conditions
  • ---Your Conditions here---
  • Actions
  • set ALP = center of region1
  • set ALP2 = center of region2
  • Set tempdist = distance between ALP and ALP2
  • set tempangle = Angle betweem ALP and ALP2
  • Custom Script: call RemoveLocation(udg_ALP)
  • Custom Script: call RemoveLocation(udg_ALP2)
  • Set ALG = All units in region1
    • Unit Group - Pick every unit in REGION1 and do Actions
      • If - Then Else
        • Conditions
          • Owner of (Picked unit) Equal to PLAYER
        • Then Actions
          • Set ALP = Position of picked unit
          • Set ALP2 = ALP offset by tempdist towards tempangle
          • Unit - Move (Picked unit) instantly to ALP2
          • Custom Script: call RemoveLocation(udg_ALP)
          • Custom Script: call RemoveLocation(udg_ALP2)
  • Custom Script: call DestroyGroup(udg_ALG)
If not you can just use move unit to random point in Region2.
--donut3.5--
 
Status
Not open for further replies.
Top