Train Staffs


This article will show you how you can model various train staff systems in Rail 3D. There are several official and unofficial names for the “staff”, including “token”, “peg” and “baton”, however for convenience they will be referrred to here as “staff”.

Background information on how these safeworking systems work is at the end of this article. You can skip to it by using the table of contents on the right. If you know of other variations not covered here, feel free to add them.

1  Scripting staff systems

1.1  Why script this at all?

If you have a simple single line section that has double line at either end, you may ask why we need to script this at all. To get the trains to go from A to B and back again, we don’t. But there are other reasons why you might want to do it:

  • Authencity and realism - Rail 3D will normally try to clear the signals as soon as possible, however if there is a train staff system in operation, we might want to force the signals to wait until the train has arrived at the signal box, to simulate the delay of the driver handing the staff to the signaller and the signaller handing it to another train.
  • Complicated arrangements - a train shunting an intermediate siding may temporarily clear the mainline, but still retain possession of the staff. If another train is waiting at one end of the staff section, Rail 3D would clear the signals as soon as the mainline were clear. Realistically, though, this would never happen because the train shunting the siding has the staff. Plus, if you script it, you avoid having to set up complicated hidden signals to control the intermediate siding movements.

1.2  Train Staff

A section of line operating under train staff safeworking might be something like the single line section in the following diagram:

You actually don’t need scripts at all to accomplish this. Simply designate both section entry signals (viz. the Down Starter at West End and the Up Starter at East End) as Hold signals. Create a release track feature for each of them so that a train coming in the opposite direction triggers the release. This will ensure that trains must travel in one direction and then the other.

1.3  Train Staff & Ticket

Let’s use the same example as before, where the single line section is operating under Train Staff & Ticket rules:

To set this up for ts&T working, do the following:

  • Identify all signals that permit movements into the staff section.
    • In this case, it’s the up starter at West End, and the down starter at East End.
    • Insert a hidden repeater signal immediately in advance of each of these signals. Insert the following script on each of them:
	signal sigX=GetSigByID("WestEndUpStarter");
	signal sigY=GetSigByID("EastEndDnStarter");

  • Create a node at all points where trains can relinquish the staff.
    • Insert a hidden repeater signal on all of these nodes, and put the following script on each of them:
	signal sigX=GetSigByID("WestEndUpStarter");
	signal sigY=GetSigByID("EastEndDnStarter");


What these scripts do is hold at stop all other signals that control entry to the staff section as soon as a train enters the section. These signals are held at stop until the train arrives at the signal box at the other end (where you created the nodes to relinquish the staff), at which point the script releases the holds on them.


  • There are no Release track features associated with the starter signals.
  • Obviously you will need to alter the signals’ names as appropriate, both in the scripts and on your layout.
  • You can also do this with normal Holds and Releases.

1.4  Electric Staff

Now let’s suppose there is an intermediate siding in the staff section that requires trains to be in it while still allowing other trains to pass on the mainline.

If we did this with just Train Staff or Train Staff & Ticket safeworking then a train can go into an intermediate siding, but it still has the train staff or a ticket, so no other trains can use the mainline until it returns to one end of the staff section or the other. Electric Staff safeworking provides for this by having an Electric Staff Instrument at the siding as well as at both West End and East End.

To script this is very simple:

  1. Set up the section as if for Train Staff & Ticket (see above).
  2. Create a hidden hold signal controlling the exit to the siding.
  3. Create a hidden repeater signal immediately in advance of the siding exit signal, and insert the script for picking up staffs (see above).
  4. Create another hidden repeater signal in the siding to allow trains to drop off staffs and release the mainline for other traffic.
  5. Finally, make sure you edit all of the other staff pick-up/drop-off points’ scripts so they include the new siding exit signal:
	signal sigX=GetSigByID("WestEndUpStarter");
	signal sigY=GetSigByID("EastEndDnStarter");
	signal sigZ=GetSigByID("SidingExit");



  • If you need any of the staff pick-up / drop-off points to be route-sensitive, you can modify the script like this:
		// Insert Hold set/unset script here (same as before)
		// It will now only apply for trains on route "6MC3"

