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

How to make a locomotive follow on a track?

Status
Not open for further replies.
Level 8
Joined
Oct 31, 2010
Messages
238
Hello people, I'm back on Hive!
Now I am on a project with a friend to create an RPG.
As the title suggest, is there anyway to make a unit (locomotive in this case) follow on its track perfectly, without creating a trigger for every region?
It would be something like this: Roller Coaster, except that I have already placed the tracks.
Thanks in advanced for any help!

PS: I think I posted in the wrong section (Maybe?), if it is posted in the wrong section, please ignore this.
 
Level 7
Joined
Apr 30, 2011
Messages
359
use a missile system . . . .
or something to move it . . . (just like a missile system do)

please search by yourself . . . XE can be a good example
 
Level 7
Joined
Apr 30, 2011
Messages
359
you don't say if you need a GUI one . . . .

well, use classic initially off periodic event, and turn it on if you want to move something . . .
+ Bribe's unit indexer if you want a dynamic movement . . .
and use unit - move unit instantly to move the locomotive around . . . .
 
I think you need to use an A* pathfinding algorithm, and then place "nodes" at each curve that the unit has to pass. If you want your "train" to be controllable, you should make it follow the result path. It is pretty complicated stuff, but i believe there are some A* libraries on wc3c.net. I used it once to make villagers in a city use the pavewalk and crossings when they wander about town. If your track has lots of smooth curves though, this will require you to have a lot of nodes and it might turn out complex.
 
Yes, that makes it much simplier. I am still afraid you are stuck with a node based system though, i.e. that you need to have a list of nodes between which the train will move. It doesn't have to be hard, but i have a feeling that it wasn't what you were hoping for Also, if you have several train cars, there is a risk that they will not stay in a perfect train, since it would be very complicated to link them together.

I suggest you ask the author of that map privately, perhaps he can give you some kind of advice.
 
Status
Not open for further replies.
Top