• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Adding unit to Unit Groups

Status
Not open for further replies.
Level 4
Joined
Sep 11, 2018
Messages
74
Does this one
  • Set Temp_Group = (Units in (Playable map area))
equal to this one?
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • Unit Group - Add (Picked unit) to Temp_Group
If not, what's the difference? Been wondering for a while.
 
Level 13
Joined
May 10, 2009
Messages
868
In fact, it is possible to destroy the second one through custom script by placing set bj_wantDestroyGroup = true on top of the "Unit Group - Pick Every..." action.

The first one will just create a group, then add all units in playable map area to it, and the group is assigned to a variable. The second one will internally create a group, and enumerate all units afterwards - perform actions, like adding them to another group.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,204
First one uses a native to fill a group with all units the playable map area.

Second one does the same as the first one, then for each unit in that group adds them to another group. This is likely several hundred times slower than the first one due to not only repeating the first one's actions, but then using very slow JASS to process every unit on the map.
 
Status
Not open for further replies.
Top