• 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.

[Trigger] Creep round starts after the last one dies

Status
Not open for further replies.
Level 9
Joined
Jan 23, 2008
Messages
384
Hi !
As the title says i want to make the creeps come after i killed the creeps in the last round .
lets say that at 60 seconds of game 4 creeps go from corners to middle ... there they fight me ... after i kill them i have a 60 second time to heal myself ... after the 60 seconds pass another 4 creeps ( different from the first ones ) come ...
Really need help ... hope for a reply !
Ty !
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
Hehe it is pretty simple.Perhaps set all the regions to an array
Spawn[1] = Region1
Spawn[2] = Region2
And etc...
And create an variable for unit types with arrays
UnitType[1] = Peon
UnitType[2] = Grunt
And etc...
Create an integer variable name it "value"without array to increase the array value of the UnitType array.
Make an trigger for all these variables so the below trigger can work. Important! If you do not include the value in the trigger you will have to wait 120 seconds till the units to arrive.
The code should look like this:
  • I wanna create creepy creeps
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 UnitType[Value] for Player 1 (Red) at (Center of Spawn[1]) facing Default building facing degrees
      • Unit - Create 1 UnitType[Value] for Player 1 (Red) at (Center of Spawn[2]) facing Default building facing degrees
      • Unit - Create 1 UnitType[Value] for Player 1 (Red) at (Center of Spawn[3]) facing Default building facing degrees
      • Unit - Create 1 UnitType[Value] for Player 1 (Red) at (Center of Spawn[4]) facing Default building facing degrees
      • Set Value = (Value + 1)
 
Level 22
Joined
Feb 26, 2008
Messages
892
Try making a trigger that has this event.

  • Player - Player 12 (Brown)'s Food used becomes Less than or equal to 0.00
Change Player 12 to the player that owns the creeps. Then give all your creeps at least one food used and make sure that player doesn't have any other food-producing units on the map, or it will not work.
Then add some start timer event to that trigger.

If it would help, you can look at a TD I've been working on. I have this kind of system all set up.
 

Attachments

  • March of the Demons TD.w3x
    51.1 KB · Views: 81
Level 19
Joined
Sep 4, 2007
Messages
2,826
Arrays work like this:
I create a integer variable named "Value" and add like 2 arrays to it.
Now it has like 3 layers(0 counts)
Value[0]
Value[1]
Value[2]
As you see I've created 3 layers.
It works exacly like a cake. You can add additional layers like chocolate, cream etc.
Each layer can hold any data you want(depending on what kind of variable it is)
If you don't understand check this:
http://www.hiveworkshop.com/forums/showthread.php?t=17789 for help with arrays. :D
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
The first trigger should look like this:
  • Variables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set UnitType[1] = Peasant
      • Set UnitType[2] = Footman
      • Set UnitType[3] = Knight
      • Set UnitType[4] = Rifleman
      • Set Spawn[1] = Region 000 <gen>
      • Set Spawn[2] = Region 001 <gen>
      • Set Spawn[3] = Region 002 <gen>
      • Set Spawn[4] = Region 003 <gen>
      • Set Value = 1
Here is the second trigger reposting.
  • I wanna create creepy creeps
    • Events
      • Time - Every 60.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 UnitType[Value] for Player 1 (Red) at (Center of Spawn[1]) facing Default building facing degrees
      • Unit - Create 1 UnitType[Value] for Player 1 (Red) at (Center of Spawn[2]) facing Default building facing degrees
      • Unit - Create 1 UnitType[Value] for Player 1 (Red) at (Center of Spawn[3]) facing Default building facing degrees
      • Unit - Create 1 UnitType[Value] for Player 1 (Red) at (Center of Spawn[4]) facing Default building facing degrees
      • Set Value = (Value + 1)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
redmarine, that wouldn't work like what he wanted.

You need to create a trigger with Ghan_04's event (computer's food becomes zero), this will lunch a timer, when that timer expires (this is the event of the second trigger), you check what level you are on and create creeps.
 
Level 4
Joined
Dec 16, 2007
Messages
134
Create another trigger that is initially off and the event is Time elapsed.
  • Untitled Trigger 013
    • Events
      • Time - Elapsed game time is 60.00 seconds
    • Conditions
    • Actions
