• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

multiple creep spawn system

Status
Not open for further replies.
Level 4
Joined
Jun 14, 2008
Messages
72
today i made the multiple creep spawn system falloing the tutorial i dont know if i made an error on the way or what but it didnt work...so i was wondering if theres a place in have where i could just import it...
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
well you can "implent" a trigger in a post by using [.trigger]"Copy as text" your trigger and then paste it here[/.trigger]
Note that the dots (.) should not include in the trigger tags.
 
Level 4
Joined
Jun 14, 2008
Messages
72
ok then....


test
Events
Conditions
Actions
Game - Display to (All players) the text: Countdown Started
Countdown Timer - Start Roundwindow as a Repeating timer that will expire in 60.00 seconds
Set Roundwindow = (Last started timer)
Countdown Timer - Create a timer window for (Last started timer) with title Enemy Wave In...





next trigger.....

timer expires
Events
Map initialization
Conditions
Actions
Set lvl_num = 0
Set lvl_num = 1
Set unit_type[1] = Soldier
Set unit_type_var_2[1] = Giant
Set Unit_type_var_3[1] = Bomb Straper
Set Unit_amount[1] = 3
Set Unit_Amount_var_2[1] = 1
Set Unit_Amount_Var_3[1] = 1
Set lvl_num = 2
Set unit_type[2] = Soldier
Set Unit_type_var_3[2] = Bomb Straper
Set unit_type_var_2[2] = Giant
Set Unit_amount[2] = 2
Set Unit_Amount_var_2[2] = 1
Set Unit_Amount_Var_3[2] = 3
Set lvl_num = 3
Set unit_type[3] = Soldier
Set unit_type_var_2[3] = Giant
Set Unit_type_var_3[3] = Bomb Straper
Set Unit_amount[3] = 2
Set Unit_Amount_var_2[3] = 4
Set Unit_Amount_Var_3[3] = 4





next trigger.........

spawn
Events
Map initialization
Conditions
Actions
Set location_var[1] = (Random point in Region 002 <gen>)
Set location_var[2] = (Random point in Region 002 <gen>)
Set location_var[3] = (Random point in Region 002 <gen>)
Set location_var[4] = (Random point in Region 002 <gen>)
Set location_var[5] = (Random point in Region 002 <gen>)
Set location_var[6] = (Random point in Region 002 <gen>)
Set location_var[7] = (Random point in Region 002 <gen>)
Set location_var[8] = (Random point in Region 002 <gen>)


and the last trigger.....

