HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How do you keep units moving on a path?

07-12-2004, 01:37 AM#1
cfmonkey45
In a map I am making, I need traffic (It's a "Real Life" map) so I need to know how i can make it stay on the road without interrupting the pathing of other units not in traffic. Kinda like in a TD. Oh and there will be street lights.
07-12-2004, 03:52 AM#2
Shimrra
First you need to make sure the units are not owned by a player but a computer (preferably Neutral Passive). Then you need to make regions at each turn and create a trigger that says "When a unit owned by Neutral Passive enters region X tell it to move to region Y". If you make this into a loop; or conect the roads somehow, the units will keep going around in this interconnected path. The only other thing you'll need is a trigger to run at map initialization to tell them to start moving. For the stoplights, you will have to put an if\then\else in their to say "If the stop light is on, wait X seconds and then move." I hope this helps you!
07-12-2004, 04:25 AM#3
FrostCyrus
To avoid "traffic jams" and cars driving off the side of the road, simply put air pathing blockers surrounding all the roads and make the cars air units (this allows ground units to still walk across the street. It also allows you to 'get hit by cars'. The only problem is that cars (while moving) might run together in the same spot like flying units do.
So you could have the cars be ground units and pedestrians be flying units and just put ground pathing blockers surrounding the roads and and air pathing blockers for wherever you don't want pedestrians to go (through/over buildings).
07-19-2004, 06:34 AM#4
BuRnInSpartan
make pathing blockers or regions. For example

Events: Unit- A unit enters region (w/e)

Conditions: NONE

Actions: Unit Order triggering unit to move-attack to (w/e region)
07-19-2004, 07:09 AM#5
HexenLordX
Are you sure you want it to move attack? It'll begin to follow whatever unit it wants to attack, and then it will start a train and before you know it the units will group into a big circle and resemble something you'd see in NASCAR.
07-19-2004, 02:11 PM#6
BuRnInSpartan
it works for me