Driver Command Uncouple/DeCouple (Get AI to use a turn table)

Rehnn

New member
I'm trying to get an AI Driver to use the turn table to turn around an connect at the other end of a train.
I'm not sure exactly how to do this - but I'm guessing it's along the lines of:
DECOUPLE - DRIVE TO TURNTABLE - TURN TURNTABLE - DRIVE TO OTHER END OF TRAIN - (RE)COUPLE.

The two problems/questions I have are:
  • Decouple - This is not available when in Surveyour (Edit Session/Driver Setup Menu) (It's only when in Driver mode)
  • How do I get the AI to actually use the turntable.
If anyone had any better methods to get the train from one end of a set of carriages to another I'm all ears (the train has to be turned through 180°)
 
Smileyman had a great example of this, but unfortunately he's moved on, so I'll try to summarize it.
You'll need the rule InputTable, kuid:131986:1012, set up correctly with the number of steps in the turntable, etc. Put a trackmark on the opposite lead from the turntable bridge. You'll have to adjust the radius and distance to get your engine to stop on the turntable. Have a trackmark where you stop your train.
For the driver commands, it would be:
1. Uncouple
2. Drive to trackmark "turntable" or whatever you name your trackmark
3. Wait 20 sec, this is crucial to let trainz sort things out
4. MoveTurntable, kuid2:131986:180156:1 to the desired step
5. Wait 10 sec, again important
6. Couple at trackmark where you left your train
Norm
 
Solution to uncoupling, turntable solution still sought

If you are using TRS2006 or TC, AI driver uncoupling can be achieved by enabling the UNCOUPLEZ command. Within Surveyor, go the the Session Editor > Driver Command and check (enable) the Uncouplez command. This should now be available to you within Driver Setup.

Your question about turntable operation was one I was about to start a thread on myself this morning, then I saw your posting.
The turntables generally have a script "turntable.gs" attached to them (viewable in MS Notepad and located in //Auran/TRS2006 or TC/Scripts). Attachment of this script to the turntable you are using can be confirmed in Surveyor by selecting the turntable object and clicking on Edit Properties > Edit Script. "turntable.gs" has comments that describe it as "An interface to operate a turntable..." and includes a 'method' declared as:

public native void MoveToNextStop(void)

that "moves the turntable to its next stop position". Since the turntables that you and I are looking to control contain only 2 stops, we would only have to apply this method once to achieve a 180 degree loco direction reversal.

The big question for us is how to apply this method to a specific turntable, say "TT1". The method would have to be called by a trigger ("TT1 Trigger") placed on the turntable track. And the calling would have to be effected by a Custom Script, called say "Operate Turntable".
In Surveyor Session Editor, the added commands nesting would look like:

-Trigger Check (TT1 Trigger)
--Custom Script (Operate Turntable)

Because of my ignorance of scripting, I do not know how the custom script is set out: how do you call MoveToNextStop and how do you tell this method to operate on TT1 and not another turntable?

Please, could a script-writing person help us out?
 
SCS2006 from Trainz Pro Routes is an excellent AI command system that completely replaces the default Auran one. The learning curve is pretty steep, but one needs no in depth knowledge of scripting because it has an excellent GUI right in surveyor.

It has a script already builtin for sending locos to, and turning, turntables, as well as enhanced coupling/ uncoupling scripting. I have not yet played with the functionality of either so I can not vouch for specifics, other than to say the system as a whole seems fairly powerful.

It takes patience, but the payoff for the steep learning curve seems to be an unprecedented level of control over AI trains, scheduling, and sessions.
 
Hold that thought. The more I experiment with SCS2006 I am beginning to realize it might be too restrictive. It's great for complex train behavior scripting, but I am having difficulty figuring out how to integrate it into a free driving session. It seems all or nothing, every train, and more importantly, every junction in the layout has to be controlled, or tracked by SCS or the system breaks down.

I was hoping it would allow me to script more complex AI commands, yet still allow me the freedom to drive through layouts with my own trains as I wished. That appears not to be the case.

Well, it's time for me to try the above advice about the turntable commands. Looks like it's back to Auran's AI commands.
 
Thought Held! :-)

Thanks guys - it's the UNCOUPLEZ command that I hadn't got/included.

Now I just need to work out to use the scripting.
 
Last edited:
More info on Norm's suggestion

Rehnn, I can't download the rule and script suggested by Norm because the DLS is down, but I was able to get more detail on how to employ these to move the turntable by going to the old Trainz Download Station at https://www.auran.com/trainz/downloadst.htm, selecting "All" at the top of the page (otherwise it won't include TRS2006) and searching on the 'Title' "MoveTurntable". Set the 'Display' to "Detailed", and you'll see atilabut's descriptions about how to edit "InputTable" and how to use "MoveTurntable".
 
Back
Top