|
The Never Ending (Trainz) Operation
By John D'Angelo

Sunset Express arriving at Central Terminal.
Like most of us, I have used the Save option in Trainz to save a session in progress for later playback in order to pick up where I left off, but I really wanted to do more.
Many model railroad clubs and hobbyists operate in what I would call a continuous mode. They distribute freight cars and run passenger trains, then at the end of the session they leave everything as is. The next session, they start up and continue the operation. Once started, the operation of the railroad never ends. There are just pauses as folks take a break. One of the aids model railroaders use today is the staging yard where trains move off the layout proper and are stored for later use. Another aid is the “fiddle” yard where cars and trains are placed onto or removed from the layout by hand.
In Trainz, the continuous operation would be utilized by using a saved session and continually saving and reusing the same session.
I found that to be able to run a truly continuous operation in Trainz there were things I had to do to make it possible. I needed to allow trains to be removed from or introduced into the layout while the session was in progress. I also needed to be able to change the weather conditions on a saved session and have day and night operations; and I wanted the daily operation orders to change in a random fashion. I thought over all the things I would need to do that would allow me to run a continuous operation. The list below shows what I felt I needed to do in order to operate continuously:
- Have an ability to make up and add trains to a saved session
- Be able to remove trains from the session in progress
- Remove derailed trains so that they cannot stall the session
- Have some trains turn around at the end of their run automatically
- Be able to change the weather of a session in progress
- Be able to use a random weather forecaster
- Have a dispatcher give me the orders for the day's operation
The lynch pin for creating a continuous operation that you can treat like a club layout, is the ability to make up and then add trains to a saved session. Without that ability, whatever trains and cars you have on the layout will be all you can use. After you have started the original session, you cannot add new running gear.
iPortal
I had been using the “Emit Train Rule” by sforjet in earlier versions of Trainz, but the rule had problems from TRS2004 onward. Sforjet tried to get the rule to work without problems, but finally announced that he could not correct the problem and reluctantly stopped the attempt. With the introduction of TRS2006 a new item was added by Auran that cured the problem. It is called the “iportal”.

A peddler freight being created for iportal operation.
For the continuous operation I wanted to run, I chose my United Central Railroad, imported it into TS2009, and redesigned it for continuous operation. I added two iportals to the layout, one for eastbound trains and one for westbound trains. The iportal is an amazing device. It can transport trains to another iportal anywhere on the Internet. You program the portal to deliver the train to the address you want. The address is the receiver's Trainz user ID, plus the portal name. Actually, if anyone else has your address, they can use the iportal to send trains to your layout, and you can run them, load or unload them, and then send them back. The system works through the Auran server, so you must be a registered user. The route is available for free download at the VR Downloads page.
In my case I wanted to be able to send trains to my session after it had been saved. First of all I needed to create an iportal layout to send trains to my saved session. The above picture shows my iportal layout, which is a two-baseboard layout. All it contains is a track for creating the train and two iportals. At the left of the picture you can see two tracks that are the iportals. Although you can program the iportal in Surveyor to deliver the train to any location, since I had two iportals on the layout to receive trains, I used two iportals for this layout. One iportal was used send trains to the east portal and one to send trains to the west portal. All I needed to do was to send the train to the proper iportal. The iportal operation could be expanded at a later date. For example, I could place industries such as a working coal mine on the sending layout and use the mine to load hoppers with coal before sending them to the receiving layout.
The iportal is, I've found, a very powerful tool. I open up the iportal layout, build my train in Surveyor, run the session, drive the train into the proper outgoing iportal, then close down. I then run the saved session from the United Central route and the train gets delivered via the Internet and comes out of the receiving iportal! Since this operating session has been saved previously, generating a new train into the session is a major accomplishment. I'm free at last!
I can't keep bringing in trains with cars without some way to send the delivering locomotive back off the layout, or I soon will be overrun with locomotives. I took care of that situation by using a standard portal programmed to delete the incoming rolling stock. For this operation, I used a standard portal that would just delete the incoming train. Each of the two distribution points would have two portals working in parallel. Incoming would be the iportal and outgoing would be the standard portal. Locomotives would come in via the iportal, deliver their cars, then drive to the outgoing portal and be removed.

