Creep spawn/pathing

Hsinker

Member
Joined
Dec 2, 2006
Messages
11
Reaction score
0
I couldnt find this in search so...
How do i spawn creeps for two lanes and have them attack move to a point?

ALso the lanes i want the creeps to follow arent straight and has turns.
Would that involve check points at each turn?

*my bad, i didnt see the edit button.
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
Make several regions along a path. Too many and your triggers get annoying, and too little might end up with some creeps getting lost when they wonder off the path.

On the spawn region, use a trigger:

Event
(Anything you want)

Condition
(Anything you want)

Action
Unit - Create [your unit] at [spawning region] facing [anything you want]
Wait [0.01] seconds
Unit - Pick every unit in [spawning region] and do [Unit - Order [Picked Unit] to [Attack-move] to [next region]]

Then, for each region, dump a trigger telling all entering units of a certain team to go to the next region.*
 

Hsinker

Member
Joined
Dec 2, 2006
Messages
11
Reaction score
0
Could you give an example for event and conditions? Also what do i have to add to make the creeps spawn for a specific player?
For example i want to create 2 footmen for player 2 at region1 and move them to region2.

I just started using the world editor and not yet familiar with the triggers and language used.
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
Open up the Trigger Editor and look around. You can create triggers, which consist of Events (that "activate" the trigger. Triggers do not need to have events as they can be manually invoked but for this case, it is most likely an Event is needed); Conditions (conditions that must be satisfied before the Actions occur) and Actions, which do the actual work.

You would create a new trigger and rename it something sensible. Then think about how the creeps will spawn. Is it going to involve a countdown? If so, there are triggers for countdown timers. Does a player type in something? There are chat triggers. Choose the appropriate Event that you want and fill in the red links.

The same goes for conditions, depending on how you wish to restrict it.

As for the action, you choose Unit - Create Unit (may have lots of similar triggers - I can't remember) and fill in the red spaces.

The Wait [0.01] seconds is a due to the fact the computer cannot spawn units in an infinitely small amount of time, and some units might be in the stage of processing when asked to move, so some units get left behind.

Unfortunately, you cannot order all units to move in a region. But you can Pick every Unit in Unit Group and Order them to do something, and there is a trigger for that.

The hardest part is the red links to fill in.

Have a little spin with the World Editor. If it doesn't work, then get back to us with your triggers and we will correct them. This comes with experience.*
 

Trigger Noob =]

Member!
Joined
Dec 4, 2006
Messages
36
Reaction score
0
Location
Behind you O_O
Im new but i read this and i did as it said but it still wont work properly.
Can you or anyone help?

My triggers:
E: Time - Every 20.00 seconds of game time
C:
A: Unit - Create 4 Footman for Player 1 (Red) at (Center of Spawn 1 <gen>) facing Default building facing degrees

Wait 0.01 seconds

Unit Group - Order (Units in Spawn 1 <gen>) to Attack-Move To (Center of Top left <gen>)

Unit - Create 4 Footman for Player 1 (Red) at (Center of Spawn 2 <gen>) facing Default building facing degrees

Wait 0.01 seconds

Unit Group - Order (Units in Spawn 2 <gen>) to Attack-Move To (Center of Bot Left <gen>)

Unit - Create 4 Footman for Player 1 (Red) at (Center of Spawn 3 <gen>) facing Default building facing degrees

Wait 0.01 seconds

Unit Group - Order (Units in Spawn 3 <gen>) to Attack-Move To (Center of Bot Right <gen>)

_____Next Trigger______
E: Unit - A unit enters Top left <gen>
C: (Owner of (Entering unit)) Equal to Player 1 (Red)
A: Unit - Order (Entering unit) to Attack-Move To (Center of Top right <gen>)

_____Next Trigger______
E: Unit - A unit enters Bot left <gen>
C: (Owner of (Entering unit)) Equal to Player 1 (Red)
A: Unit - Order (Entering unit) to Attack-Move To (Center of Bot right <gen>)

AND THEN ONE FINAL PLACE
E: Unit - A unit enters Top right <gen>
C: (Owner of (Entering unit)) Equal to Player 1 (Red)
A: Unit - Order (Entering unit) to Attack-Move To (Center of Final <gen>)

E: Unit - A unit enters Bot right <gen>
C: (Owner of (Entering unit)) Equal to Player 1 (Red)
A: Unit - Order (Entering unit) to Attack-Move To (Center of Final <gen>)


