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

[Solved] Why does this script keep bugging?

Status
Not open for further replies.
Level 3
Joined
May 21, 2011
Messages
31
Since the latest update in Zombie Arena there has been the common stopping of waves. Randomly, the waves will stop coming. I have tried several different ways to stop it, but only one of them actually spawns level two. The others just stop after the first level.

This is the one that I currently have, it is the one that stops randomly


  • Spawn
    • Events
    • Conditions
      • ZC[0] Equal to 0
    • Actions
      • Set P[1] = (Center of Spawn Top Left <gen>)
      • Set P[2] = (Center of Spawn Bottom Right <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 9
        • Then - Actions
          • Unit - Create 1 ZH[(Random integer number between 1 and 10)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create 1 ZH[(Random integer number between 1 and 10)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = 2
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 8
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 10)
          • Set ZZ[1] = (Random integer number between 1 and 10)
          • Unit - Create ZZ[0] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 7
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 10)
          • Set ZZ[1] = (Random integer number between 1 and 10)
          • Unit - Create ZZ[0] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 6
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 10)
          • Set ZZ[1] = (Random integer number between 1 and 10)
          • Unit - Create ZZ[0] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 5
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 20)
          • Set ZZ[1] = (Random integer number between 1 and 20)
          • Unit - Create ZZ[0] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 4
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 20)
          • Set ZZ[1] = (Random integer number between 1 and 20)
          • Unit - Create ZZ[0] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 3
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 20)
          • Set ZZ[1] = (Random integer number between 1 and 20)
          • Unit - Create ZZ[0] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 2
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 30)
          • Set ZZ[1] = (Random integer number between 1 and 30)
          • Unit - Create ZZ[0] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 1
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 30)
          • Set ZZ[1] = (Random integer number between 1 and 30)
          • Unit - Create ZZ[0] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: A large mass of zom...
          • Wait 30.00 seconds
          • Set ZZ[0] = (Random integer number between 1 and 30)
          • Set ZZ[1] = (Random integer number between 1 and 30)
          • Unit - Create ZZ[0] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
          • Set FRC = (FRC + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FRC Greater than or equal to 2
            • Then - Actions
              • Set RC = (RC + 1)
              • Multiboard - Set the text for Board item in column 2, row 2 to (String(RC))
              • Multiboard - Show Board
            • Else - Actions
        • Else - Actions
      • Unit Group - Pick every unit in ZG and do (Actions)
        • Loop - Actions
          • Hero - Set (Picked unit) Hero-level to ZL, Hide level-up graphics
      • Set WC[0] = (WC[0] + 1)
      • Multiboard - Set the text for Board item in column 2, row 3 to (String(WC[0]))
      • Multiboard - Show Board
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 10
        • Then - Actions
          • Set WC[0] = 0
          • Set ZL = (ZL + 1)
        • Else - Actions



  • Check
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • Set ZC[0] = (ZC[0] - 1)
      • Trigger - Run Spawn <gen> (checking conditions)



This is one of the ways I tried to combat the problem but it doesn't spawn the second wave.


  • Spawn
    • Events
    • Conditions
      • (Number of units in ZG) Equal to 0
    • Actions
      • Set P[1] = (Center of Spawn Top Left <gen>)
      • Set P[2] = (Center of Spawn Bottom Right <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 9
        • Then - Actions
          • Unit - Create 1 ZH[(Random integer number between 1 and 10)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create 1 ZH[(Random integer number between 1 and 10)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = 2
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 8
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 10)
          • Set ZZ[1] = (Random integer number between 1 and 10)
          • Unit - Create ZZ[0] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 7
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 10)
          • Set ZZ[1] = (Random integer number between 1 and 10)
          • Unit - Create ZZ[0] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 6
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 10)
          • Set ZZ[1] = (Random integer number between 1 and 10)
          • Unit - Create ZZ[0] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 5
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 20)
          • Set ZZ[1] = (Random integer number between 1 and 20)
          • Unit - Create ZZ[0] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 4
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 20)
          • Set ZZ[1] = (Random integer number between 1 and 20)
          • Unit - Create ZZ[0] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 3
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 20)
          • Set ZZ[1] = (Random integer number between 1 and 20)
          • Unit - Create ZZ[0] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 2
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 30)
          • Set ZZ[1] = (Random integer number between 1 and 30)
          • Unit - Create ZZ[0] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 1
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 30)
          • Set ZZ[1] = (Random integer number between 1 and 30)
          • Unit - Create ZZ[0] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: A large mass of zom...
          • Wait 30.00 seconds
          • Set ZZ[0] = (Random integer number between 1 and 30)
          • Set ZZ[1] = (Random integer number between 1 and 30)
          • Unit - Create ZZ[0] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
          • Set FRC = (FRC + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FRC Greater than or equal to 2
            • Then - Actions
              • Set RC = (RC + 1)
              • Multiboard - Set the text for Board item in column 2, row 2 to (String(RC))
              • Multiboard - Show Board
            • Else - Actions
        • Else - Actions
      • Unit Group - Pick every unit in ZG and do (Actions)
        • Loop - Actions
          • Hero - Set (Picked unit) Hero-level to ZL, Hide level-up graphics
      • Set WC[0] = (WC[0] + 1)
      • Multiboard - Set the text for Board item in column 2, row 3 to (String(WC[0]))
      • Multiboard - Show Board
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 10
        • Then - Actions
          • Set WC[0] = 0
          • Set ZL = (ZL + 1)
        • Else - Actions



  • Check
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Owner of (Dying unit)) Equal to Neutral Hostile
    • Actions
      • Unit Group - Remove (Triggering unit) from ZG
      • Trigger - Run Spawn <gen> (checking conditions)



