• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Unit Counter In Region

Status
Not open for further replies.
Level 7
Joined
Feb 6, 2008
Messages
133
How do i make a counter when a unit is in region?
this is what i want..
when 300 gray units or 300 specific unit-type is in region, player 1 is victory

and if possible .. i want a multiboard for the amount of units in the region like
Team 1 | Team 2
193.........227
 
Level 3
Joined
Sep 10, 2005
Messages
23
ans

You can use a trigger like that...

  • Counter
    • Events
      • Unit - A unit enters Rect X
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in Rect X owned by Player 9 (Gray))) Greater than or equal to 300
        • Then - Actions
          • Victory Player X
        • Else - Actions
 
Last edited by a moderator:
Level 15
Joined
Jan 16, 2008
Messages
1,244
do it with a counter variable and a 'pick every unit in region:
Events:
A unit enters (your region)
Conditions: not needed
Actions:
Pick every unit in (your region) and do actions:
if (your condition for unit filter) then set Counter to (counter + 1)
This counts all units in region matching a condition every time a unit enters that region. Is that what you needed?
 
Level 4
Joined
Dec 15, 2007
Messages
108
i had this problem too and i do it so

  • ud boss unbesiegbar
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set units[Owner of matching unit] = (Number of units in (Units in (Playable Map Area) <gen>(((Unit-type of (Matching unit)) Equal to < Your Unit>) and (((Matching unit) is alive) Equal to True))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • Units equal to 300
        • Then - Actions
          • Player - wins
        • Else - Actions
          • Do Nothing
      • Unit Groupe - Remove all units in Unit
variable has to be a array and the array has to be the number of the maximum of active player hope for help u

so better?
 
Last edited:
Status
Not open for further replies.
Top