Default switch direction II - Yo Vern!

sniper297

Coconut God
Okay, got sidetracked in the previous one, and noticed I forgot the "wuffo" - Wuffo you wanna know about this?

http://forums.auran.com/trainz/showpost.php?p=829485&postcount=50

Primary thing that keeps sending Vern AKA BigVern AKA NorthernWarrior (depending which forum he's on) back to the birdwatching simulator despite the hopeless AI traffic is the fact that it's easy to set a path for the player in a standard scenario, and even in free roam you can easily set switches to a default starting position for each different scenario. Rather than slamming on the brakes and creeping up to switches on the mainline to make sure they're set the right way, you can highball along secure in the knowledge that you won't diverge into the roundhouse at 70mph. :eek:

TS2010 makes this more complicated since the default setting for the switches are in the route - but they're also in the sessions. Not sure where yet, the most likely suspect is the profile.trk file in each session. The way it works is you create a new session, the default switch settings in the route are stored for that session. If you edit the route to change the switch settings, any new session created will use those switch settings, previous sessions will use the ones that existed at the time they were created. Couple tests for Downtown Traction TS2010;

http://www.humyo.com/FChMvwQ/DTtest.zip?a=xukKkQJQK98

Easiest way to download from a humyo link, right click and "save link as".

Two CDP files in there;

downtrac2btest.cdp - for downtown traction 2B
downtracDefault.cdp - for the built in downtown traction route.

Test 1 has all the switches preset to take you to a harbor, Test 2 will hang a left and another left to take you counterclockwise around one of the loops. To try them out, start session, put it in gear and pop the clutch, see where the switches take you.

Biggest problem here, I don't know why sometimes I can overwrite route and session for my own routes and sometimes it insists on saving as a new route and session, but near as I can tell it always forces a new route and session if you're doing this to somebody else's route. Kludge for that;

http://forums.auran.com/trainz/showpost.php?p=827919&postcount=5

Go ahead and let it save new route and session, then go back to content mangler and edit the session's config.txt to replace the map KUID with the original. More experiments to go, hopefully there's a way to simplify this, possibly by manual hacking and copying that profile.trk file from sessions that have different combinations of switch settings.
 
I queried this yonks ago, and switch settings were confirmed as saved in the session layer by Bloodnok/James Moody - he also commented something to the effect that the work flow was a bit odd for this, and he didn't understand why the game wanted to overwrite route on saving either.

It was (poorly) flagged as new feature for (I think) TS2009. I have a route with 100 sessions that relies extensively on this feature :)

There used to be somewhere about a very useful tutorial by someone who'd completely sorted AI issues at single track passing loops using catch points if you've not already sussed that one.

hth,

Anthony
 
Last edited:
What about adding one - or more - "Set Junction" rule(s) to the session in an ordered list to be run once at the start of the session?
 
"There used to be somewhere about a very useful tutorial by someone who'd completely sorted AI issues at single track passing loops using catch points if you've not already sussed that one."

This ain't really about the AI, it's more about the fact that you can't set a player path using the same instructions that you use for AI - if you do then the player train becomes AI controlled. I want to make four sessions starting from the same yard, (1) the player goes east to yard B on the outer right track, (2) the player goes east to yard C on the middle track, (3) the player goes west to yard D, (4) the player goes north to yard E. It's complicated and requires planning ahead, but it IS possible to have all the switches preset for the player so he don't need to check every switch on the mainlines to make sure they're set to go the way he's supposed to in each different session. It really should be a lot easier to set up, but if there is an easier way I haven't found it.

It does affect the AI in some situations - I had the center track switches on one line set by default to zigzag back and forth between left outer, middle, and right outer. Not intentionally, that's just the way they were before I started paying attention to this. An AI train set to run straight down the middle track ran at half speed, slowing down and even stopping every half mile to check and set switches. After setting them all for the straight he ran at full speed without stopping, cutting a full 10 minutes off his run time.

" What about adding one - or more - "Set Junction" rule(s) to the session in an ordered list to be run once at the start of the session?"

Dunno, haven't tried that yet, haven't looked at the path rule yet either. Bear in mind I'm a Trainz n00b still. I'm assuming since Vern has been griping about this as long as I've known him from other sims, if there was an alternate way he would have found it by now.
 
Hi Sniper

The junctions can be set 'per session', however at the moment they do require that the route also be saved at the same time. This is a known issue with this function at this time.

However, for the time being, you should be able to use the 'set junctions' rule.

This allows you to set specific junctions to a specific direction. You can also select if they are 'locked' for the player, and locked to the AI (may be handy for ensuring the AI doesn't go down the wrong track!).

You could also theoretically do all three sessions in 1 session (lot of work, but it's a nifty idea!). This would be done by leaving say 2 junctions unlocked. If the train starts on the same track for each 'run', but can head three ways, place a trigger object on each of the tracks that would be 'unique' to the desired route (you don't want a train for route 1 triggering the rule for route 2, etc).

You then add an 'ordered list' rule into the rules panel, and then a 'trigger rule' and the 'junction rule'. Indent the trigger rule once, and the junction rule twice. Set the trigger rule for the 'route 1' trigger and the player's locomotive, and then setup the junction rule for that route. Now repeat for the other two routes/paths.

As I said, leave the junctions for 'deciding' the route unlocked. That way, if you start down 'route 1' you will hit the trigger, and all the junctions will be set for you. If you go down route 2, you will hit the trigger, and again all junctions will be set for this route.

Certainly an idea to make sessions that little different. Especially if you could run each of the 'routes' one after the other (e.g. you go out, then come back, and run the next 'train', etc).
 
Thanks Zec, at first glance that sounds ultra complicated but I'll look into it.

"This is a known issue with this function at this time."

Does that mean "We know about it and are working diligently to fix it and will have a patch soon", or "We know, who cares, live with it"? :hehe:
 
More a case of we know about it, and will look into it, however we don't know when we will look into it.

In the mean time, there are a few other methods available to you to accomplish the same effect (E.g. the 'set junctions' rule), just they require a bit more work.
 
Back
Top