• 🏆 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!

What happens if I add a unit in a unit group to the same unit group again?

Status
Not open for further replies.
Level 5
Joined
May 20, 2008
Messages
138
The question is pretty self-explanatory. If I add unit A to the unit group UNITGROUP, and later add unit A to the unit group UNITGROUP again, and then use "pick every unit in UNITGROUP and do actions", will unit A be picked twice (ie the game has saved it to UNITGROUP twice)? Or will the game see it as the same unit and not add unit A to UNITGROUP again if it already has been added previously?
 
It's true what maker said,however,adding unit more than once to same unit group could cause errors,careful with that.

That's not true. Using a trigger to periodically pause a unit won't cause errors. For each action Warcraft 3 takes, before the actual action, there is a boolean that will handle the is a unit x/is not a unit x statement.
So, before the PauseUnit() action, it will firstly check if that unit is already paused, before the GroupAddUnit() action, it will firstly check if that unit is in the unit group you are adding it, before the ShowUnit() action, it will check if that unit is already hidden and so on. If such comparisons didn't exist, then bugs would come up.
 
Status
Not open for further replies.
Top