2  Background

All staff systems of safeworking operate on the principle that, for a train to enter a particular section of track (usually single line), the train crew must be in possession of a physical “staff” that gives them the authority to do so. Since there is only one staff for that section of track, the staff also gives the driver the assurance that nobody else is authorised to be in that section of track.

The staff itself is typically a metal rod that has distinguishing features (for example, the name of the section of track to which it applies, special colouring, etchings or grooves etc.) so that it’s not confused with any staffs that might be used for adjacent sections of track.

Fixed signals can be used in conjunction with staff working, as stations often have local movements controlled by such signals. However, it’s important to note that, even if there are starting signals into section of track over which the staff is needed to travel, the signals alone do not give authority to proceed into such section. Conversely, the staff alone does not give authority to proceed if the relevant starting signal(s) is/are not at proceed.

2.1  Train Staff

This is the simplest of the staff systems. A driver’s possession of the staff for a particular section of track guarantees him that no other trains are in the section. If the staff section (the section of track to which the staff applies) is from A to B, the driver picks up the staff from the signaller at A and gives it to the signaller at B. Once handing over the staff at B, the driver relinquishes the rights to the staff section.

Upon the arrival of the train at B, a second train wanting to travel from B to A can then take the staff and travel in the opposite direction. If, however, a second train wishes to follow the first, it must wait at station A until the staff is returned to A, whether that be by rail or by road.

2.2  Train Staff & Ticket (ts&T)

ts&T is an extension of Train Staff safeworking, which avoids the problem of having a train waiting at one end of the section and the staff at the other. In addition to the train staff, the signaller at each end of the staff section has a book of paper tickets.

If the signaller at A knows that two or more trains will go from A to B before any trains will travel in the opposite direction, then, provided that the staff is at A, only the last train to travel from A to B need be in possession of the staff. For all but the last train, the signaller shows the driver the staff, but writes out and gives the driver a “ticket” that authorises the train to travel without the staff. The signaller must retain the staff and may not write out any more tickets until the signaller at B has confirmed the complete arrival of the train.

As an additional safeguard, drivers must not accept a ticket without having first sighted the staff. Also, the tickets are normally kept in a box provided especially for the purpose, and when the signaller is not actually writing out a ticket, they must be stored in the box. The box is locked, and the train staff doubles as the key to open the box.

2.3  Electric Staff

The Electric Staff method of safeworking is a lateral extension of the ts&T system that allows for unplanned train movements. With ts&T, any special trains that were not known about in advance by the relevant signallers could potentially arrive at one end of the staff section just after the signaller had sent the staff to the other end of the section with a preceding train. Another advantage of the electric staff system is that there can be more than two ends to the staff section.

Electric Staff safeworking consists of multiple staffs, all with distinguishing grooves and all identical except for an identification number. The staffs reside in Electric Staff Instruments located at each end of the staff section, and there are no tickets (like with ts&T). As with Train Staff and ts&T safeworking, the train must have possession of a staff to travel in the staff section, however all the Staff Instruments are electrically interlocked so that only one staff can be taken out of one Staff Instrument anywhere across the system of Staff Instruments. All of the other staffs still resident in all Staff Instruments are consequently locked in there until the staff that was taken out is returned to one of the Staff Instruments. This is particularly useful when there are intermediate sidings in the staff section, as an Electric Staff Instrument can be provided at siding so that trains can be left there and the crews don’t have to return to either end of the section to return the staff.

Operation of this system usually requires some communication with bells or block telegraph between the ends of the section, to ascertain whether or not the signaller at the other end of the section is in a position to accept a train (e.g. the staff section might be clear, but the station at the other end might have nowhere to put another train).