Final is enemy base. i Didnt add player 1's enemy spawns.
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
I couldnt find this in search so...
How do i spawn creeps for two lanes and have them attack move to a point?

ALso the lanes i want the creeps to follow arent straight and has turns.
Would that involve check points at each turn?

*my bad, i didnt see the edit button.
You make regions at turns and name them CheckpointXX. Then issue move attack commands to the next area and so on till they make it to the end.

Above: It has something to do with the wait commands. What happens is you are overwriting the last command after .01 seconds of time. You need to seperate the move attack commands and use them when a unit reaches the location you need that unit to be in.
 

Trigger Noob =]

Member!
Joined
Dec 4, 2006
Messages
36
Reaction score
0
Location
Behind you O_O
Cool i'll change it.
And what do the triggers for those uhhh ( i don't know how to word this ) checkpoints?
Is it :
E: Unit - A unit enters Top left <gen>
C: (Owner of (Entering unit)) Equal to Player 1 (Red)
A: Unit - Order (Entering unit) to Attack-Move To (Center of Top right <gen>)

Then etc etc with the other regions.


And wat are the variables for? Like Set variable and stuff.
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
Variables allow you to allocate a value or something into memory. So that you can use it for future references or triggers.

I would put all your variable initializations (setting values) into one trigger which runs when the same starts.

Yeah, that's what you do for the movement. In your previous statement, you kept overwriting commands over 1 millisecond.
 

Trigger Noob =]

Member!
Joined
Dec 4, 2006
Messages
36
Reaction score
0
Location
Behind you O_O
Oh yeah...
Sometimes after a few spawns, the spawned units go back to base ( like the DotA base thingy. eg world tree ) Why do they do this and how do I stop it?


Sometimes when they spawn and attack < both sides > top and bot units go to help the units in mid.Why do they do this and how do I stop it?
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
Aquisition Range is probably the cause of your second one. Set it to a number that is low enough.

The first one I am not sure.
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
Oh yeah...
Sometimes after a few spawns, the spawned units go back to base ( like the DotA base thingy. eg world tree ) Why do they do this and how do I stop it?


Sometimes when they spawn and attack < both sides > top and bot units go to help the units in mid.Why do they do this and how do I stop it?
It's really a flaw. Sometimes spells cause units to "forget" their last actions. Or when they do not reach a certain place after a set amount of time, they "forget" and return to the last position they know of - which would be the base, where they are created. I think this is the case if you tell a ground unit to travel to a place where there is no path - it gives up after a while and stops.

You can stop this by putting more regions and forcing units away. Like in DotA, there should really be regions near the Neutral Hostile areas to force units from walking into the Neutral Hostile creeps.*
 

ChrisH36

Guy with Most Posts on Quiet Board.
Joined
May 20, 2003
Messages
15,042
Reaction score
4
Location
Temple Prime, Sarajevo
Or the next best method. If it's a linear path they travel, tell them to move to the closest checkpoint if they stop. Put a giant region covering that, and you should have no trouble.
 

Trigger Noob =]

Member!
Joined
Dec 4, 2006
Messages
36
Reaction score
0
Location
Behind you O_O
I still have a problem. I put in more regions recreated triggers but they still dont work.They still got to back to base.This mainly happens on the 2nd or 3rd spawn. They do it suddenly
 

Trigger Noob =]

Member!
Joined
Dec 4, 2006
Messages
36
Reaction score
0
Location
Behind you O_O
Ok then :
E: Unit - A unit enters Top right <gen>
C: (Owner of (Entering unit)) Equal to Player 1 (Red)
A: Unit - Order (Entering unit) to Attack-Move To (Center of FIRE Attack To <gen>)

Its wrong isn't it?
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
Are your regions quite small? You might want to increase their size. This is because if units cannot enter a region in a select amount of time (for example, it is blocked by trees or a spell stuns them for too long), then it returns to base (or its last action).

Size might not be the issue, too. It could be that the units are going to the wrong place or a tree might be in the way or something.

By the way, for the sake of randomness, you should use Random location in rather than Centre of. It keeps your random number generator running so it becomes slightly less predictable. Also because they will not all aim for the centre.*
 

Trigger Noob =]

Member!
Joined
Dec 4, 2006
Messages
36
Reaction score
0
Location
Behind you O_O
I've changed it but it still happens! T_T

E: Unit - A unit enters Bot Left <gen>
C: (Owner of (Entering unit)) Equal to Player 1 (Red)
A: Unit - Order (Entering unit) to Attack-Move To (Random point in Bot Left Mid <gen>)
 

NewPosts

New threads

Top