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

[Trigger] Unit group

Status
Not open for further replies.
Hey everyone :D

Here is a trigger that spawns units of 3 different categories around the map.

  • Spawn
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in gNatural[1]) Less than 20
        • Then - Actions
          • Set Temp_Point = (pCenter offset by (Random real number between 600.00 and (Random real number between 4000.00 and 6000.00)) towards (Random real number between 0.00 and 360.00) degrees)
          • Unit - Create 1 uNatural[(Random integer number between 1 and 9)] for Neutral Passive at Temp_Point facing (Random real number between 0.00 and 360.00) degrees
          • Unit Group - Add (Last created unit) to gNatural[1]
          • Custom script: call RemoveLocation(udg_Temp_Point)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in gNatural[2]) Less than 20
        • Then - Actions
          • Set Temp_Point = (pCenter offset by (Random real number between 600.00 and (Random real number between 4000.00 and 6000.00)) towards (Random real number between 0.00 and 360.00) degrees)
          • Unit - Create 1 uNatural[(Random integer number between 50 and 58)] for Neutral Passive at Temp_Point facing (Random real number between 0.00 and 360.00) degrees
          • Unit Group - Add (Last created unit) to gNatural[2]
          • Custom script: call RemoveLocation(udg_Temp_Point)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in gNatural[3]) Less than 10
        • Then - Actions
          • Set Temp_Point = (pCenter offset by (Random real number between 600.00 and (Random real number between 4000.00 and 6000.00)) towards (Random real number between 0.00 and 360.00) degrees)
          • Unit - Create 1 uNatural[(Random integer number between 100 and 114)] for Neutral Passive at Temp_Point facing (Random real number between 0.00 and 360.00) degrees
          • Unit Group - Add (Last created unit) to gNatural[3]
          • Custom script: call RemoveLocation(udg_Temp_Point)
        • Else - Actions
      • Game - Display to (All players) the text: (String((Number of units in gNatural[2])))
I basicly repeated the same algorythem 3 times, but for the last 2 the units isn't added to the group. In other words, the unit keeps spawning but group[2] and [3] stays emty. Can someone explain why?

Thanks ^^
 
Status
Not open for further replies.
Top