• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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