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

Huge wait for trigger

Status
Not open for further replies.
Level 2
Joined
Dec 25, 2010
Messages
11
The problem is when the round is over, it takes like a minute or 2 to realize that the round is over and teleport the units to shop and start next rounds timer...rep+ if can fix




The timer-

  • Timer
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Wave Incoming!
      • Countdown Timer - Start RoundWindow as a One-shot timer that will expire in 80.00 seconds
      • Set RoundWindow = (Last started timer)
      • Countdown Timer - Create a timer window for (Last started timer) with title |c00990000Enemy Wav...
      • Game - Display to (All players) the text: TIMER
      • Wait 83.00 seconds
      • Trigger - Turn on checker <gen>
Checks if round is over, and teleports units to shop area, and starts timer for next round-
  • checker
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • RoundStatus Equal to False
    • Actions
      • Unit Group - Pick every unit in (Units in ARENA1 <gen>) and do (Unit - Move (Picked unit) instantly to (Center of HeroRespawn <gen>))
      • Trigger - Run Timer <gen> (ignoring conditions)
      • Game - Display to (All players) the text: CHECKER
      • Trigger - Turn off checker <gen>
Double checks if round is over

  • CHECKSTATUS
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • (Number of units in (Units in ARENA1 <gen> owned by Player 12 (Brown))) Less than or equal to 1
    • Actions
      • Set RoundStatus = False
      • Game - Display to (All players) the text: checkstatus
      • Trigger - Turn on checker <gen>
      • Trigger - Turn off (This trigger)
SPAWN HANDLER-
  • Spawn
    • Events
      • Time - RoundWindow expires
    • Conditions
    • Actions
      • Trigger - Turn on checker <gen>
      • Trigger - Turn on CHECKSTATUS <gen>
      • Game - Display to (All players) the text: SPAWN
      • Countdown Timer - Destroy (Last created timer window)
      • Set RoundStatus = True
      • Set lvlnum = (lvlnum + 1)
      • Game - Display to (All players) the text: (|c00999900Round + (|c00990000 + ((String(lvlnum)) + (|r + |c00999900has started!|r))))
      • Set loc[1] = (Center of Arena1Spawn1 <gen>)
      • Set loc[2] = (Center of Arena1Spawn2 <gen>)
      • Set loc[3] = (Center of Arena1Spawn3 <gen>)
      • For each (Integer A) from 1 to unit_amount[lvlnum], do (Actions)
        • Loop - Actions
          • Set incrementx = 1
          • Set incrementy = 1
          • For each (Integer B) from 1 to 4, do (Actions)
            • Loop - Actions
              • Set RoundCount = 1
              • Unit - Create 1 unit_type[lvlnum] for Player 12 (Brown) at loc[incrementy] facing Default building facing degrees
              • Unit - Order (Random unit from (Units owned by Player 12 (Brown))) to Attack-Move To (Position of (Random unit from (Units within 9000.00 of (Center of ARENA1 <gen>))))
              • Unit - Create 1 unit_type[lvlnum] for Player 12 (Brown) at loc[(incrementy + 1)] facing Default building facing degrees
              • Unit - Order (Random unit from (Random 100 units from (Units in (Playable map area) owned by Player 12 (Brown)))) to Attack-Move To (Position of (Random unit from (Units within 9000.00 of (Center of ARENA1 <gen>))))
              • Set incrementx = (incrementx + 1)
              • Set incrementy = (incrementy + 2)
          • Wait until (((Last created unit) is dead) Equal to True), checking every 1.00 seconds
      • For each (Integer A) from 1 to unit_amount_var_three[lvlnum], do (Actions)
        • Loop - Actions
          • Set incrementx = 1
          • Set incrementy = 1
          • For each (Integer B) from 1 to 4, do (Actions)
            • Loop - Actions
              • Set RoundCount = 2
              • Unit - Create 1 unit_type_var_three[lvlnum] for Player 12 (Brown) at loc[incrementy] facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
              • Unit - Create 1 unit_type_var_three[lvlnum] for Player 12 (Brown) at loc[(incrementy + 1)] facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
              • Set incrementx = (incrementx + 1)
              • Set incrementy = (incrementy + 2)
          • Wait 0.75 seconds
      • For each (Integer A) from 1 to unit_amount_var_two[lvlnum], do (Actions)
        • Loop - Actions
          • Set incrementx = 1
          • Set incrementy = 1
          • For each (Integer B) from 1 to 4, do (Actions)
            • Loop - Actions
              • Set RoundCount = 3
              • Unit - Create 1 unit_type_var_two[lvlnum] for Player 12 (Brown) at loc[incrementy] facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
              • Unit - Create 1 unit_type_var_two[lvlnum] for Player 12 (Brown) at loc[(incrementy + 1)] facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
              • Set incrementx = (incrementx + 1)
              • Set incrementy = (incrementy + 2)
          • Wait 0.75 seconds
      • Custom script: call RemoveLocation( udg_loc[1] )
      • Custom script: call RemoveLocation( udg_loc[2] )
      • Custom script: call RemoveLocation( udg_loc[3] )
      • Custom script: call RemoveLocation( udg_loc[4] )
      • Custom script: call RemoveLocation( udg_loc[5] )
      • Custom script: call RemoveLocation( udg_loc[6] )
      • Custom script: call RemoveLocation( udg_loc[7] )
      • Custom script: call RemoveLocation( udg_loc[8] )
Starts wave timer

  • Start
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
      • (Number of units in (Units in ARENA1 <gen> owned by Player 12 (Brown))) Equal to 0
      • RoundStatus Equal to False
    • Actions
      • Game - Display to (All players) the text: Start
      • Trigger - Run Timer <gen> (ignoring conditions)
 
Level 2
Joined
Dec 25, 2010
Messages
11
also when the units spawn there suppose to go and attack the players automatically, but it is really sketchy and doesnt work


BTW removing the wait 83 seconds did not fix the problem


EDIT: maybe made it 3 seconds faster maybe more
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Number of units in (Units in ARENA1 <gen> owned by Player 12 (Brown))) Less than or equal to 1
^That kind of conditions take dead units into account also. Units cease to exist after their decay time is over, and by default it is around 80 seconds.

Use this, also avoids the leak:
  • Untitled Trigger 011
    • Events
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units owned by Player 12 (Brown) matching (((Matching unit) is alive) Equal to True))) Equal to 0
        • Then - Actions
        • Else - Actions
 
Level 2
Joined
Dec 25, 2010
Messages
11
Thank you rep+++

also while were at it , do u know how to make the units attack the players automatically, it is very....not working atm lol
 
Status
Not open for further replies.
Top