Untitled Trigger 004
Events
Time - Roundwindow expires
Conditions
Actions
Set lvl_num = (lvl_num + 1)
For each (Integer A) from 1 to Unit_amount[lvl_num], do (Actions)
Loop - Actions
Set incrementx = 1
Set incrementy = 1
For each (Integer B) from 1 to 4, do (Actions)
Loop - Actions
Unit - Create 1 unit_type[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
Unit - Create 1 unit_type[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
Set incrementx = (incrementx + 1)
Set incrementy = (incrementy + 2)
Wait 0.75 seconds
For each (Integer A) from 1 to Unit_Amount_Var_3[lvl_num], do (Actions)
Loop - Actions
Set incrementx = 1
Set incrementy = 1
For each (Integer B) from 1 to 4, do (Actions)
Loop - Actions
Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
Set incrementx = (incrementx + 1)
Set incrementy = (incrementy + 2)
Wait 0.75 seconds
For each (Integer A) from 1 to Unit_Amount_Var_3[lvl_num], do (Actions)
Loop - Actions
Set incrementx = 1
Set incrementy = 1
For each (Integer B) from 1 to 4, do (Actions)
Loop - Actions
Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
Set incrementx = (incrementx + 1)
Set incrementy = (incrementy + 2)
Wait 0.75 seconds
For each (Integer A) from 1 to Unit_Amount_var_2[lvl_num], do (Actions)
Loop - Actions
Set incrementx = 1
Set incrementy = 1
For each (Integer B) from 1 to 4, do (Actions)
Loop - Actions
Unit - Create 1 unit_type_var_2[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
Unit - Create 1 unit_type_var_2[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
Set incrementx = (incrementx + 1)
Set incrementy = 1





i hope i did it right....
 
Level 4
Joined
Jun 14, 2008
Messages
72
so like this?



  • Untitled Trigger 004
    • Events
      • Time - Roundwindow expires
    • Conditions
    • Actions
      • Set lvl_num = (lvl_num + 1)
      • For each (Integer A) from 1 to Unit_amount[lvl_num], do (Actions)
        • Loop - Actions
          • Set incrementx = 1
          • Set incrementy = 1
          • For each (Integer B) from 1 to 4, do (Actions)
            • Loop - Actions
              • Unit - Create 1 unit_type[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
              • Unit - Create 1 unit_type[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
              • Set incrementx = (incrementx + 1)
              • Set incrementy = (incrementy + 2)
              • Wait 0.75 seconds
              • For each (Integer A) from 1 to Unit_Amount_Var_3[lvl_num], do (Actions)
                • Loop - Actions
                  • Set incrementx = 1
                  • Set incrementy = 1
                  • For each (Integer B) from 1 to 4, do (Actions)
                    • Loop - Actions
                      • Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
                      • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                      • Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
                      • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                      • Set incrementx = (incrementx + 1)
                      • Set incrementy = (incrementy + 2)
                      • Wait 0.75 seconds
                      • For each (Integer A) from 1 to Unit_Amount_Var_3[lvl_num], do (Actions)
                        • Loop - Actions
                          • Set incrementx = 1
                          • Set incrementy = 1
                          • For each (Integer B) from 1 to 4, do (Actions)
                            • Loop - Actions
                              • Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
                              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                              • Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
                              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                              • Set incrementx = (incrementx + 1)
                              • Set incrementy = (incrementy + 2)
                              • Wait 0.75 seconds
                              • For each (Integer A) from 1 to Unit_Amount_var_2[lvl_num], do (Actions)
                                • Loop - Actions
                                  • Set incrementx = 1
                                  • Set incrementy = 1
                                  • For each (Integer B) from 1 to 4, do (Actions)
                                    • Loop - Actions
                                      • Unit - Create 1 unit_type_var_2[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
                                      • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                                      • Unit - Create 1 unit_type_var_2[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
                                      • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                                      • Set incrementx = (incrementx + 1)
                                      • Set incrementy = 1





im sorry i dont get it....
 
Level 4
Joined
Jun 14, 2008
Messages
72
oh wow...ok heres my trigger




  • test
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Countdown Started
      • Countdown Timer - Start Roundwindow as a Repeating timer that will expire in 60.00 seconds
      • Set Roundwindow = (Last started timer)
      • Countdown Timer - Create a timer window for (Last started timer) with title Enemy Wave In...





then.....

  • timer expires
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set lvl_num = 0
      • Set lvl_num = 1
      • Set unit_type[1] = Soldier
      • Set unit_type_var_2[1] = Giant
      • Set Unit_type_var_3[1] = Bomb Straper
      • Set Unit_amount[1] = 3
      • Set Unit_Amount_var_2[1] = 1
      • Set Unit_Amount_Var_3[1] = 1
      • Set lvl_num = 2
      • Set unit_type[2] = Soldier
      • Set Unit_type_var_3[2] = Bomb Straper
      • Set unit_type_var_2[2] = Giant
      • Set Unit_amount[2] = 2
      • Set Unit_Amount_var_2[2] = 1
      • Set Unit_Amount_Var_3[2] = 3
      • Set lvl_num = 3
      • Set unit_type[3] = Soldier
      • Set unit_type_var_2[3] = Giant
      • Set Unit_type_var_3[3] = Bomb Straper
      • Set Unit_amount[3] = 2
      • Set Unit_Amount_var_2[3] = 4
      • Set Unit_Amount_Var_3[3] = 4




then....

  • spawn
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set location_var[1] = (Random point in Region 002 <gen>)
      • Set location_var[2] = (Random point in Region 002 <gen>)
      • Set location_var[3] = (Random point in Region 002 <gen>)
      • Set location_var[4] = (Random point in Region 002 <gen>)
      • Set location_var[5] = (Random point in Region 002 <gen>)
      • Set location_var[6] = (Random point in Region 002 <gen>)
      • Set location_var[7] = (Random point in Region 002 <gen>)
      • Set location_var[8] = (Random point in Region 002 <gen>)


and finaly....


  • Untitled Trigger 004
    • Events
      • Time - Roundwindow expires
    • Conditions
    • Actions
      • Set lvl_num = (lvl_num + 1)
      • For each (Integer A) from 1 to Unit_amount[lvl_num], do (Actions)
        • Loop - Actions
          • Set incrementx = 1
          • Set incrementy = 1
          • For each (Integer B) from 1 to 4, do (Actions)
            • Loop - Actions
              • Unit - Create 1 unit_type[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
              • Unit - Create 1 unit_type[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
              • Set incrementx = (incrementx + 1)
              • Set incrementy = (incrementy + 2)
              • Wait 0.75 seconds
              • For each (Integer A) from 1 to Unit_Amount_Var_3[lvl_num], do (Actions)
                • Loop - Actions
                  • Set incrementx = 1
                  • Set incrementy = 1
                  • For each (Integer B) from 1 to 4, do (Actions)
                    • Loop - Actions
                      • Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
                      • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                      • Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
                      • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                      • Set incrementx = (incrementx + 1)
                      • Set incrementy = (incrementy + 2)
                      • Wait 0.75 seconds
                      • For each (Integer A) from 1 to Unit_Amount_Var_3[lvl_num], do (Actions)
                        • Loop - Actions
                          • Set incrementx = 1
                          • Set incrementy = 1
                          • For each (Integer B) from 1 to 4, do (Actions)
                            • Loop - Actions
                              • Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
                              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                              • Unit - Create 1 Unit_type_var_3[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
                              • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                              • Set incrementx = (incrementx + 1)
                              • Set incrementy = (incrementy + 2)
                              • Wait 0.75 seconds
                              • For each (Integer A) from 1 to Unit_Amount_var_2[lvl_num], do (Actions)
                                • Loop - Actions
                                  • Set incrementx = 1
                                  • Set incrementy = 1
                                  • For each (Integer B) from 1 to 4, do (Actions)
                                    • Loop - Actions
                                      • Unit - Create 1 unit_type_var_2[lvl_num] for Player 12 (Brown) at location_var[incrementy] facing Default building facing degrees
                                      • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                                      • Unit - Create 1 unit_type_var_2[lvl_num] for Player 12 (Brown) at location_var[(incrementy + 1)] facing Default building facing degrees
                                      • Unit - Order (Last created unit) to Attack-Move To (Center of (Playable map area))
                                      • Set incrementx = (incrementx + 1)
                                      • Set incrementy = 1
 
Last edited:
Level 23
Joined
Nov 29, 2006
Messages
2,482
Well, I belive it is because first you are using an Integer A loop... And then uses an integer B loop... And then uses an integer B again!... And then Integer A again, and again!

You cant do that. It will overwrite the first created loops of the Integer A and B.
You can fix that by using "For each variable "integer_variable" ..." note that you can use the multiply times either in your way above...
Also, using waits within loops is considered bad. I don't exactly what you are trying to do with all those loops.
 
Level 4
Joined
Jun 14, 2008
Messages
72
i was just fallowing the tutorial......it had the A/B thing 3 times......its supose to make 3 diffrent kinds of creeps apear in a selected area there supose to come in waves....
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
man dude... that is not the same thing you ahve been doing.

The problem with your trigger is, that you create the loops inside a loop, and then inside, and then inside......

create the loops after each other not in each other. Also do the same with the waits...

The code should basically be constructed in the following way:

-Loop1A
---Loop1B
---Wait
-Loop2A
---Loop2B
---Wait
-Loop3A
---Loop3B
---wait
 
Status
Not open for further replies.
Top