Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
18 years ago
Hello,

I have a train that can be garrisoned. It runs around the track just fine and stops at stations. I can get the train to hold at a station.
Here's my questions:

  • Can you make a train switch tracks? (This would be cool!)
  • Can you make a train skip stations or only stop at a specified station?
  • Can you make a train offload when it gets to a specified station?
Thanks for your help.
Drummin

EDIT:
An example would be to have a main track without stations and through scripting, have the train pull into a station on a sideline track, load or unload troops.

If I wanted the train to offload at player4's base, the train would stay on mainline until it reaches the sideline track going to base 4. Then if possible, unload at the determined base.

In response to Krit's post below.
Yes, I understand about splitting waypoint paths. So I guess the question would be, can you change either the name of a pathway OR the name of the train when it reaches an area so it would go a different direction?
Sponsor
Rempit2502
18 years ago
If you want to make trains to switch tracks,first,make a track switch(like one goes straight,one went right or left according to what your choice,)then,while laying waypoints,make it to went into the switch,cross it and continue laying the waypoints on the tracks.You can download my map Alpine Assault at my forum Dam&garrisonable train
http://www.cncgeneralsworld.com/forums/topic.asp?TOPIC_ID=8672&whichpage=1 
If you still confused,here's a diagram for youUserPostedImage
For sure,whatever it was,the best option is to fight dirty when there's is no more choices.-That was my own philosophy.
krit
  • krit
  • 100% (Exalted)
  • Commander in Chief
18 years ago
Rempit2502, I believe he already knows how to do that, but is asking if he could "split" the waypoint into two waypoints at the track switch area so that the train will alternate between switching or not switching every time it reaches the area.

Anyway, back on the question; while I know that having split waypoints is indeed possible, but I don't really know if they actually work and if they do how does the train chosse which path to go. Me myself and Pi should be able to answer this question, considering he seems to have the most mapping experience around here.
UserPostedImage 
Yoshi714
18 years ago
Couldnt you have a timer that when it expired the script flipped off and another flipped on and they alternated between which path the train followed?? Both alternating scripts, and trains on way points are doable so why not put them together... as long as the train doesnt get confused during the swap in script.
Turtling is not a strategy, its a weakness
Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
18 years ago

Couldnt you have a timer that when it expired the script flipped off and another flipped on and they alternated between which path the train followed?? Both alternating scripts, and trains on way points are doable so why not put them together... as long as the train doesnt get confused during the swap in script.


Yes Yoshi714, that's what I'd like to do but I believe an engine relies on the ini file for movement. I don't believe you can script an engine to follow a pathway like other units. If it is possible, then I'm set and could do many things.

This is why I was asking if you could rename a unit. I could copy the train section in the ini file and modify the train name and the pathway it takes.
We'll see what others have to say.
Thanks for the reply.
Me Myself and Pi
18 years ago
I don't think you can script a train to switch waypoint paths. Also, making a fork in waypoints doesn't allow the train to alternate between them. The train will just pick one directions & continue to go that direction each time the train gets to the fork. What you can do is overlap a waypoint path for the train, that way when you get to a fork in the track & having two paths coming from the same track, you can have one path go one way & another path go the other way. But make sure to have these paths in the same loop. This picture is how it should look:
UserPostedImage
[size=1]
If you want to have a train go to a specified area, you'll have to use multiple trains, each going to separate bases & back. You can use the action, Unit\Set a train to stay at a station. TRUE = stay. FALSE = go-ahead[333] or the Unit\Move\Set a unit to help in place, ignoring Physics, Locomotor, etc. to get the train stay at the players base. This is the script EA used to get the train going again since there is no condition like, Unit has full contents:
🅱*** IF ***[/b]
     🅱Unit 'TrainCar1' has free container slots.[/b]
  *** OR ***
     Unit 'TrainCar2' has free container slots.
*** THEN ***
  Null operation. (Does nothing.)
🅱*** ELSE ***[/b]
  🅱Set Flag named 'Go Train Go' to TRUE[/b]
   'MisUSA01xEva05' plays, allowing overlap FALSE (true to allow, false to disallow).
  Disable Script 'Check the Train'.
The bold text is all that you need to pay attention to. But you don't need to use a flag like EA.

Two more things, I've just recently found out that you don't need to use a Map.ini file to make a train car garrisonable. The TrainCar04 is already garrisonable from default.

Also, don't edit a post in responce to a future post. You should just create a new reply.
Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
18 years ago
Thank you Me Myself And Pi,
I knew you would have the answers. Thanks for taking the time to make your demo map, take a picture of it and load it up. You didn't need to go through all that but thanks just the same.

It's to bad you can't have a train follow a pathway through scripting.

I had considered using different trains, one going to each base. On a six player map, that would require five trains for each base and the scripting to go with it. That would be challenging and fun to write though I'm not sure it's worth that much focus of time. I'll think about it.
Thanks again,
Drummin

Yoshi714
18 years ago
I'm debating which photo I like better... Pi's or Rempit's up top, simplicity versus beauty, lol, I think Pi takes the gold. Good luck drummin, trains are a fun addition (just time consuming for scripting)
Turtling is not a strategy, its a weakness