Td Wave Problem

LordOfQc

New Member
Reaction score
0
Im am making a Td and I have a problem with my wave triggers.

This is my trigger for the Wave 1, the wave 2 is the same.

Trigger:
  • Wave 1
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set Wave = Wave 2 <gen>
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Must finish the round)) and do (Unit - Remove (Picked unit) from the game)
      • Set WaveNumber = 1
      • Set RoundBonus = 10
      • Unit - Create 10 Peasant for Player 12 (Brown) at (Center of Red Spawn <gen>) facing 90.00 degrees
      • Set WaveUnitGroup[1] = (Units in Red Spawn <gen> owned by Player 12 (Brown))
      • Unit - Create 10 Peasant for Player 12 (Brown) at (Center of Blue Spawn <gen>) facing 90.00 degrees
      • Set WaveUnitGroup[2] = (Units in Blue Spawn <gen> owned by Player 12 (Brown))
      • Unit - Create 10 Peasant for Player 12 (Brown) at (Center of Teal Spawn <gen>) facing 90.00 degrees
      • Set WaveUnitGroup[3] = (Units in Teal Spawn <gen> owned by Player 12 (Brown))
      • Unit - Create 10 Peasant for Player 12 (Brown) at (Center of Purple Spawn <gen>) facing 90.00 degrees
      • Set WaveUnitGroup[4] = (Units in Purple Spawn <gen> owned by Player 12 (Brown))
      • Unit - Create 10 Peasant for Player 10 (Light Blue) at (Center of Yellow Spawn <gen>) facing 90.00 degrees
      • Set WaveUnitGroup[5] = (Units in Yellow Spawn <gen> owned by Player 10 (Light Blue))
      • Unit - Create 10 Peasant for Player 10 (Light Blue) at (Center of Orange Spawn <gen>) facing 90.00 degrees
      • Set WaveUnitGroup[6] = (Units in Orange Spawn <gen> owned by Player 10 (Light Blue))
      • Unit - Create 10 Peasant for Player 10 (Light Blue) at (Center of Green Green Spawn <gen>) facing 90.00 degrees
      • Set WaveUnitGroup[7] = (Units in Green Green Spawn <gen> owned by Player 10 (Light Blue))
      • Unit - Create 10 Peasant for Player 10 (Light Blue) at (Center of Pink Spawn <gen>) facing 90.00 degrees
      • Set WaveUnitGroup[8] = (Units in Pink Spawn <gen> owned by Player 10 (Light Blue))
      • Unit Group - Remove all units from WaveUnitGroup[9]
      • Set WaveUnitGroup[9] = (Units in (Entire map) matching (((Owner of (Matching unit)) Equal to Player 12 (Brown)) or ((Owner of (Matching unit)) Equal to Player 10 (Light Blue))))
      • Trigger - Turn on Wave Complete <gen>
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Chicken Building
            • Then - Actions
              • Unit - Hide (Picked unit)
              • Unit - Create 1 Chicken Unit for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees
              • Unit Group - Add (Last created unit) to UnitCreated
              • Unit Group - Add (Picked unit) to HideUnitGroup
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Frog Building
            • Then - Actions
              • Unit - Hide (Picked unit)
              • Unit - Create 1 Frog Unit for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees
              • Unit Group - Add (Last created unit) to UnitCreated
              • Unit Group - Add (Picked unit) to HideUnitGroup
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Pig Building
            • Then - Actions
              • Unit - Hide (Picked unit)
              • Unit - Create 1 Pig Unit for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees
              • Unit Group - Add (Last created unit) to UnitCreated
              • Unit Group - Add (Picked unit) to HideUnitGroup
            • Else - Actions


And this is my trigger to end wave 1 and start wave 2

