• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Send a boss-unit every fifth wave, how?

Level 17
Joined
Jul 19, 2007
Messages
971
Hi. Like the title says I want a boss-unit to be sent every fifth wave of defending units. I didn't create this triggers myself so I have no idéa how to do it. As you can see it sends a Dwarf Shieldbreaker every second wave so how do I do if I want every fifth wave to send a boss-unit?
  • Good Attack
    • Events
      • Time - Every 40.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet IntWaveNumberGood = (IntWaveNumberGood + 1)
      • -------- Lane 1 --------
      • Unit - Create 4 Gondor Swordsman for Player 10 (Light Blue) at GoodAttack[0] facing Default building facing degrees
      • Unit - Create 2 Rohan Archer for Player 10 (Light Blue) at GoodAttack[0] facing Default building facing degrees
      • Unit - Create 1 Elven Archer for Player 10 (Light Blue) at GoodAttack[0] facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntWaveNumberGood Greater than or equal to IntWaveNumberGoodSpawnDwarfL1
        • Then - Actions
          • Unit - Create 1 Dwarf Shieldbreaker for Player 10 (Light Blue) at GoodAttack[0] facing Default building facing degrees
        • Else - Actions
      • Custom script: set bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units in Good Attacks 1 <gen> owned by Player 10 (Light Blue)) and do (Unit - Order (Picked unit) to Attack-Move To GoodAttack[2])
      • -------- Lane 2 --------
      • Unit - Create 4 Gondor Swordsman for Player 10 (Light Blue) at GoodAttack[1] facing Default building facing degrees
      • Unit - Create 2 Rohan Archer for Player 10 (Light Blue) at GoodAttack[1] facing Default building facing degrees
      • Unit - Create 1 Elven Archer for Player 10 (Light Blue) at GoodAttack[1] facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntWaveNumberGood Greater than or equal to IntWaveNumberGoodSpawnDwarfL2
        • Then - Actions
          • Unit - Create 1 Dwarf Shieldbreaker for Player 10 (Light Blue) at GoodAttack[1] facing Default building facing degrees
        • Else - Actions
      • Custom script: set bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units in Good Attacks 2 <gen> owned by Player 10 (Light Blue)) and do (Unit - Order (Picked unit) to Attack-Move To GoodAttack[3])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IntWaveNumberGood Greater than or equal to 2
        • Then - Actions
          • Set VariableSet IntWaveNumberGood = 0
        • Else - Actions
 
Use modulo

if (IntWaveNumberGood mod 2) equal 0 then
create Dwarf Shieldbreaker

if (IntWaveNumberGood mod 5) equal 0 then
create boss

and you can delete the if IntWaveNumberGood >= 2, reset to 0 part
1759841930762.png
 
Use modulo

if (IntWaveNumberGood mod 2) equal 0 then
create Dwarf Shieldbreaker

if (IntWaveNumberGood mod 5) equal 0 then
create boss

