Recently, in my thread on the Class 20 Advanced, I was asked if it was possible to add the ability to have the AWS Horn and Bell play externally on any loco.
I thought this was a good idea and have had a look into it. It would appear to be a FAR simpler operation than I imagined. The only drawback is that unlike the excellent Just Trains style implementation, there is no way to switch off the sounds. Once the change is made it will remain in effect until you remove it. I have tried this now on a few of my loco's for which I have Armstrong Powerhouse Sound Packs, and they all work fine, playing the AWS Horn and Bell externally.
So, what to do.
First, I want you to create a shortcut on your desktop to SERZ.EXE in your Railworks directory. You can name the shortcut something like "SERZ - XML to BIN to XML Converter" and link it to SERZ.EXE in your Railworks folder.
Make sure the shortcut is visible on the desktop when you have Windows Explorer open.
Now, navigate to your Railworks/Assets directory and select the loco you want to modify. Select the "Cab" directory within the "RailVehicles" directory within the "Audio" directory. For this example I am using the Armstrong Powerhouse Class 40 (PRO) Sound Pack.
The path is "RailWorks\Assets\AP\C40P\Audio\RailVehicles\Cab"
Take a copy of the two Cab Audio files "Class 40 Cab.proxybin" and "Class 40 Cab.proxyxml". Rename these as you like, they will be the original backups. Note that the files names will vary depending on the loco you are changing. The names I have used here are just samples.
Now using your favourite text or XML editor, I use 'Notepad++', open the proxyxml file.
Search the code for code segments like the following. You are looking for the "Loop" reference for the AWS Horn, and the "OneShot" reference for the AWS Bell. In some loco's these may be called 'AWS Warn' and 'AWS Clear' etc.
The following samples are from "Class 40 Cab.proxyxml"
Code: Select all
<kLoud-cControlledLoop d:id="71398368">
<PlayState d:type="cDeltaString">INSIDE</PlayState>
<Name d:type="cDeltaString">AWS Horn</Name>
<Sound d:type="ref">56724120</Sound>
<ModifierChain d:type="ref">0</ModifierChain>
<ControllerName d:type="cDeltaString">AWSWarnCount</ControllerName>
<LoopCondition d:type="cDeltaString">ValueInRange</LoopCondition>
<ActiveRangeStartValue d:type="sFloat32">0.100000</ActiveRangeStartValue>
<ActiveRangeEndValue d:type="sFloat32">1.000000</ActiveRangeEndValue>
<ValueIsChangingGateTime d:type="sFloat32">0.000000</ValueIsChangingGateTime>
<InstanceGroup d:type="ref">0</InstanceGroup>
</kLoud-cControlledLoop>
Code: Select all
<kLoud-cTriggeredOneshot d:id="71998816">
<PlayState d:type="cDeltaString">INSIDE</PlayState>
<Name d:type="cDeltaString">AWS Bell</Name>
<Sound d:type="ref">56785904</Sound>
<ModifierChain d:type="ref">0</ModifierChain>
<ControllerName d:type="cDeltaString">AWSClearCount</ControllerName>
<TriggerType d:type="cDeltaString">ValueIsChanging</TriggerType>
<TriggerValue d:type="sFloat32">0.000000</TriggerValue>
<ValueIsChangingGateTime d:type="sFloat32">0.000000</ValueIsChangingGateTime>
<InstanceGroup d:type="ref">0</InstanceGroup>
</kLoud-cTriggeredOneshot>
For both of these code segments, or just the AWS Horn if you only want to hear that one externally, change the value >INSIDE< to be >BOTH<
We are telling the sim to play the sound when the player is both INSIDE and OUTSIDE of the Cab.
Be VERY careful not to introduce extraneous characters into the code. Simply change the word INSIDE to read BOTH
Now save the modified proxyxml file.
Finally, drag the modified proxyxml file and drop it on to the shortcut you created to SERZ.EXE. This will recreate the associated proxybin file.
If you have any trouble running SERZ.EXE, or the proxybin file does not get recreated. You may need to edit the shortcut and set the 'Compatibility' option for 'Run this program as Administrator'. This may be particularly true if you have Steam installed under the Windows default 'Program Files' or 'Program Files x(86)' directories. I suspect this will only apply to Windows 7 and 8 users. I am using Windows 8.1 myself.
Clear the Cache in the sim and away you go
Note that this should work for any loco, AP Sounds or otherwise. As long as you can find the proxyxml file that contains the code that plays the AWS sounds, this should work.
If it all goes pear shaped, then simply delete the proxyxml and proxybin files that you modified and rename the copies back to their correct names.
No guarantees of course, but this has worked for me on each loco I have tried so far.
Enjoy