1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

warning if number of units enter region

Discussion in 'World Editor Help Zone' started by Total_Warrior, Jan 22, 2009.

  1. Total_Warrior

    Total_Warrior

    Joined:
    Apr 8, 2007
    Messages:
    629
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Ok i need a trigger for my lord of the rings map:when 20 units are in a region it shows a warning ''The walls are being overrun!'' i can do the warning part but i dont know how to do the 20 units in the region part
     
    Last edited: Jan 22, 2009
  2. MeKC

    MeKC

    Joined:
    Jul 3, 2008
    Messages:
    487
    Resources:
    0
    Resources:
    0
    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)
     
  3. Chief-Oblivion

    Chief-Oblivion

    Joined:
    Mar 20, 2008
    Messages:
    458
    Resources:
    0
    Resources:
    0
    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
     
  4. Day-Elven

    Day-Elven

    Joined:
    Apr 3, 2008
    Messages:
    699
    Resources:
    0
    Resources:
    0
    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.
     
  5. Deathclaw24

    Deathclaw24

    Joined:
    May 3, 2006
    Messages:
    81
    Resources:
    2
    Icons:
    2
    Resources:
    2
    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.
     
  6. Day-Elven

    Day-Elven

    Joined:
    Apr 3, 2008
    Messages:
    699
    Resources:
    0
    Resources:
    0
    It's what I wrote in postscriptum of my previous message in this thread...
    But if you'll make this condition, it can cause message to appear with several seconds delay. So if you want it to be shown fast, MeKC's way is the best.