and you can delete the if IntWaveNumberGood >= 2, reset to 0 part
View attachment 550840
Is this correct? Btw there might be a problem because when you destroy an enemy barrack in 1 lane, then it is meant to be changed so it creates a Dwarf Shieldbreaker in EVERY wave in that lane...
  • Good Attack
    • Events
      • Time - Every 40.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet IntWaveNumberGood = (IntWaveNumberGood + 1)
      • -------- Lane 1 --------
      • Unit - Create 4 Gondor Swordsman for Player 10 (Light Blue) at GoodAttack[0] facing Default building facing degrees
      • Unit - Create 2 Rohan Archer for Player 10 (Light Blue) at GoodAttack[0] facing Default building facing degrees
      • Unit - Create 1 Elven Archer for Player 10 (Light Blue) at GoodAttack[0] facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (IntWaveNumberGood mod 2) Equal to 0
        • Then - Actions
          • Unit - Create 1 Dwarf Shieldbreaker for Player 10 (Light Blue) at GoodAttack[0] facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (IntWaveNumberGood mod 5) Equal to 0
        • Then - Actions
          • Unit - Create 1 Huorn for Player 10 (Light Blue) at GoodAttack[0] facing Default building facing degrees
        • Else - Actions
      • Custom script: set bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units in Good Attacks 1 <gen> owned by Player 10 (Light Blue)) and do (Unit - Order (Picked unit) to Attack-Move To GoodAttack[2])
      • -------- Lane 2 --------
      • Unit - Create 4 Gondor Swordsman for Player 10 (Light Blue) at GoodAttack[1] facing Default building facing degrees
      • Unit - Create 2 Rohan Archer for Player 10 (Light Blue) at GoodAttack[1] facing Default building facing degrees
      • Unit - Create 1 Elven Archer for Player 10 (Light Blue) at GoodAttack[1] facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (IntWaveNumberGood mod 2) Equal to 0
        • Then - Actions
          • Unit - Create 1 Dwarf Shieldbreaker for Player 10 (Light Blue) at GoodAttack[1] facing Default building facing degrees
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (IntWaveNumberGood mod 5) Equal to 0
        • Then - Actions
          • Unit - Create 1 Huorn for Player 10 (Light Blue) at GoodAttack[1] facing Default building facing degrees
        • Else - Actions
      • Custom script: set bj_wantDestroyGroup=true
      • Unit Group - Pick every unit in (Units in Good Attacks 2 <gen> owned by Player 10 (Light Blue)) and do (Unit - Order (Picked unit) to Attack-Move To GoodAttack[3])
 