The two portals at the Western section.
Erase Derailed Train
Now that I had the ability to move trains onto and off a saved session, I moved onto the next step. This was to ensure that a derailment would not hang up the operation. This was done by using a rule that would erase a train that had derailed, freeing up the track. This rule is now standard issue in TRS2009 and is called the “Clean Up Derailed Trains” rule. You can set the length of time the derailed train will stay on the track before it is erased if you edit the rule in the session. For versions of Trainz prior to TRS2009, there is a rule available at the Download Station you can use. This rule is called the “Derailed Vehicle Eraser” rule by Maggs, kuid 2:116387:4:3. It operates the same way as the rule in TS2009 and can also be programmed for how long the train will remain on the track before it is removed.
I like to make the situation more interesting if and when a train does derail. I've added a work train that I keep on standby in the Springfield yard. When a derailment happens, I send the work train to the crash location to do cleanup, then return it to the yard. I made most of the rolling stock for the work train by using Paintshed in TRS2006, then importing the rolling stock into TRS2009.

Work train on standby.
There are two main destinations on the layout: San Angelo on the “Pacific” side of the layout and Central City in the southern section. I extended the rail line past each of those terminals to a portal. The portals, San Simeon and Weston, are programmed to take in the train, turn it around and send it back to the terminal so that it can be sent in the opposite direction.
Seed the Layout
Prior to starting the session for the first time, I “seed” the layout with rolling stock to cover normal operations. The main yard in Springfield will have a number of locomotives at the roundhouse and numerous freight cars in the yard. I have a small freight ready to leave the yard, and passenger trains ready to leave terminals. I also have a couple of locomotives out in the north west at Silverado and a commuter train set up in Hillside. For those of you who have not read about the United Central Railroad, there is an article describing it in the August 2004 issue of Virtual Railroader.
The version of the United Central in the article was created over four years ago, so it has been revised since then, but older versions are still available from the Download Station.
Change the Weather
In order to be able to change the weather as required, I needed to have an option that let me change the weather in a session that is already in progress. TRS2009 has the “Weather Rule” standard and you just need to add it to the session when you create the layout. From that point on, when you run the session there will be a heads up display that will be visible on screen that lets you adjust the weather conditions. Prior to TRS2009 you can download set_driver_conditions KUID: 99999:696969 and add it to your session rules. It also works in a session that has been saved with a heads up display, but is more powerful than the Weather Rule since it allows you to control additional factors such as time of day. I have not tried this rule in TS2009 yet, but it does work in TRS2006.
Why bother with the weather? I feel that just as in real life, it makes the simulation more interesting if you have to operate in different weather conditions, and it is even more interesting if those weather conditions are given to you as conditions for the session you are about to run. I also feel it helps the operation if you can be given “orders of the day” for your operating session. I use two BASIC programs to do this, one is a weather forecaster and the other is the dispatcher. I run each program and get my conditions, use the iportal layout to create a train, if needed. I then start up the saved session and implement the orders. If you are interested in getting started with a BASIC program, I wrote an article for Virtual Railroader's 15 December 2005 issue entitled “Let's Get Down to Basic!” You might find the article of use to you. Expanding the original weather program into a dispatcher program is easy. All I had to do was increase the number of possible events, then add in the dispatcher orders for each number.

The Cannonball leaving Eastport in heavy snow.
More BASIC
An additional BASIC program could be for emergency procedures You could have a line in the dispatcher program that might state ” Emergency Conditions Today” You would then run the emergency conditions program and get special orders, such as “Flood in Riverdale! Send GP with 4 boxcars of emergency rations, weather is stormy.” The great thing is that thanks to the new iportals and weather rules, you can inject these situations into a previously saved session.
Have fun!
John
Article and screen shots �2009 John D'Angelo. All rights reserved.
More Articles:
[Visit the VR Reading Room.]
If you want to be notified when a new article arrives, join the VR-News group at Yahoo. This group is purely for notification. Anyone can join; only the moderator can post.
|