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

warning if number of units enter region

Status
Not open for further replies.
Level 9
Joined
Jul 3, 2008
Messages
495
I would do it with 2 simpel triggers. Note that "i" is a variable, and its an integer.

  • Events
    • Unit - A unit enters Region 000 <gen>
  • Actions
    • Set i = (i + 1)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • i Equal to 20
      • Then - Actions
        • Game - Display to (All players) the text: Warning BLAH BLAH B...
      • Else - Actions
  • Events
    • Unit - A unit leaves Region 000 <gen>
  • Conditions
    • i Greater than 1
  • Actions
    • Set i = (i - 1)
 
Lol not too hard..

  • OverRun
    • Events
      • Unit - A unit enters (Region for wall)
    • Conditions
    • Actions
      • Set Overrun = 20
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Region for wall))) Greater Than Or Equal To Overrun
        • Then - Actions
          • Game - Display to (All players) the text: The walls are being...
        • Else - Actions
          • Do nothing
 
Level 9
Joined
Apr 3, 2008
Messages
700
MeKC is true,
And you need global integer variable if you wanna to make it for several players.

P.S. You also can check number of units matching condition in region when unit enters region instead of creating another global variable.
 
Level 6
Joined
May 3, 2006
Messages
81
You could simply just make the trigger:

Event: A unit enters *region*

Cond: If number of units in *region* greater than or equal to 20 (you can change it to find # of same units or any units)

Then do the rest of the actions, works without a variable and will repeat.
 
Status
Not open for further replies.
Top