AI trains question

Fineas10

Active member
Hello!

It may be an easy question, howver I wanted to ask for some tips. I am planning to add to my route a bunch of AI trainz, however I want them to have like a On/Off button. For example, I want to add 5 consists that run around the route, however I want them to stop at some point when they reach a sation. Or, I want the consists to start running only when I start them. The problem is that I want them to basically be starting and stopping, but all at once. This would have been easy with a session, however I have many ATLS (they need to stay on session layer), so I can't really do that. Any ideas?

Thank you!
 
I am not sure what you are trying to do, but there is no "on" & "off" button that I am aware of. I use a lot of different commands to start stop AI trains depending on the trains mission.
 
Stopping them all at once is much harder, but “wait for trigger” is a great way to start them when you want to.

Jamie
 
Stopping them all at once is much harder, but “wait for trigger” is a great way to start them when you want to.

Jamie
Yes, thank you for the tip. What I am trying to do @Lewiscc65 is to have like a day shift right. So I want to start them all and then when night comes, to stop them all.
 
Yes, thank you for the tip. What I am trying to do @Lewiscc65 is to have like a day shift right. So I want to start them all and then when night comes, to stop them all.

What you need is a rule that is based on a specific time to stop and another to run. You should be able to set these times. Maybe it's possible to add in a start time for each consist since that could be different. The stop time will then be based on so many hours afterwards and that could be calculated by the rule.

The trains that fall under that rule would need to be added to a table to control them because I'm not sure you want to apply this rule globally.

Before you ask, I'm not a programmer or scripter and only have big dreams. :)
 
It sounds like the best way to do what you want is to use a "wait for trigger" and then lay out their "day" through commands in the driver setup, and then a final "at 'x' Time" rule that ends their day... not that I'm very good with this sort of programing/scripting. As JCitron said there are ways to apply this across several trains, but like him -- I'm not a programmer or scripter and only have big dreams. :)
 
I like creating sessions, if you want, I could do it for you. Just send the route to the e-mail address in your PM, along with an idea of what you want the session to do, and I will create the session. I have done this for other route creators.
 
Last edited:
Thank you very much for all the answers! I may have said it wrong. The problem is not based on time, but on to controlling a lot of AI trains at once. For example, I want to have ai trains roaming around the map, delivering thins, doing everything they have in the schedule. What I need is to have like a quick command to make them stop, but in a terminus station or in a depot, not anywhere on the map.
 
So, it seems like you want to be able to "clear up" the AI trains... or in other words one command to get the AI trains to stop at the nearest yard/station (on your demand) and not just stop willy-nilly all over the place?
I, for one, would have that on every route... I don't generally run/have routes with a lot of AI traffic because it just isn't worth it to me (I don't want to deal with waiting for other trains, I get paid for that), but a command like that would be enticing to me for sure.
That being said I have no idea how to actually make the rule to do it, all I can try is to point out what I think might be things that would have to be solved. First, I would think that you would have to designate where trains could park, then have a command to "go to" the nearest unoccupied one. Once we solve that, it should be fairly straight forward to do something like this. I think that it probably will require a lot of set-up work and, based on my experience with AI drivers in Trainz, a colossal pain in the rear to "debug" the inevitable spurious results.
 
Where they stop is down to you and where you schedule them to go. Once a schedule is complete, they just stop. No command or rule will automatically send trains to a location.
They would all need an extra schedule to put them there. Use the schedule library to set up your schedules and separate schedules to send them at the end of the day to your safe stops.
 
Where they stop is down to you and where you schedule them to go. Once a schedule is complete, they just stop. No command or rule will automatically send trains to a location.
They would all need an extra schedule to put them there. Use the schedule library to set up your schedules and separate schedules to send them at the end of the day to your safe stops.
So, it would be a separate schedule that could be triggered with a "time check" rule... that would put them on a different "schedule" to, well... "go home."
Sounds straight forward enough, I'm not much for dealing with the AI Trainz... I prefer route building.
I still like the idea of an on demand "go home" rule though... the magic of the Trainz community means somebody will probably tackle it at some point, so I'll keep dreaming.
 
Set up your schedule in the schedule library. In driver set-up, use copy commands from and select the schedule. You use the copy command repeatedly if you need to do the schedule more than once. The last copy command would be the schedule to return the train to its depot position.
 
Set up your schedule in the schedule library. In driver set-up, use copy commands from and select the schedule. You use the copy command repeatedly if you need to do the schedule more than once. The last copy command would be the schedule to return the train to its depot position.
I've done this with my tram route. I have the AI drive their routes multiple times then after they arrive at a stop close to the depot, I use a terminate passenger train to empty the train. After waiting a minute, I send them to tracks within the carbarn.
 
I like creating sessions, if you want, I could do it for you. Just send the route to the e-mail address in your PM, along with an idea of what you want the session to do, and I will create the session. I have done this for other route creators.
This is still an option if you would like to.
 
Back
Top