• 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.

[Trigger] Will this work?

Status
Not open for further replies.
Level 17
Joined
May 6, 2008
Messages
1,598
Hi. I'm wondering if this will work:



  • centaur drudge and or archer respawn
    • Events
      • Unit - A unit owned by Player 12 (Brown) Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Centaur Drudge
        • Then - Actions
          • Wait 45.00 seconds
          • Unit - Create 1 (Unit-type of (Triggering unit)) for Player 12 (Brown) at (Random point in centaur respawn <gen>) facing 14.00 degrees
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Centaur Archer
        • Then - Actions
          • Wait 45.00 seconds
          • Unit - Create 1 (Unit-type of (Triggering unit)) for Player 12 (Brown) at (Random point in centaur respawn <gen>) facing Default building facing degrees
        • Else - Actions
          • Do nothing

This is my first RPG map so I'm not good at respawning creeps and such.
 
Last edited:
Level 12
Joined
Mar 23, 2008
Messages
942
I think he is saying that if other unit dies in the 45s after another unit died, the timer will go back to 45s.
So if you kill all the units, only 1 unit will respawn.

But, I'm not sure, maybe I'm wrong.
 
Level 5
Joined
Aug 27, 2007
Messages
138
Replace this:

  • Unit - Create 1 (Unit-type of (Triggering unit)) for Player 12 (Brown) at (Random point in centaur respawn <gen>) facing 14.00 degrees
With this (for the first if/then/else):
  • Unit - Create 1 Centaur Drudge for Player 12 (Brown) at (Random point in centaur respawn <gen>) facing 14.00 degrees
And this (for the second if/then/else):
  • Unit - Create 1 Archer for Player 12 (Brown) at (Random point in centaur respawn <gen>) facing 14.00 degrees
It's not the most elegant method, but it will work.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
I suggest creating 4 variables, two timer arrays (Tim1 and Tim2 for example) with maximum number of arrays (8192) and two integer variables (Int1 and Int2).

You can increase the integer each time and use it as index in timer array. Something like this:

  • Respawn
  • Events
    • A Unit dies
  • Conditions
  • Actions
    • If Int1 Greater than or equal to 8192 Then (Set Int = 0) Else (Do nothing)
    • If Int2 Greater than or equal to 8192 Then (Set Int = 0) Else (Do nothing)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Unit-type of (Triggering unit)) Equal to Centaur Drudge
      • Then - Actions
        • Start Tim1[Int1] as a One-shot timer that will expire in 45 seconds)
        • <add the event to Centaur Drudge trigger "Tim1[Int1] expires", I don't know how it goes exactly>
        • Set Int1 = (Int1 + 1)
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Unit-type of (Triggering unit)) Equal to Centaur Archer
          • Then - Actions
            • Start Tim2[Int2] as a One-shot timer that will expire in 45 seconds)
            • <add the event to Centaur Archer trigger "Tim2[Int2] expires">
            • Set Int2 = (Int2 + 1)
          • Else - Actions
  • Centaur Drudge
  • Events
  • Conditions
  • Actions
    • Unit - Create 1 Centaur Drudge for Player 12 (Brown) at (Random point in centaur respawn <gen>) facing 14.00 degrees
  • Centaur Archer
  • Events
  • Conditions
  • Actions
    • Unit - Create 1 Centaur Archer for Player 12 (Brown) at (Random point in centaur respawn <gen>) facing 14.00 degrees
I don't know if it's the simplest way, I don't like GUI so I forgot how to work with it.
 
Level 12
Joined
May 4, 2008
Messages
1,111
u could also try this and make an area thats wide enof so that u cant lead monsters away and kill one to make them spawn

Events
Unit - A unit dies

Actions

If - No more Units belonging to X in area X
Then - Spawn X amount of X unit at area X
Else - If - No more Units belonging to X in area Y
Then - Spawn X amount of X unit at area Y
Else - etc.
 
Status
Not open for further replies.
Top