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

Respawn Trigger randomly stops working

Level 3
Joined
Oct 21, 2023
Messages
25
These triggers will randomly stop automatically spawning units, please help me fix them. It's for 22 players. It chooses between 323 units to respawn.

F variable is unit-type, limit 500. No initial value.
VSUnit & PlayerUnitFree variable is unit, size 22. No initial value.

  • IfPlayerUnitDie
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[1]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 2 (Blue) at (Center of VWest1 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[1] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[2]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 3 (Teal) at (Center of VWest2 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[2] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[3]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 4 (Purple) at (Center of VWest3 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[3] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[4]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 5 (Yellow) at (Center of VWest4 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[4] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[5]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 6 (Orange) at (Center of VWest5 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[5] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[11]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 13 (Maroon) at (Center of VWest6 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[11] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[12]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 14 (Navy) at (Center of VWest7 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[12] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[13]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 15 (Turquoise) at (Center of VWest8 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[13] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[14]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 16 (Violet) at (Center of VWest9 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[14] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[15]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 17 (Wheat) at (Center of VWest10 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[15] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[16]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[1].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 18 (Peach) at (Center of VWest11 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[16] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
        • Else - Actions
      • -------- ----------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[6]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 8 (Pink) at (Center of VEast1 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[6] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[7]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 9 (Gray) at (Center of VEast2 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[7] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[8]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 10 (Light Blue) at (Center of VEast3 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[8] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[9]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 11 (Dark Green) at (Center of VEast4 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[9] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[10]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 12 (Brown) at (Center of VEast5 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[10] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[17]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 19 (Mint) at (Center of VEast6 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[17] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[18]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 20 (Lavender) at (Center of VEast7 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[18] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[19]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 21 (Coal) at (Center of VEast8 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[19] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[20]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 22 (Snow) at (Center of VEast9 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[20] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[21]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 23 (Emerald) at (Center of VEast10 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[21] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to VSUnit[22]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • Unit Group - Remove (Dying unit) from PointLostUnit[2].
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 24 (Peanut) at (Center of VEast11 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[22] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
        • Else - Actions
  • PlayerUnitDie
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[1]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 2 (Blue) at (Center of Player1 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[1] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[2]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 3 (Teal) at (Center of Player2 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[2] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[3]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 4 (Purple) at (Center of Player3 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[3] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[4]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 5 (Yellow) at (Center of Player4 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[4] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[5]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 6 (Orange) at (Center of Player5 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[5] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[6]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 8 (Pink) at (Center of Player6 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[6] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[7]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 9 (Gray) at (Center of Player7 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[7] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[8]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 10 (Light Blue) at (Center of Player8 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[8] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[9]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 11 (Dark Green) at (Center of Player9 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[9] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[10]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 12 (Brown) at (Center of Player10 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[10] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[11]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 13 (Maroon) at (Center of Player11 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[11] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[12]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 14 (Navy) at (Center of Player12 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[12] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[13]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 15 (Turquoise) at (Center of Player13 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[13] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[14]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 16 (Violet) at (Center of Player14 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[14] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[15]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 17 (Wheat) at (Center of Player15 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[15] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[16]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 18 (Peach) at (Center of Player16 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[16] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[17]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 19 (Mint) at (Center of Player17 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[17] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[18]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 20 (Lavender) at (Center of Player18 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[18] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[19]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 21 (Coal) at (Center of Player19 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[19] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[20]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 22 (Snow) at (Center of Player20 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[20] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[21]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 23 (Emerald) at (Center of Player21 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[21] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Dying unit) Equal to PlayerUnitFree[22]
        • Then - Actions
          • Wait 6.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 24 (Peanut) at (Center of Player22 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[22] = (Last created unit)
          • Skip remaining actions
        • Else - Actions
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
Might I suggest some optimizations to make your life much easier. These triggers are overcomplicated and can be simplified to this:
  • Player Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- Note that not all Event Responses will work after a Wait! (Triggering unit) is safe though. --------
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to VSUnit[(Player number of (Triggering player))]
        • Then - Actions
          • Wait 5.00 game-time seconds
          • -------- --------
          • Set VariableSet Dying_Unit = (Triggering unit)
          • Set VariableSet Dying_Player = (Owner of Dying_Unit)
          • Set VariableSet Dying_PN = (Player number of Dying_Player)
          • -------- --------
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Dying_Player at Player_VS_Point[Dying_PN] facing Default building facing degrees
          • Set VariableSet VSUnit[Dying_PN] = (Last created unit)
          • -------- --------
          • -------- Team Numbers start at 0, with 0 being Team 1, 1 being Team 2, etc. (Teams are Forces) --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Team number of Dying_Player) Equal to 0
            • Then - Actions
              • Unit Group - Remove Dying_Unit from PointLostUnit[1].
              • Unit Group - Add VSUnit[Dying_PN] to PointLostUnit[1]
            • Else - Actions
              • Unit Group - Remove Dying_Unit from PointLostUnit[2].
              • Unit Group - Add VSUnit[Dying_PN] to PointLostUnit[2]
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to PlayerUnitFree[(Player number of (Triggering player))]
            • Then - Actions
              • Wait 6.00 game-time seconds
              • -------- --------
              • Set VariableSet Dying_Unit = (Triggering unit)
              • Set VariableSet Dying_Player = (Owner of Dying_Unit)
              • Set VariableSet Dying_PN = (Player number of Dying_Player)
              • -------- --------
              • Unit - Create 1 F[(Random integer number between 1 and 323)] for Dying_Player at Player_Free_Point[Dying_PN] facing Default building facing degrees
              • Set VariableSet PlayerUnitFree[Dying_PN] = (Last created unit)
            • Else - Actions
You would Set some of these Player_ variables beforehand:
  • Setup Variables
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Do this for each Player/Region! (I'm only doing Player 1 and 2 since it's an example) --------
      • Set VariableSet Player_Free_Point[1] = (Center of Player1 <gen>)
      • Set VariableSet Player_Free_Point[2] = (Center of Player2 <gen>)
      • Set VariableSet Player_VS_Point[1] = (Center of West1 <gen>)
      • Set VariableSet Player_VS_Point[2] = (Center of West2 <gen>)
This organization may very well fix the bug. Otherwise, I can look into it further.

Remember, Player Numbers can be used as an [Index] of your Arrays to store data directly to a Player. This gets rid of the need to check "Is this Player 1?" since the trigger doesn't need to know who it was, it just needs to reference the Arrays associated with the (Triggering player) - or rather associated with their Player Number. We can also rely on Team Numbers to further simplify things, assuming that your Teams are setup in a logical way. Note that in my first trigger I am assuming that your first two Teams are used by the Players.

Also, note that there's no need to set the Initial Size of your Array variables - the game will handle this for you automatically. The only exception to this rule is for Unit Groups, Player Groups, and Timers, since they won't work without being given an Initial Size. Or you can just manually create their "objects" but that's entering Custom Script/code territory.
 

Attachments

  • Dying Unit Example 1.w3m
    18.8 KB · Views: 5
Last edited:
Level 3
Joined
Oct 21, 2023
Messages
25
The script is written in a way I understand it more, I know it's beginner programming. I'm still very new to it, so yours a little complex to me lol. Could I add you so I can send you the map? It's an old one that I'm trying to modify.

I'm just trying to find what is causing the issue, I will set the number of players back to its original number, 5v5, so 10 players with 2 bots

First trigger is for Team Battle. Second is for FFA.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
The script is written in a way I understand it more, I know it's beginner programming. I'm still very new to it, so yours a little complex to me lol. Could I add you so I can send you the map? It's an old one that I'm trying to modify.

I'm just trying to find what is causing the issue, I will set the number of players back to its original number, 5v5, so 10 players with 2 bots

First trigger is for Team Battle. Second is for FFA.
The only reasons I can see as to why the triggers wouldn't work:

1) VSUnit[] is never initially set.
2) PlayerUnitFree[] is never initially set.
3) The F variable is not setup correctly.
4) The triggers are turned off or not running in the first place.

Using the Text Message action can help you debug the problem by displaying text messages in-game whenever key triggers run. This way you can visualize what's happening, "Setting VS Variables", "Setting PlayerUnitFree", "Running Unit Dies trigger", etc.

I should add a note regarding my previous post, if your Players are setup in a weird way like Player 1 (Red)'s created units are owned Player 2 (Blue) then my suggested method may not work right out of the box.

With that in mind, I recommend setting up your Player Properties so that the Users (non-cpus) use Player Slots starting at 1 and working your way up. So if your map was 12 Players with 2 CPUs, Players 1 through 6 would be on Team 1 and Players 7 through 12 would be on Team 2. The CPUs can then be set to Player 13/14. Or what I like to do is set the CPUs to the very last Player Slots so I have room to expand if I ever add more Players.

You can always change the Color/Name of a Player at ANY time using triggers, so if you're relying on specific Player Slots for that reason then don't! You're shooting yourself in the foot by doing this.
 
Last edited:
Level 3
Joined
Oct 21, 2023
Messages
25
Both VSUnit & PlayerUnitFree seem to have initial value. Triggers seems to be turned out too. How do I check if F is setup correctly?

Remember the issue happens randomly after 5-10m in pvp, seems like unit number is hitting a cap or something? Some people units just stop respawning, maybe 1 or 2.

Sorry if it is a long code.

  • FreeBattleSet
    • Events
    • Conditions
    • Actions
      • Quest - Display to (All players) the Quest Discovered message: (|cFF00FFFF + ((Name of Host) + select Free Mode|r))
      • Unit - Make Main Castle 0000 <gen> Invulnerable
      • Unit - Make Main Castle 0001 <gen> Invulnerable
      • Unit - Move Circle of Power 0006 <gen> instantly to (Center of Player1 <gen>)
      • Unit - Move Circle of Power 0007 <gen> instantly to (Center of Player2 <gen>)
      • Unit - Move Circle of Power 0008 <gen> instantly to (Center of Player3 <gen>)
      • Unit - Move Circle of Power 0005 <gen> instantly to (Center of Player4 <gen>)
      • Unit - Move Circle of Power 0004 <gen> instantly to (Center of Player5 <gen>)
      • Unit - Move Circle of Power 0013 <gen> instantly to (Center of Player6 <gen>)
      • Unit - Move Circle of Power 0012 <gen> instantly to (Center of Player7 <gen>)
      • Unit - Move Circle of Power 0011 <gen> instantly to (Center of Player8 <gen>)
      • Unit - Move Circle of Power 0010 <gen> instantly to (Center of Player9 <gen>)
      • Unit - Move Circle of Power 0009 <gen> instantly to (Center of Player10 <gen>)
      • Unit - Move Circle of Power 0038 <gen> instantly to (Center of Player11 <gen>)
      • Unit - Move Circle of Power 0039 <gen> instantly to (Center of Player12 <gen>)
      • Unit - Move Circle of Power 0040 <gen> instantly to (Center of Player13 <gen>)
      • Unit - Move Circle of Power 0041 <gen> instantly to (Center of Player14 <gen>)
      • Unit - Move Circle of Power 0042 <gen> instantly to (Center of Player15 <gen>)
      • Unit - Move Circle of Power 0043 <gen> instantly to (Center of Player16 <gen>)
      • Unit - Move Circle of Power 0044 <gen> instantly to (Center of Player17 <gen>)
      • Unit - Move Circle of Power 0045 <gen> instantly to (Center of Player18 <gen>)
      • Unit - Move Circle of Power 0046 <gen> instantly to (Center of Player19 <gen>)
      • Unit - Move Circle of Power 0049 <gen> instantly to (Center of Player20 <gen>)
      • Unit - Move Circle of Power 0048 <gen> instantly to (Center of Player21 <gen>)
      • Unit - Move Circle of Power 0047 <gen> instantly to (Center of Player22 <gen>)
      • Set VariableSet KillCount[1] = 0
      • Set VariableSet KillCount[2] = 0
      • Set VariableSet KillCount[3] = 0
      • Set VariableSet KillCount[4] = 0
      • Set VariableSet KillCount[5] = 0
      • Set VariableSet KillCount[6] = 0
      • Set VariableSet KillCount[7] = 0
      • Set VariableSet KillCount[8] = 0
      • Set VariableSet KillCount[9] = 0
      • Set VariableSet KillCount[10] = 0
      • Set VariableSet KillCount[11] = 0
      • Set VariableSet KillCount[12] = 0
      • Set VariableSet KillCount[13] = 0
      • Set VariableSet KillCount[14] = 0
      • Set VariableSet KillCount[15] = 0
      • Set VariableSet KillCount[16] = 0
      • Set VariableSet KillCount[17] = 0
      • Set VariableSet KillCount[18] = 0
      • Set VariableSet KillCount[19] = 0
      • Set VariableSet KillCount[20] = 0
      • Set VariableSet KillCount[21] = 0
      • Set VariableSet KillCount[22] = 0
      • Trigger - Turn on KillCheck <gen>
      • Trigger - Turn on KillCountplus <gen>
      • Trigger - Turn on PlayerUnitDie <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 2 (Blue) at (Center of Player1 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[1] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 2 (Blue) and do (Camera - Pan camera for Player 2 (Blue) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 (Teal) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 3 (Teal) at (Center of Player2 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[2] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 3 (Teal) and do (Camera - Pan camera for Player 3 (Teal) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 (Purple) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 4 (Purple) at (Center of Player3 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[3] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 4 (Purple) and do (Camera - Pan camera for Player 4 (Purple) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 (Yellow) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 5 (Yellow) at (Center of Player4 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[4] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 5 (Yellow) and do (Camera - Pan camera for Player 5 (Yellow) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 (Orange) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 6 (Orange) at (Center of Player5 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[5] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 6 (Orange) and do (Camera - Pan camera for Player 6 (Orange) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 8 (Pink) at (Center of Player6 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[6] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 8 (Pink) and do (Camera - Pan camera for Player 8 (Pink) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 9 (Gray) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 9 (Gray) at (Center of Player7 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[7] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 9 (Gray) and do (Camera - Pan camera for Player 9 (Gray) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 10 (Light Blue) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 10 (Light Blue) at (Center of Player8 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[8] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 10 (Light Blue) and do (Camera - Pan camera for Player 10 (Light Blue) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 11 (Dark Green) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 11 (Dark Green) at (Center of Player9 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[9] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 11 (Dark Green) and do (Camera - Pan camera for Player 11 (Dark Green) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 12 (Brown) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 12 (Brown) at (Center of Player10 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[10] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 12 (Brown) and do (Camera - Pan camera for Player 12 (Brown) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 13 (Maroon) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 13 (Maroon) at (Center of Player11 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[11] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 13 (Maroon) and do (Camera - Pan camera for Player 13 (Maroon) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 14 (Navy) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 14 (Navy) at (Center of Player12 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[12] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 14 (Navy) and do (Camera - Pan camera for Player 14 (Navy) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 15 (Turquoise) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 15 (Turquoise) at (Center of Player13 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[13] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 15 (Turquoise) and do (Camera - Pan camera for Player 15 (Turquoise) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 16 (Violet) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 16 (Violet) at (Center of Player14 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[14] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 16 (Violet) and do (Camera - Pan camera for Player 16 (Violet) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 17 (Wheat) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 17 (Wheat) at (Center of Player15 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[15] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 17 (Wheat) and do (Camera - Pan camera for Player 17 (Wheat) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 18 (Peach) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 18 (Peach) at (Center of Player16 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[16] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 18 (Peach) and do (Camera - Pan camera for Player 18 (Peach) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 19 (Mint) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 19 (Mint) at (Center of Player17 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[17] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 19 (Mint) and do (Camera - Pan camera for Player 19 (Mint) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 20 (Lavender) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 20 (Lavender) at (Center of Player18 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[18] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 20 (Lavender) and do (Camera - Pan camera for Player 20 (Lavender) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 21 (Coal) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 21 (Coal) at (Center of Player19 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[19] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 21 (Coal) and do (Camera - Pan camera for Player 21 (Coal) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 22 (Snow) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 22 (Snow) at (Center of Player20 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[20] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 22 (Snow) and do (Camera - Pan camera for Player 22 (Snow) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 23 (Emerald) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 23 (Emerald) at (Center of Player21 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[21] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 23 (Emerald) and do (Camera - Pan camera for Player 23 (Emerald) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 24 (Peanut) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 24 (Peanut) at (Center of Player22 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[22] = (Last created unit)
          • Player Group - Pick every player in Player Group - Player 24 (Peanut) and do (Camera - Pan camera for Player 24 (Peanut) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Pause (Picked unit))
      • Quest - Display to (All players) the Hint message: Game is about to st...
      • Wait 2.00 game-time seconds
      • Quest - Display to (All players) the Hint message: 2
      • Wait 2.00 game-time seconds
      • Quest - Display to (All players) the Hint message: 1
      • Wait 4.00 game-time seconds
      • Quest - Display to (All players) the Hint message: |c00FF0000Kill them...
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Unpause (Picked unit))
  • GameMode02
    • Events
      • Dialog - A dialog button is clicked for GameBoard
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Board_Button[1]
        • Then - Actions
          • Set VariableSet VersusLife[1] = 25
          • Set VariableSet VersusLife[2] = 25
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Board_Button[2]
        • Then - Actions
          • Set VariableSet VersusLife[1] = 50
          • Set VariableSet VersusLife[2] = 50
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Board_Button[3]
        • Then - Actions
          • Set VariableSet VersusLife[1] = 75
          • Set VariableSet VersusLife[2] = 75
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Board_Button[4]
        • Then - Actions
          • Set VariableSet VersusLife[1] = 100
          • Set VariableSet VersusLife[2] = 100
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Board_Button[5]
        • Then - Actions
          • Set VariableSet VersusLife[1] = 125
          • Set VariableSet VersusLife[2] = 125
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Board_Button[6]
        • Then - Actions
          • Set VariableSet VersusLife[1] = 150
          • Set VariableSet VersusLife[2] = 150
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Board_Button[7]
        • Then - Actions
          • Set VariableSet VersusLife[1] = 175
          • Set VariableSet VersusLife[2] = 175
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Board_Button[8]
        • Then - Actions
          • Set VariableSet VersusLife[1] = 200
          • Set VariableSet VersusLife[2] = 200
        • Else - Actions
      • Quest - Display to (All players) the Quest Discovered message: (|cFF00FFFF + ((Name of Host) + select PvP Mode.|r))
      • Quest - Display to (All players) the Quest Discovered message: (|cFF00FFFF + (Team Life: + (String(VersusLife[1]))))
      • Unit - Create 1 Fountain of Mana for Neutral Passive at (Center of west cp spawn <gen>) facing Default building facing degrees
      • Unit - Create 1 Fountain of Mana for Neutral Passive at (Center of east cp spawn <gen>) facing Default building facing degrees
      • Unit - Create 1 Hero Upgrade Shop for Neutral Passive at (Center of West Def <gen>) facing Default building facing degrees
      • Unit - Create 1 Hero Upgrade Shop for Neutral Passive at (Center of East Def <gen>) facing Default building facing degrees
      • Unit - Remove Main Castle 0000 <gen> from the game
      • Unit - Remove Main Castle 0001 <gen> from the game
      • Player Group - Pick every player in (All players) and do (Player - Turn Gives bounty On for (Picked player))
      • Trigger - Run OpenMiddle <gen> (ignoring conditions)
      • Unit - Make Main Castle 0000 <gen> Invulnerable
      • Unit - Make Main Castle 0001 <gen> Invulnerable
      • Trigger - Run PointBoard <gen> (ignoring conditions)
      • Trigger - Turn on PointLose <gen>
      • Trigger - Turn on VersusCheck <gen>
      • Trigger - Turn on IfPlayerUnitDie <gen>
      • Unit - Move Circle of Power 0006 <gen> instantly to (Center of VWest1 <gen>)
      • Unit - Move Circle of Power 0007 <gen> instantly to (Center of VWest2 <gen>)
      • Unit - Move Circle of Power 0008 <gen> instantly to (Center of VWest3 <gen>)
      • Unit - Move Circle of Power 0005 <gen> instantly to (Center of VWest4 <gen>)
      • Unit - Move Circle of Power 0004 <gen> instantly to (Center of VWest5 <gen>)
      • Unit - Move Circle of Power 0038 <gen> instantly to (Center of VWest6 <gen>)
      • Unit - Move Circle of Power 0039 <gen> instantly to (Center of VWest7 <gen>)
      • Unit - Move Circle of Power 0040 <gen> instantly to (Center of VWest8 <gen>)
      • Unit - Move Circle of Power 0041 <gen> instantly to (Center of VWest9 <gen>)
      • Unit - Move Circle of Power 0042 <gen> instantly to (Center of VWest10 <gen>)
      • Unit - Move Circle of Power 0043 <gen> instantly to (Center of VWest11 <gen>)
      • -------- ------------------------------------------------------------------------ --------
      • Unit - Move Circle of Power 0013 <gen> instantly to (Center of VEast1 <gen>)
      • Unit - Move Circle of Power 0012 <gen> instantly to (Center of VEast2 <gen>)
      • Unit - Move Circle of Power 0011 <gen> instantly to (Center of VEast3 <gen>)
      • Unit - Move Circle of Power 0010 <gen> instantly to (Center of VEast4 <gen>)
      • Unit - Move Circle of Power 0009 <gen> instantly to (Center of VEast5 <gen>)
      • Unit - Move Circle of Power 0044 <gen> instantly to (Center of VEast6 <gen>)
      • Unit - Move Circle of Power 0045 <gen> instantly to (Center of VEast7 <gen>)
      • Unit - Move Circle of Power 0046 <gen> instantly to (Center of VEast8 <gen>)
      • Unit - Move Circle of Power 0049 <gen> instantly to (Center of VEast9 <gen>)
      • Unit - Move Circle of Power 0048 <gen> instantly to (Center of VEast10 <gen>)
      • Unit - Move Circle of Power 0047 <gen> instantly to (Center of VEast11 <gen>)
      • -------- ----------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 2 (Blue) at (Center of VWest1 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[1] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 2 (Blue) and do (Camera - Pan camera for Player 2 (Blue) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 (Teal) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 3 (Teal) at (Center of VWest2 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[2] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 3 (Teal) and do (Camera - Pan camera for Player 3 (Teal) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 4 (Purple) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 4 (Purple) at (Center of VWest3 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[3] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 4 (Purple) and do (Camera - Pan camera for Player 4 (Purple) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 5 (Yellow) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 5 (Yellow) at (Center of VWest4 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[4] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 5 (Yellow) and do (Camera - Pan camera for Player 5 (Yellow) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 6 (Orange) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 6 (Orange) at (Center of VWest5 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[5] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 6 (Orange) and do (Camera - Pan camera for Player 6 (Orange) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 13 (Maroon) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 13 (Maroon) at (Center of VWest6 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[11] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 13 (Maroon) and do (Camera - Pan camera for Player 13 (Maroon) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 14 (Navy) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 14 (Navy) at (Center of VWest7 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[12] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 14 (Navy) and do (Camera - Pan camera for Player 14 (Navy) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 15 (Turquoise) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 15 (Turquoise) at (Center of VWest8 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[13] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 15 (Turquoise) and do (Camera - Pan camera for Player 15 (Turquoise) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 16 (Violet) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 16 (Violet) at (Center of VWest9 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[14] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 16 (Violet) and do (Camera - Pan camera for Player 16 (Violet) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 17 (Wheat) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 17 (Wheat) at (Center of VWest10 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[15] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 17 (Wheat) and do (Camera - Pan camera for Player 17 (Wheat) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 18 (Peach) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 18 (Peach) at (Center of VWest11 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[16] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[1]
          • Player Group - Pick every player in Player Group - Player 18 (Peach) and do (Camera - Pan camera for Player 18 (Peach) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • -------- ----------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 8 (Pink) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 8 (Pink) at (Center of VEast1 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[6] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 8 (Pink) and do (Camera - Pan camera for Player 8 (Pink) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 9 (Gray) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 9 (Gray) at (Center of VEast2 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[7] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 9 (Gray) and do (Camera - Pan camera for Player 9 (Gray) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 10 (Light Blue) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 10 (Light Blue) at (Center of VEast3 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[8] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 10 (Light Blue) and do (Camera - Pan camera for Player 10 (Light Blue) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 11 (Dark Green) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 11 (Dark Green) at (Center of VEast4 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[9] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 11 (Dark Green) and do (Camera - Pan camera for Player 11 (Dark Green) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 12 (Brown) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 12 (Brown) at (Center of VEast5 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[10] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 12 (Brown) and do (Camera - Pan camera for Player 12 (Brown) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 19 (Mint) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 19 (Mint) at (Center of VEast6 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[17] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 19 (Mint) and do (Camera - Pan camera for Player 19 (Mint) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 20 (Lavender) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 20 (Lavender) at (Center of VEast7 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[18] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 20 (Lavender) and do (Camera - Pan camera for Player 20 (Lavender) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 21 (Coal) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 21 (Coal) at (Center of VEast8 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[19] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 21 (Coal) and do (Camera - Pan camera for Player 21 (Coal) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 22 (Snow) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 22 (Snow) at (Center of VEast9 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[20] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 22 (Snow) and do (Camera - Pan camera for Player 22 (Snow) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 23 (Emerald) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 23 (Emerald) at (Center of VEast10 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[21] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 23 (Emerald) and do (Camera - Pan camera for Player 23 (Emerald) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 24 (Peanut) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 24 (Peanut) at (Center of VEast11 <gen>) facing Default building facing degrees
          • Set VariableSet VSUnit[22] = (Last created unit)
          • Unit Group - Add (Last created unit) to PointLostUnit[2]
          • Player Group - Pick every player in Player Group - Player 24 (Peanut) and do (Camera - Pan camera for Player 24 (Peanut) to (Position of (Last created unit)) over 0.50 seconds)
        • Else - Actions
 
Last edited:
Level 19
Joined
Feb 27, 2019
Messages
590
I got some possible errors I can imagine.

Some value between 1 and 323 is uninitiated so no unit is created.
The unit does not die. Examples of a unit not dying is being Removed from the game or the ability Charm.
The spawned unit is invisible and does not attack.
 
Level 3
Joined
Oct 21, 2023
Messages
25
I got some possible errors I can imagine.

Some value between 1 and 323 is uninitiated so no unit is created.
The unit does not die. Examples of a unit not dying is being Removed from the game or the ability Charm.
The spawned unit is invisible and does not attack.
  • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 2 (Blue) at (Center of Player1 <gen>) facing Default building facing degrees.
Dosnt (Random integer number between 1 and 323) fix the issue of initializing F? If not, would I fix it by just adding setvariable F= 323? It's set to 500 in variable.


  • (Dying unit) Equal to PlayerUnitFree[1]
Dosnt that solve the issue of verifying if a unit is truely dead? If not, how would I solve it, with a triggering-unit condition?
For example, check player's number of units, if 0 then respawn?

I think it's the unit dying the issue, or maybe units die too fast in succession?
 
Last edited:
Level 19
Joined
Feb 27, 2019
Messages
590
Dosnt (Random integer number between 1 and 323) fix the issue of initializing F? If not, would I fix it by just adding setvariable F= 323? It's set to 500 in variable.
What I meant was that you probably have another trigger with 323 actions that are "set F[number] = unit-type". The possible problem I imagined was that you had previously set all these 323 variables then removed a unit-type in the object editor causing the initiation of that unit-type to be no unit. Creating no unit would mess things up since the trigger requires that a unit is created. Debug options: Make a loop that checks every unit-type between F[1] and F[323] and make sure it doesnt return true for no unit-type or check it manually.
Dosnt that solve the issue of verifying if a unit is truely dead? If not, how would I solve it, with a triggering-unit condition?
For example, check player's number of units, if 0 then respawn?
That particular event response in that condition is not an issue since it occurs instantly. Some event responses cant be used after an amount of time has passed.
I think it's the unit dying the issue, or maybe units die too fast in succession?
Without further explanation its impossible for the units to die too fast. But if there is no unit dying there will be no event.
 
Level 3
Joined
Oct 21, 2023
Messages
25
What I meant was that you probably have another trigger with 323 actions that are "set F[number] = unit-type". The possible problem I imagined was that you had previously set all these 323 variables then removed a unit-type in the object editor causing the initiation of that unit-type to be no unit. Creating no unit would mess things up since the trigger requires that a unit is created. Debug options: Make a loop that checks every unit-type between F[1] and F[323] and make sure it doesnt return true for no unit-type or check it manually.

That particular event response in that condition is not an issue since it occurs instantly. Some event responses cant be used after an amount of time has passed.

Without further explanation its impossible for the units to die too fast. But if there is no unit dying there will be no event.

I think the issue comes from units dying. Since the issue always happens when a unit dies. Could you please show me an example of a triggering unit rather than using Dying Unit.

I uploaded the map, if you want to check the triggers. FreeBattle>PlayerUnitDie & PvP>IfPlayerUnitDie are the triggers that may be the one causing issues.
 

Attachments

  • Random Unit Game VTEST.w3x
    9.7 MB · Views: 3
Last edited:
Level 19
Joined
Feb 27, 2019
Messages
590
Haha random unit game. I made the first random unit. The reason all units are level 1 is because I didnt know how to make a randomized function to create a truly randomized unit between level 1 and 10 but understood that creating a unit of level random value between 1 and 10 would cause an imbalance since there are more level 1 units than level 10 units. It took about 10 seconds to change each unit to level 1 because of the lag caused by the brush list. It only contained the original wc3 units and I very much agree that the next versions were better for introducing some more goofy and fun units but I would have appreciated if they credited me, at least Sage and Dinah credited me which I wont forget and am very appreciative of.

I found the problem and I will give you a pass because you posted good information, you made me think of my old map and since you seem to be a new map creator but the information given to you already is enough to solve your problem. Make a double check on what I mentioned before.
 
Level 3
Joined
Oct 21, 2023
Messages
25
Haha random unit game. I made the first random unit. The reason all units are level 1 is because I didnt know how to make a randomized function to create a truly randomized unit between level 1 and 10 but understood that creating a unit of level random value between 1 and 10 would cause an imbalance since there are more level 1 units than level 10 units. It took about 10 seconds to change each unit to level 1 because of the lag caused by the brush list. It only contained the original wc3 units and I very much agree that the next versions were better for introducing some more goofy and fun units but I would have appreciated if they credited me, at least Sage and Dinah credited me which I wont forget and am very appreciative of.

I found the problem and I will give you a pass because you posted good information, you made me think of my old map and since you seem to be a new map creator but the information given to you already is enough to solve your problem. Make a double check on what I mentioned before.
Did you actually work on the Random Unit Game map? If you did, I can add you to credits.

I got the version 4.4 off someone just to add more units, made like 30, but noticed the map was bugged. So I'm learning Triggers to fix it, so people can actually enjoy PvP and FFA.


I'm very new to map making and I did not make the triggers I posted but I understand what they do. Now I'm learning. Later when I get more knowledge, I will add random item drops for FFA.


1. So F is the issue? Theres 2 instances, game mode start and unit respawn. When game mode start, set a F variable to 323 for each player? If so, how do I do that, still new to triggers.

2. Is it the timer? Stopping units from respawning. Like unit is gone while waiting, right?

3. I replaced:

  • (Dying unit) Equal to PlayerUnitFree[1]
With:
  • (Triggering unit) Equal to PlayerUnitFree[1]
That's ok? It did not fix the issue, but I heard it's better overall.

4.
Would this work? Also making a separate trigger for every player.

  • PlayerUnitDie Player 2
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to PlayerUnitFree[1]
        • Then - Actions
          • Wait 3.00 game-time seconds
          • Unit - Remove (Triggering unit) from the game
          • Wait 3.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 2 (Blue) at (Center of Player1 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[1] = (Last created unit)
        • Else - Actions
 
Last edited:
Level 3
Joined
Oct 21, 2023
Messages
25
I tried the trigger in previous post, made it for every player. Still didn't work. I'm stuck, I got no more ideas to test and need help.
 
Level 19
Joined
Feb 27, 2019
Messages
590
Did you actually work on the Random Unit Game map? If you did, I can add you to credits.
I made random unit game long ago, must have been before 2007 or smt. I made another version a few years ago but it has an interval bug and I kinda abandoned the that map. No need to add me to credits and that map doesnt seem to come from that old one anyway.

3. I replaced:

  • (Dying unit) Equal to PlayerUnitFree[1]
With:
  • (Triggering unit) Equal to PlayerUnitFree[1]
That's ok? It did not fix the issue, but I heard it's better overall.
Its the same in that case. There are some event responses that behave differently as mentioned in the link I posted.

Two variables are skipped over in Unit Type. F[99] and F[100] doesnt get a unit type.
  • Set VariableSet F[98] = Spirit of Vengeance
  • Set VariableSet F[101] = Nerubian Spider Lord
 
Level 3
Joined
Oct 21, 2023
Messages
25
Thank you so much, such a stupid mistake.

Thanks to this issue I rewrote triggers for every player. Is it fine that I made separate triggers for them?

Made this x22 for FFA and PvP
  • PlayerUnitDie Player 2
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to PlayerUnitFree[1]
        • Then - Actions
          • Wait 3.00 game-time seconds
          • Unit - Remove (Triggering unit) from the game
          • Wait 3.00 game-time seconds
          • Unit - Create 1 F[(Random integer number between 1 and 323)] for Player 2 (Blue) at (Center of Player1 <gen>) facing Default building facing degrees
          • Set VariableSet PlayerUnitFree[1] = (Last created unit)
        • Else - Actions
Also is there a guide on randomly spawning items?
 
Last edited:
Top