I treat the brake control as if it is 'spring loaded'. To apply the brakes, press the apostrophe ( ' ) key as usual. The brake pipe pressure drops so long as you hold the key down. When you release the key, the brake lever moves to 'hold' and the brake pressure remains where you set it. Pressing semicolon ( ; ) releases the brakes ( charges the brake pipe ) so long as you hold down the key. When you release the semicolon, the brake lever moves to 'running' position.
Similarly with the engine brake , hold right bracket ] down to apply the engine brake. Releasing the key moves the lever to 'hold'. Pressing left bracket [ moves the engine brake lever to release and when you lift the key it returns to 'hold'.
I also added a 'snap' action to the reverse lever so the w and s keys quickly snap from forward to reverse.
The emergency brake is activated with the backspace key so you can't accidentally move to emergency during routine switching.
I find the controls much more intuitive now, and I am able to operate the loco without looking at the gauges or HUD display. I am pretty familiar with prototype brake control and fully admit that this is a major simplification. But the notion of 'apply pressure' / 'release pressure' feels a lot more like the prototype than the default keyboard handling.
I have attached a copy of my files in case you might want to try it out. The package contains modified files for the RS-1 loco that comes with the RWA route. The modified loco will appear as 'ALCo RS-1 RWA WAC' in the scenario editor, or you can rename the file to overwrite the default RS-1 loco.
For the techno types out there, here’s how I implemented this feature. I’ll describe only the TrainBrakeControl. The EngineBrakeControl was handled in a similar manner.
To make this work I needed to put the keyboard processing under control of the Engine Script. But normally the Engine Script can’t read the keyboard state. So I added two new control values to the Engine Blueprint, these control values are made to mirror the state of the the semicolon and apostrophe keys on the keyboard. The Engine Script queries these control values to learn the state of the keys and set the actual Train Brake Control accordingly. In most locomotives these keys are connected directly to the TrainBrakeControl. My change essentially disconnects them from TrainBrakeControl, routing their signal through the Engine Script instead.
To go into it in more detail, refer to the block diagram below.
INPUT MAPPER - IM_Expert_RWA_WAC.bin is a copy of the standard RWA mapper, IM_Expert_RWA.bin, with the brake keys remapped as follows:
Key_Apostophe, ButtonDown maps to IncreaseControlStart, ApplyBrake
Key_Apostophe, ButtonUp maps to DecreaseControlStart, ApplyBrake
Key_SemiColon, ButtonDown maps to IncreaseControlStart, ReleaseBrake
Key_SemiColon, ButtonUp maps to DecreaseControlStart, ReleaseBrake
ENGINE BLUEPRINT - Alco_RS-1_001_WAC.bin - has two new entries in the ControlValues section for ApplyBrake, and ReleaseBrake. These controls have a value range between 0 and 0.2 to represent the key up and down states. This limited range improves the response time of the control. These control values are meant to mirror the state of the keyboard semicolon and apostrophe keys.
I also modified the notch settings of the TrainBrakeControl to implement only Release, Run, Hold, FullService, and Emergency.
And I directed ExpertRemapper to the new input mapper.
ENGINE SCRIPT - The final component is the modified engine script, RS-1_EngineScript_WAC.lua The work is done in the OnControlValueChange function by these lines:
- Code: Select all
--- TRAIN BRAKE CONTROLS
if name == "ApplyBrake" then
if value > 0.1 then
--- When Apostrophe is pressed, TrainBrakeControl sets to FullService
Call( "*:SetControlValue", "TrainBrakeControl", 0, 0.6 )
else
--- When Apostrophe is released, TrainBrakeControl sets to Hold
Call( "*:SetControlValue", "TrainBrakeControl", 0, 0.4 )
end
elseif name == "ReleaseBrake" then
if value > 0.1 then
--- When SemiColon is pressed, TrainBrakeControl sets to Release
Call( "*:SetControlValue", "TrainBrakeControl", 0, 0 )
else
--- When SemiColon is released, TrainBrakeControl moves to Running
Call( "*:SetControlValue", "TrainBrakeControl", 0, 0.2 )
end
As an example, lets follow the control flow when the player presses the Apostrophe key to apply the brakes:
- user presses Apostrophe key
- input mapper translates Apostrophe Down to ApplyBrakes IncreaseControlStart
- in the engine blueprint, the ApplyBrake control value begins to increase from 0 and quickly reaches 0.2
- this triggers the OnControlValueChange function in the engine script.
- when OnControlValueChange detects that ApplyBrake value has increased past 0.1 ( the half way point ) it considers the key pressed, and sets the TrainBrakeControl to 0.6, which is the FullService notch
I hope you like this method of brake control and please take what you need from this to implement it in your own locos.
Wayne