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 Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    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.

[Trigger] Limited Spawn

Discussion in 'Triggers & Scripts' started by nedio95, Apr 5, 2011.

  1. nedio95

    nedio95

    Joined:
    Mar 24, 2011
    Messages:
    1,055
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I want to create a trigger which respawns dead units
    I got the respawn part, but i cant make the it stop:vw_death:.
    I want it to stop when there are 3 units.
    Pls help.
    Thats the revive trigger
    • Germ maker2
      • Events
        • Unit - A unit owned by Neutral Hostile Dies
      • Conditions
        • (Triggering unit) Equal to Germ 0065 <gen>
        • (Triggering unit) Equal to Germ 0066 <gen>
        • (Triggering unit) Equal to Germ 0067 <gen>
      • Actions
        • Wait 5.00 seconds
        • Unit - Create 1 Germ for Neutral Hostile at (Random point in Germ2 <gen>) facing Default building facing degrees
     
  2. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,190
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    • Untitled Trigger 001
      • Events
        • Unit - A unit owned by Neutral Hostile Dies
      • Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • (Triggering unit) Equal to Footman 0019 <gen>
            • (Triggering unit) Equal to Footman 0020 <gen>
            • (Triggering unit) Equal to Footman 0021 <gen>
      • Actions
        • Wait 2.00 seconds
        • Set Point = (Random point in *region*)
        • Unit - Create 1 *unit type* for Neutral Hostile at Point facing Default building facing degrees
        • Custom script: call RemoveLocation(udg_Point)
     
  3. Pharaoh_

    Pharaoh_

    Joined:
    Nov 6, 2008
    Messages:
    8,127
    Resources:
    11
    Icons:
    3
    Skins:
    1
    Spells:
    6
    Tutorials:
    1
    Resources:
    11
    Maker, you forgot the limit part :p
    • Tr
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Germ 0065 <gen>
          • (Triggering unit) Equal to Germ 0066 <gen>
          • (Triggering unit) Equal to Germ 0067 <gen>
    • Actions
      • Unit Group - Remove (Triggering unit) from GermGroup
      • If (All conditions are true) then do (Actions) else do (Actions)
        • If - Conditions
          • (Number of units in GermGroup) Less than 3
        • Then - Actions
          • Wait 2.00 seconds
          • Set Point1 = (Random point in Germ2 <gen>)
          • Unit - Create 1 Germ for Neutral Hostile at Point1 facing Default building facing degrees
          • Unit Group - Add (Last created unit) to GermGroup
          • Custom script: call RemoveLocation (udg_Point1)
        • Else - Actions


    GermGroup is a Unit Group variable.
     
  4. nedio95

    nedio95

    Joined:
    Mar 24, 2011
    Messages:
    1,055
    Resources:
    1
    Spells:
    1
    Resources:
    1
  5. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,036
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Unit-group, not unit-type.
     
  6. nedio95

    nedio95

    Joined:
    Mar 24, 2011
    Messages:
    1,055
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Erm...last, how to make those 2 :
    • Set Point1 = (Random point in Germ2 <gen>)
    • Custom script: call RemoveLocation (udg_Point1)

    Note:+rep to evryone xD.
     
  7. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,036
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Point1 is a point variable, Custom script requires that you copy+paste "call RemoveLocation(udg_Point1)" into a custom script action.
     
  8. HaniBon

    HaniBon

    Joined:
    Apr 25, 2009
    Messages:
    464
    Resources:
    0
    Resources:
    0
    Pont1
    - Go to "Variables" and create a new Variable.
    Name it whatever you want to but the type should be Point.
    A Point Variable can also be called a "Location".

    Custom Script

    - Create a new action of type "Custom Script".
    Add this text: "RemoveLocation (udg_VARIABLE)"
    The "VARIABLE" features the name of the "Point" variable you made in the previous step. This custom script will remove the variable, making it leakfree.

    I hope that clears it out for you.
    If not, reply or send a PM to me or any other experienced triggerer.
    Thank you for reading.
     
  9. nedio95

    nedio95

    Joined:
    Mar 24, 2011
    Messages:
    1,055
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Tnx very much. I understand now. :D