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

[General] "A unit enters a region"

Status
Not open for further replies.
Level 4
Joined
Jan 17, 2018
Messages
112
Hi all,

I got the title part to work, but I want to modify "A unit" to 2 units,3 units,4 units...you get the picture. I'm sure this is under "conditions", but I'm still a big noob and don't understand coding language so all that jargon of booleans, etc don't make sense to me.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Building off this, you can check for the number of units in the region (as a condition) if you don't want to set up your own variable to count.
No you cannot. You can only check the number of units in the rect that was used by the GUI event wrapper to fill the region. This region usually represents a different area of the map from the rect it was made.
(Number of units in (Units in Region)) Equal to (Integer)
This leaks a unit group. Additionally the entering unit might not be returned in that group for the reason mentioned above.

The only way is to use a counter to track the number of units that entered the region. Another trigger is needed to track the number of units leaving the region.
 
Status
Not open for further replies.
Top