Trigger:
  • Wave Complete
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • (Number of units in WaveUnitGroup[9]) Less than or equal to 2
    • Actions
      • Unit Group - Remove all units from WaveUnitGroup[1]
      • Unit Group - Remove all units from WaveUnitGroup[2]
      • Unit Group - Remove all units from WaveUnitGroup[3]
      • Unit Group - Remove all units from WaveUnitGroup[4]
      • Unit Group - Remove all units from WaveUnitGroup[5]
      • Unit Group - Remove all units from WaveUnitGroup[6]
      • Unit Group - Remove all units from WaveUnitGroup[7]
      • Unit Group - Remove all units from WaveUnitGroup[8]
      • Unit Group - Remove all units from WaveUnitGroup[9]
      • Trigger - Turn off Teleport Units <gen>
      • Trigger - Turn off (This trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Unit - Create 1 Must finish the round for Player 1 (Red) at (Center of Must Fnish the Round <gen>) facing Default building facing degrees
          • Unit - Create 1 Must finish the round for Player 2 (Blue) at (Center of Must Fnish the Round <gen>) facing Default building facing degrees
          • Unit - Create 1 Must finish the round for Player 3 (Teal) at (Center of Must Fnish the Round <gen>) facing Default building facing degrees
          • Unit - Create 1 Must finish the round for Player 4 (Purple) at (Center of Must Fnish the Round <gen>) facing Default building facing degrees
          • Unit - Create 1 Must finish the round for Player 5 (Yellow) at (Center of Must Fnish the Round <gen>) facing Default building facing degrees
          • Unit - Create 1 Must finish the round for Player 6 (Orange) at (Center of Must Fnish the Round <gen>) facing Default building facing degrees
          • Unit - Create 1 Must finish the round for Player 7 (Green) at (Center of Must Fnish the Round <gen>) facing Default building facing degrees
          • Unit - Create 1 Must finish the round for Player 8 (Pink) at (Center of Must Fnish the Round <gen>) facing Default building facing degrees
        • Else - Actions
      • Game - Display to (All players) the text: (Wave + ((String(WaveNumber)) + Cleared!))
      • Wait 5.00 seconds
      • Sound - Play GoodJob <gen>
      • Camera - Pan camera for Player 1 (Red) to (Position of Builder[1]) over 1.00 seconds
      • Camera - Pan camera for Player 2 (Blue) to (Position of Builder[2]) over 1.00 seconds
      • Camera - Pan camera for Player 3 (Teal) to (Position of Builder[3]) over 1.00 seconds
      • Camera - Pan camera for Player 4 (Purple) to (Position of Builder[4]) over 1.00 seconds
      • Camera - Pan camera for Player 5 (Yellow) to (Position of Builder[5]) over 1.00 seconds
      • Camera - Pan camera for Player 6 (Orange) to (Position of Builder[6]) over 1.00 seconds
      • Camera - Pan camera for Player 7 (Green) to (Position of Builder[7]) over 1.00 seconds
      • Camera - Pan camera for Player 8 (Pink) to (Position of Builder[8]) over 1.00 seconds
      • Selection - Select Builder[1] for Player 1 (Red)
      • Selection - Select Builder[2] for Player 2 (Blue)
      • Selection - Select Builder[3] for Player 3 (Teal)
      • Selection - Select Builder[4] for Player 4 (Purple)
      • Selection - Select Builder[5] for Player 5 (Yellow)
      • Selection - Select Builder[6] for Player 6 (Orange)
      • Selection - Select Builder[7] for Player 7 (Green)
      • Selection - Select Builder[8] for Player 8 (Pink)
      • Unit Group - Pick every unit in UnitCreated and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
      • Unit Group - Pick every unit in HideUnitGroup and do (Actions)
        • Loop - Actions
          • Unit - Unhide (Picked unit)
          • Unit Group - Remove all units from HideUnitGroup
      • Player - Add Income[1] to Player 1 (Red) Current gold
      • Player - Add Income[2] to Player 2 (Blue) Current gold
      • Player - Add Income[3] to Player 3 (Teal) Current gold
      • Player - Add Income[4] to Player 4 (Purple) Current gold
      • Player - Add Income[5] to Player 5 (Yellow) Current gold
      • Player - Add Income[6] to Player 6 (Orange) Current gold
      • Player - Add Income[7] to Player 7 (Green) Current gold
      • Player - Add Income[8] to Player 8 (Pink) Current gold
      • Game - Display to Player Group - Player 1 (Red) the text: (Income Bonus : + (String(Income[1])))
      • Game - Display to Player Group - Player 2 (Blue) the text: (Income Bonus : + (String(Income[2])))
      • Game - Display to Player Group - Player 3 (Teal) the text: (Income Bonus : + (String(Income[3])))
      • Game - Display to Player Group - Player 4 (Purple) the text: (Income Bonus : + (String(Income[4])))
      • Game - Display to Player Group - Player 5 (Yellow) the text: (Income Bonus : + (String(Income[5])))
      • Game - Display to Player Group - Player 6 (Orange) the text: (Income Bonus : + (String(Income[6])))
      • Game - Display to Player Group - Player 7 (Green) the text: (Income Bonus : + (String(Income[7])))
      • Game - Display to Player Group - Player 8 (Pink) the text: (Income Bonus : + (String(Income[8])))
      • Game - Display to (All players) the text: (Round Bonus : + (String(RoundBonus)))
      • Player - Add RoundBonus to Player 1 (Red) Current gold
      • Player - Add RoundBonus to Player 2 (Blue) Current gold
      • Player - Add RoundBonus to Player 3 (Teal) Current gold
      • Player - Add RoundBonus to Player 4 (Purple) Current gold
      • Player - Add RoundBonus to Player 5 (Yellow) Current gold
      • Player - Add RoundBonus to Player 6 (Orange) Current gold
      • Player - Add RoundBonus to Player 7 (Green) Current gold
      • Player - Add RoundBonus to Player 8 (Pink) Current gold
      • Trigger - Turn on Wave
      • Countdown Timer - Start Timer as a One-shot timer that will expire in 30.00 seconds


The triggers work for the wave 1 and 3 but there is a 20-30 seconds delay when all the creep are dead before the end of the round for the wave 2 and 4. I don't know why

I need help please :banghead:
 

canons200

New Member
Reaction score
50
Trigger:
  • Countdown Timer - Start Timer as a One-shot timer that will expire in 30.00 seconds

is this 1? the second delay you have said.

anyway actually there is no need to run the trigger every 0.01 seconds, because it will create massive lag if your computer can't support, use higher value since the trigger is to spawn creep, it won't be hurt to put every 1 seconds. Or use every 0.03 seconds, the optimum value.
 

LordOfQc

New Member
Reaction score
0
Trigger:
  • Countdown Timer - Start Timer as a One-shot timer that will expire in 30.00 seconds

is this 1? the second delay you have said.

anyway actually there is no need to run the trigger every 0.01 seconds, because it will create massive lag if your computer can't support, use higher value since the trigger is to spawn creep, it won't be hurt to put every 1 seconds. Or use every 0.03 seconds, the optimum value.

Ya i know i changed the event but no its no the 30 sec delay. I have a 30 sec delay when all the creeps are dead before the round start
 

canons200

New Member
Reaction score
50
oh, remove the corpse because they are still counted as unit or lower the corpse duration.
 

LordOfQc

New Member
Reaction score
0
Already have a trigger for this sorry if I didn't say it. Like I said, the trigger works for the wave 1 and 3 but not for 2-4-5-6-7-8 isk why and I checked all my triggers
 

Stringel

New Member
Reaction score
12
On another note you would reduce your code severelly if you set up wave units and wave index in a map init trigger and create only 1 single trigger for the waves (instead of 1 for each wave).
 

LordOfQc

New Member
Reaction score
0
On another note you would reduce your code severelly if you set up wave units and wave index in a map init trigger and create only 1 single trigger for the waves (instead of 1 for each wave).

Good idea, i will do that
 

LordOfQc

New Member
Reaction score
0
Sorry didn't understand what you said, Atcually, it was the corpses, thanks for the help :thup:
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top