• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Make only 5 units on a .10 periodic trigger.

Status
Not open for further replies.
Level 6
Joined
Apr 23, 2009
Messages
94
  • Melee Initialization
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
My trigger has this basis for creating the units in it. But i can't seem to limit the amount of units created, for instance:

The trigger is turned on, and only turns off once a certain unit has died. But it SHOULD create 1 unit for every enemy unit within a 350 range, a max of 5 units total. I can get it to create 1 or 2 or 3 or 4 or 5.. but once the trigger periodically goes again, it creates said units AGAIN.

Is there a way to make it create the units only once, or check if there is a difference in units, and create as much units as needed? Having something else turn the trigger off isn't an option. This is really frustrating, and it's really hot where i live! :cry:
 
  • Jepaa
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in RespawnGroup) Less than 5
        • Then - Actions
          • Unit - Create 1 Footman for Player 1 (Red) at (blah blah) facing Default building facing (270.0) degrees
          • Unit Group - Add (Last created unit) to RespawnGroup
        • Else - Actions
  • Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in RespawnGroup) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from RespawnGroup
For the first trigger, you can also create an unit group that contains all hostile units withing range of certain point, and use the number of units in that group as a condition to limit the number of units created.
 
  • Melee Initialization
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
My trigger has this basis for creating the units in it. But i can't seem to limit the amount of units created, for instance:

The trigger is turned on, and only turns off once a certain unit has died. But it SHOULD create 1 unit for every enemy unit within a 350 range, a max of 5 units total. I can get it to create 1 or 2 or 3 or 4 or 5.. but once the trigger periodically goes again, it creates said units AGAIN.

Is there a way to make it create the units only once, or check if there is a difference in units, and create as much units as needed? Having something else turn the trigger off isn't an option. This is really frustrating, and it's really hot where i live! :cry:

Before you begin using timers learn to use the other events.
Use A unit die
Owner of the dying unit is player 1 (red) equal to true
Unit - Create 1 :razz: at position of dying unit
 
  • Jepaa
    • Events
      • Time - Every 0.10 sec of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in RespawnGroup) Less than 5
        • Then - Actions
          • Unit - Create 1 Footman for Player 1 (Red) at (blah blah) facing Default building facing (270.0) degrees
          • Unit Group - Add (Last created unit) to RespawnGroup
        • Else - Actions
  • Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in RespawnGroup) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from RespawnGroup

Too much cpu consuming
Do it like this

  • Jepaa
    • Events
      • Time - Every 0.10 sec of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (IntegerVariable) Less than 5
        • Then - Actions
          • Unit - Create 1 Footman for Player 1 (Red) at (blah blah) facing Default building facing (270.0) degrees
          • Set Integer Variable = ((Integer Variable) +1)
          • Unit Group - Add (Last created unit) to RespawnGroup
        • Else - Actions
  • Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in RespawnGroup) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from RespawnGroup
      • Set Integer Variable = ((Integer Variable) -1)
[/quote]
 
Before you begin using timers learn to use the other events.
Use A unit die
Owner of the dying unit is player 1 (red) equal to true
Unit - Create 1 :razz: at position of dying unit

I'm sorry i used such a simple trigger to depict my problem, but rediculing me for it wasn't neccessary.

I know how to use "the other events", please only answer the question, and don't assume i have no knowledge of related content. Thanks.
 
Status
Not open for further replies.
Back
Top