• 🏆 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] Move all units within a region

Status
Not open for further replies.
Level 4
Joined
Nov 17, 2015
Messages
91
Hello, this is a trigger for entering a dungeon, you drop an item on the platform, and it will transport all units on the platform to the dungeon. There is one problem though,

How do i transport all the units within region 157?

  • Pass
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Item being manipulated) is in Region 157 <gen>) Equal to True
    • Actions
      • Item - Remove (Item being manipulated)
      • Unit - Move (Triggering unit) instantly to (Center of (Playable map area))
Thank you for your time and effort in advance! :goblin_good_job:
 
Level 12
Joined
May 22, 2015
Messages
1,051
  • Unit Group - Pick every unit in Region 157 <gen> and do (multiple actions)
    • Actions
      • Unit - Move (Picked unit) instantly to (Center of (Playable map area))
Note that this leaks a single group, and a point for every unit that will be moved.
 
Level 12
Joined
Jan 2, 2016
Messages
973
Note that this leaks a single group, and a point for every unit that will be moved.

the leak can be avoided if you add a:
"set bj_wantDestroyGroup = true"
before that :p
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in Region 157 <gen> and do (multiple actions)
    • Actions
      • Unit - Move (Picked unit) instantly to (Center of (Playable map area))
 
Level 12
Joined
May 22, 2015
Messages
1,051
the leak can be avoided if you add a:
"set bj_wantDestroyGroup = true"
before that :p
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in Region 157 <gen> and do (multiple actions)
    • Actions
      • Unit - Move (Picked unit) instantly to (Center of (Playable map area))

You'd also need to destroy the points:
  • set tempPoint = Center of (Playable map area)
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in Region 157 <gen> and do (multiple actions)
    • Actions
      • Unit - Move (Picked unit) instantly to (tempPoint)
  • Custom script: call RemoveLocation(udg_tempPoint)
 
Level 4
Joined
Nov 17, 2015
Messages
91
Thanks!

the leak can be avoided if you add a:
"set bj_wantDestroyGroup = true"
before that :p
  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick every unit in Region 157 <gen> and do (multiple actions)
    • Actions
      • Unit - Move (Picked unit) instantly to (Center of (Playable map area))

Thanks whabam and were elf for the solution! :goblin_good_job:
 
Status
Not open for further replies.
Top