This is the third trigger that I tried to use, but has the same effects of the previous one.


  • Spawn
    • Events
    • Conditions
      • (Number of units in (Units owned by Neutral Hostile)) Equal to 0
    • Actions
      • Set P[1] = (Center of Spawn Top Left <gen>)
      • Set P[2] = (Center of Spawn Bottom Right <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 9
        • Then - Actions
          • Unit - Create 1 ZH[(Random integer number between 1 and 10)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create 1 ZH[(Random integer number between 1 and 10)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = 2
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 8
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 10)
          • Set ZZ[1] = (Random integer number between 1 and 10)
          • Unit - Create ZZ[0] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 7
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 10)
          • Set ZZ[1] = (Random integer number between 1 and 10)
          • Unit - Create ZZ[0] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 6
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 10)
          • Set ZZ[1] = (Random integer number between 1 and 10)
          • Unit - Create ZZ[0] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZHD[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 5
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 20)
          • Set ZZ[1] = (Random integer number between 1 and 20)
          • Unit - Create ZZ[0] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 4
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 20)
          • Set ZZ[1] = (Random integer number between 1 and 20)
          • Unit - Create ZZ[0] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 3
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 20)
          • Set ZZ[1] = (Random integer number between 1 and 20)
          • Unit - Create ZZ[0] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZM[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 2
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 30)
          • Set ZZ[1] = (Random integer number between 1 and 30)
          • Unit - Create ZZ[0] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 1
        • Then - Actions
          • Set ZZ[0] = (Random integer number between 1 and 30)
          • Set ZZ[1] = (Random integer number between 1 and 30)
          • Unit - Create ZZ[0] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: A large mass of zom...
          • Wait 30.00 seconds
          • Set ZZ[0] = (Random integer number between 1 and 30)
          • Set ZZ[1] = (Random integer number between 1 and 30)
          • Unit - Create ZZ[0] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[1] facing Default building facing degrees
          • Unit - Create ZZ[1] ZE[(Random integer number between 0 and 5)] for Neutral Hostile at P[2] facing Default building facing degrees
          • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))
          • Set ZC[0] = (ZZ[0] + ZZ[1])
          • Set FRC = (FRC + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • FRC Greater than or equal to 2
            • Then - Actions
              • Set RC = (RC + 1)
              • Multiboard - Set the text for Board item in column 2, row 2 to (String(RC))
              • Multiboard - Show Board
            • Else - Actions
        • Else - Actions
      • Unit Group - Pick every unit in ZG and do (Actions)
        • Loop - Actions
          • Hero - Set (Picked unit) Hero-level to ZL, Hide level-up graphics
      • Set WC[0] = (WC[0] + 1)
      • Multiboard - Set the text for Board item in column 2, row 3 to (String(WC[0]))
      • Multiboard - Show Board
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WC[0] Equal to 10
        • Then - Actions
          • Set WC[0] = 0
          • Set ZL = (ZL + 1)
        • Else - Actions



[trigger
Check
Events
Unit - A unit Dies
Conditions
(Owner of (Dying unit)) Equal to Neutral Hostile
Actions
Trigger - Run Spawn <gen> (checking conditions)
[/trigger]



As you can see the only thing that really changes is two little things. The check sets zc - 1, removes unit from UG, or neither. The check on the spawn counts the units in UG, Counts units owned by neutral hostile, or sees that ZC = 0.

The only trigger that spawns neutral hostile units is Spawn, every other spawn is for neutral passive, brown, dark green, and players.


Plus rep to whoever solves this first. Thanks in advance.
 
Level 15
Joined
Oct 18, 2008
Messages
1,588
1st remove spawn point leak :D
then...
Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile))

add to conditions:
  • Set ZG = (Units in (Playable map area) matching ((Owner of (Matching unit)) Equal to Neutral Hostile)) and ((Matching unit) is Alive))
else it'll readd the unit every time it loops

and write the check like:
  • Unit Group - Remove (Triggering unit) from ZG
  • Unit - Remove (Triggering Unit) from game
  • ZC[0] = Integer - Number of Units in ZG
 
Level 3
Joined
May 21, 2011
Messages
31
Thanks so much Kanadaj :). It all works, and thanks for pointing out the leak proofing. Making the long trigger made me forget :D.

Me and everyone who plays Zombie Arena appreciates your help, I will be mentioning you on the forums and integrating you into the game :D. And + rep as promised.
 
Status
Not open for further replies.
Top