Transport Fever

Transport Fever

59 ratings
Locomotive Whistle Sound Fix
   
Award
Favorite
Favorited
Unfavorite
Misc: Sound
Tags: Audio, fix, horn, whistle
File Size
Posted
Updated
411.423 KB
Apr 18, 2017 @ 1:10pm
Apr 25, 2017 @ 3:53pm
5 Change Notes ( view )

Subscribe to download
Locomotive Whistle Sound Fix

Description
A simple quick fix for anyone who has an issue where all train whistles default to an identical sound file, this fix should ensure that most trains play the correct whistle sound that the developers intended.

There are a couple of exceptions such as the Class A4 and Flying Scotsman locomotives, these engines used the same boring whistle sound, so to ensure that each locomotive has a distinctive sound, I have changed these. There are many unused whistle sounds in the game!

UPDATE 1.1: Added the modified locomotive model files. These should resolve the intermittent problem where a locomotive was reverting back to the default whistle sound.

UPDATE 1.2: Fixed an issue where certain locomotives were not targeting the correct sound set.

------------------------------------------------------------------------------------------------------------------------------------------------------

INSTRUCTIONS - for if you'd like to customise the soundsets to your own preference


You can do all of this with notepad or any other text editor:

Step order:

1: Sample the default horn/whistle sounds in \res\audio\effects\vehicle\train_steam_old or \res\audio\effects\vehicle\train_steam_new and pick the one you want for the train you're about to modify (feel free to add your own if you're adventurous)

2: In the \res\config\sound_set folder - open either train_steam_old.lua or train_steam_modern.lua depending on what general sounds you want in addition

3: In the events section, edit the names value in this line to the filepath of the audio file you want to use for the whistle in the soundset you're about to create: horn = { names = { "vehicle/train_steam_old/horn.wav" }, refDist = 50.0 },

4: Save the modified .lua file as any name you want in that folder, you will need the name of your new .lua soundset for the train model you want to assign to it

5: In the filepath: \res\models\model\vehicle\train - Open the train .mdl folder that you want to modify

6: In the Configs section under the metadata, towards the bottom of the text, change the soundSet name value to the exact name of your .lua soundset file, and the horn to the same filepath that you defined in the soundset, like my example, as I created a borsig.lua soundset file for my mod:

soundSet = { name = "borsig", horn = "vehicle/train_steam_old/steam_horn_6.wav" }

7: Save that .mdl file

8. Repeat the above steps for each model of train you want to create a custom soundset for, I'd imagine it works for all the audio settings if you want to change those, but only the whistles really mattered to me.

25 Comments
KeybdFlyer Feb 4, 2020 @ 8:44pm 
@Hypernaught That's just what I needed to hear, many thanks. I followed the same path as you did, in the end. Dipped into other mods with their own soundsets and tried to figure-out what they'd done! Mostly it worked, but it's nice to have your method set out set-by-step to refer back to for the future. Good job, and once again - many thanks!
Capitán Alatriste Feb 4, 2020 @ 5:03pm 
Ah sweet man! Cheers
Hypernaught  [author] Feb 3, 2020 @ 1:33pm 
@KeybdFlyer @Griviues I updated the description above to include some step by step instructions for anyone who wants to do it themselves.

I haven't tweaked the values since I last changed this a couple of years ago, and I don't know if the code has changed for the second game, but I may come back and try again when I get it.

Hope it works for you guys, I'll try and be quicker on the response next time!!
Hypernaught  [author] Feb 3, 2020 @ 1:27pm 
@KeybdFlyer @Griviues

This was why in the base game all the 'old' trains had the same whistle, and the 'new' trains all had their own shared whistle sound. Because each model file just pointed to either the train_steam_old.lua or train_steam_modern.lua which both had a single 'horn' value that pointed to the same name .wav file.

So what I did was I copied over the entire contents of the soundset file for either new or old depending on the train, changed the 'horn' value to the .wav file that I wanted to use and saved it as a new .lua file with a different name. Then I went to the individual train model file and changed the soundset 'name' value so it would always point at my new soundset.

That did the trick for me, but I'm aware it might not be a perfect solution.
Hypernaught  [author] Feb 3, 2020 @ 1:27pm 
@KeybdFlyer @Griviues

Hi guys, really sorry for not replying for such a long time, didn't come back to this game for a while until the 2nd was announced. I'm more than happy to break down what I did, as it's more of a bodged work-around than anything else after digging around some mods that had their own sound sets and working out how to do it for base trains.

I initially had the bright idea of going into the individual model files (res>models>model>vehicle>train) for each train that was in the base game and setting the horn value in the soundset object to a different corresponding .wav file in the audio files.

Problem was this only initially worked, then the whistles reverted back to a standard soundset (which are found in res>config>soundset), which made me realise that the base game only has two base sound sets for steam train models: train_steam_old.lua and train_steam_modern.lua
KeybdFlyer Jan 14, 2020 @ 8:42pm 
@Griviues I'd be grateful if you'd explain how the "fix" works! I've looked through the files and got a rough idea, but can't grasp exactly what needs to be changed for each model. I made some whistle effects for early locomotives which work fine for a short while but then revert to the default whistle - and it's driving me nuts! :-)
Capitán Alatriste Sep 24, 2019 @ 2:41pm 
Hello there
Griviues Feb 24, 2019 @ 3:22am 
Hey there. I've recently noticed that the issue appears with workshop locomotives (added to the game).

I've nailed down that it happens when a locomotive is sent into a depot and then out again - then the whistle reverts to the default one. I've also been able to find out that if you save the game and reload it, the whistle sounds will be fixed.

I've been wondering how you managed to fix that issue on the vanilla locomotives (I've checked and your fix works with the same reproduction steps), and if it would be possible for me to modify the workshop locomotives the same way you did - in order to fix the reverting whistle issue.

I realise that you may not do Transport Fever mods any more, but I'd like to know your method so perhaps I can get to the bottom of this.
Not_A_KGB_Agent Jan 24, 2019 @ 4:08pm 
im just gonna ask ive asked before but can sombody please make a working railway cannon
DocBrown86 Aug 3, 2017 @ 2:15am 
Hope you eventually get the American ones taken care of. This was really starting to bug me tonight!