Here is the triggers when you destroy your enemies barracks.
  • BuildingVurnurbleEvil
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ballista Tower 0034 <gen> is dead) Equal to True
          • (Ballista Tower 0035 <gen> is dead) Equal to True
          • (Ballista Tower 0032 <gen> is dead) Equal to True
          • (Ballista Tower 0033 <gen> is dead) Equal to True
        • Then - Actions
          • Unit - Make Barad'dur 0002 <gen> Vulnerable
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (All units of InnerTowerBad are dead) Equal to True
        • Then - Actions
          • Unit - Make Ballista Tower 0035 <gen> Vulnerable
          • Unit - Make Ballista Tower 0034 <gen> Vulnerable
          • Unit - Make Ballista Tower 0033 <gen> Vulnerable
          • Unit - Make Ballista Tower 0032 <gen> Vulnerable
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Orc Tower 0204 <gen> is dead) Equal to True
                  • (Orc Tower 0109 <gen> is dead) Equal to True
              • And - All (Conditions) are true
                • Conditions
                  • (Orc Tower 0091 <gen> is dead) Equal to True
                  • (Orc Tower 0283 <gen> is dead) Equal to True
        • Then - Actions
          • Unit - Make Orc Tower 0122 <gen> Vulnerable
          • Unit - Make Orc Tower 0111 <gen> Vulnerable
          • Unit Group - Pick every unit in InnerTowerBad and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) Vulnerable
          • Unit Group - Pick every unit in BuildingBad and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) Vulnerable
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Orc Tower 0017 <gen> is dead) Equal to True
          • (Orc Tower 0016 <gen> is dead) Equal to True
        • Then - Actions
          • Unit - Make Orc Tower 0117 <gen> Vulnerable
          • Unit - Make Orc Tower 0116 <gen> Vulnerable
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Orc Tower 0117 <gen> is dead) Equal to True
          • (Orc Tower 0116 <gen> is dead) Equal to True
        • Then - Actions
          • Unit - Make Orc Tower 0283 <gen> Vulnerable
          • Unit - Make Orc Tower 0091 <gen> Vulnerable
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Orc Tower 0015 <gen> is dead) Equal to True
          • (Orc Tower 0013 <gen> is dead) Equal to True
        • Then - Actions
          • Unit - Make Orc Tower 0115 <gen> Vulnerable
          • Unit - Make Orc Tower 0114 <gen> Vulnerable
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Orc Tower 0115 <gen> is dead) Equal to True
          • (Orc Tower 0114 <gen> is dead) Equal to True
        • Then - Actions
          • Unit - Make Orc Tower 0204 <gen> Vulnerable
          • Unit - Make Orc Tower 0109 <gen> Vulnerable
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Orc Mound 0087 <gen>
        • Then - Actions
          • Set VariableSet BarrackDestroyedAmountEvil = (BarrackDestroyedAmountEvil + 1)
          • Set VariableSet IntWaveNumberGoodSpawnDwarfL2 = 1
          • Player - Set the current research level of Extra Heavy Melee Equipement to ((Current research level of Extra Heavy Melee Equipement for Player 10 (Light Blue)) + 1) for Player 10 (Light Blue)
          • Game - Display to (All players) the text: (The |cff0080FF + (Good|r + forces destroyed a barrack they will now send a |cff0080FFDwarf Shieldbreaker|r in that lane every wave. Their |cff0080FFDwarf Shieldbreaker|r are also a bit stronger!))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Orc Mound 0088 <gen>
        • Then - Actions
          • Set VariableSet IntWaveNumberGoodSpawnDwarfL1 = 1
          • Set VariableSet BarrackDestroyedAmountEvil = (BarrackDestroyedAmountEvil + 1)
          • Player - Set the current research level of Extra Heavy Melee Equipement to ((Current research level of Extra Heavy Melee Equipement for Player 10 (Light Blue)) + 1) for Player 10 (Light Blue)
          • Game - Display to (All players) the text: (The |cff0080FF + (Good|r + forces destroyed a barrack they will now send a |cff0080FFDwarf Shieldbreaker|r in that lane every wave.Their |cff0080FFDwarf Shieldbreaker|r are also a bit stronger!))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BarrackDestroyedAmountEvil Greater than or equal to 2
        • Then - Actions
          • Set VariableSet BarrackDestroyedAmountEvil = 0
          • Player - Set the current research level of Ranged Weapon to ((Current research level of Ranged Weapon for Player 10 (Light Blue)) + 1) for Player 10 (Light Blue)
          • Player - Set the current research level of Melee Weapon to ((Current research level of Melee Weapon for Player 10 (Light Blue)) + 1) for Player 10 (Light Blue)
          • Player - Set the current research level of Heavy Melee Weapon to ((Current research level of Heavy Melee Weapon for Player 10 (Light Blue)) + 1) for Player 10 (Light Blue)
          • Player - Set the current research level of Heavy Ranged Weapon to ((Current research level of Heavy Ranged Weapon for Player 10 (Light Blue)) + 1) for Player 10 (Light Blue)
          • Player - Set the current research level of Melee Armor to ((Current research level of Melee Armor for Player 10 (Light Blue)) + 1) for Player 10 (Light Blue)
          • Player - Set the current research level of Ranged Armor to ((Current research level of Ranged Armor for Player 10 (Light Blue)) + 1) for Player 10 (Light Blue)
          • Player - Set the current research level of Heavy Melee Armor to ((Current research level of Heavy Melee Armor for Player 10 (Light Blue)) + 1) for Player 10 (Light Blue)
          • Player - Set the current research level of Heavy Ranged Armor to ((Current research level of Heavy Ranged Armor for Player 10 (Light Blue)) + 1) for Player 10 (Light Blue)
          • Wait 5.00 seconds
          • Game - Display to (All players) the text: (The |cff0080FF + (Good|r + forces destroyed both barracks. Their |cff0080FFTroops|r are also a bit stronger!))
        • Else - Actions
 
I think there are a couple of ways to do what you said. We can set more variables and decrement them or increment them to the required number and take that as the execution point or we can also add a condition. Just one of n+ conditions is true and it will trigger. I find using end if easier to control
 
Back
Top