Create also a trigger that will turn on the Trigger above.
  • Untitled Trigger 014
    • Events
    • Conditions
    • Actions
      • Trigger - Turn on Untitled Trigger 013 <gen>
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Like... no ?

  • Untitled Trigger 001
    • Events
      • Player - Player 12 (Brown)'s Food used becomes Equal to 0.00
    • Conditions
    • Actions
      • Countdown Timer - Start Timer as a One-shot timer that will expire in 60.00 seconds
  • Untitled Trigger 002
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
  • Variables
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set UnitType[1] = Peasant
      • Set UnitType[2] = Footman
      • Set UnitType[3] = Knight
      • Set UnitType[4] = Rifleman
      • Set Spawn[1] = Region 000 <gen>
      • Set Spawn[2] = Region 001 <gen>
      • Set Spawn[3] = Region 002 <gen>
      • Set Spawn[4] = Region 003 <gen>
      • Set Value = 1
  • Omg! The creeps are dead!
    • Events
      • Player - Player 12 (Brown)'s Food used becomes Equal to 0.00
    • Conditions
    • Actions
      • Countdown Timer - Start Timer as a One-shot timer that will expire in 60.00 seconds
  • I wanna create creepy creeps
    • Events
      • Time - Timer expires
    • Conditions
    • Actions
      • Unit - Create 1 UnitType[Value] for Player 12 (Brown) at (Center of Spawn[1]) facing Default building facing degrees
      • Unit - Create 1 UnitType[Value] for Player 12 (Brown) at (Center of Spawn[2]) facing Default building facing degrees
      • Unit - Create 1 UnitType[Value] for Player 12 (Brown) at (Center of Spawn[3]) facing Default building facing degrees
      • Unit - Create 1 UnitType[Value] for Player 12 (Brown) at (Center of Spawn[4]) facing Default building facing degrees
      • Set Value = (Value + 1)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Actions
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • For each (Integer B) from 1 to 10, do (Actions)
          • Loop - Actions
            • Unit - Create 1 Footman for Player 12 (Brown) at Point[(Integer A)] facing Default building facing degrees
            • Unit - Order (Last created unit) to Pwn_Everyone To (Center of (Playable map area))

The first loop is for the players (set it from 1 to max number of players or something like that) and the second is for the spawning.
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
You could create an integer variable and make it so every round you accomplish the value of the integer increases with 1. If the value is 10 at the end of the 10th round then you'll just add a victory action for all players.
 
Level 12
Joined
Aug 20, 2007
Messages
866
Hm

I suppose you could do what redmarine's talking about, or just the victorious action thing at the end of the 10th round, I don't know, it would depend on how you triggered your rounds

It sounds to me like you would want to try redmarines methods, so use the round thing (I think his is very good too, because you can trigger in any number of rounds + unit-types)

But you should both look into For loops (For each integer A 1 to 10)
And, the timers are a bit tricky, but you wanna learn those too
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
The thing is that you can use the integer to so much.
If you put
Round = Round + 1
Create 10 UnitType[Round] at regions
This could repeat itself everytime you are done with a round.
The fun thing is that you can use like 2-3 triggers to create the whole spawning stuff.
 
Level 12
Joined
Aug 20, 2007
Messages
866
Uhhh

I'm not sure...

Was the question mentioned at the beginning of the thread answered?
 
Level 7
Joined
Dec 8, 2005
Messages
319
another way that you dont have to deal with food and also i like it alittle better because i am not sure but inbetween rounds... the food level is zero and not sure if that will bug or not bu this is another way to check for the units all gone

  • Test
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Triggering unit)) controller) Equal to Computer
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in (Playable map area) owned by Neutral Hostile)) Equal to 0
        • Then - Actions
          • Countdown Timer - Start TIMER as a Repeating timer that will expire in 30.00 seconds
        • Else - Actions
  • [/hidden]
 
Level 12
Joined
Aug 20, 2007
Messages
866
That way would leak a unit group, and the timer should be one-shot, I'm not even sure that'll work, because the although the unit is dead, until it is removed (decays) it still gets picked up by the enumerator (the thing that sets all the units into the unit group)

The way to fix it up, is to have a global variable (or just a regular variable) that is a unit group, and whenever a unit enters the entire map, it gets added to the global group (as well as setting it to all of the current units at initialization), also make an if/then/condition so it only puts the units that are kill-able into the group

Next, in your unit dies trigger, simply add in Remove Triggering Unit from (thenameofyourunitgroupvariable) above the if/then to start the timer
 
Level 12
Joined
Aug 20, 2007
Messages
866
Heh, sorry bout that, was lookin at some older posts there, all you need to do, is first set a group variable to all the units in the region

Next, go to For each unit in <yourgroupvariablehere> do multiple actions

In the loop, do Order "Picked Unit" to wherever you want them to go, this will order all of them at once, although that will leak both a group and 20 locations, leaks are a bit of a ways off from you as of right now, but you will need to learn them later

It might not come out too pretty, as 20 units trying to move at once doesn;t really work out too well (the ones in vack recognize there is something blocking their way, and try to find a different path, but there is none, so they stay still, or they just keep trying
 
Status
Not open for further replies.
Top