-
Notifications
You must be signed in to change notification settings - Fork 7
Audio
CCL will automatically add the basic audio to your car (wheels, brakes, collisions...).
Locomotives will also include those sounds automatically.
For locomotives (slugs included), you will need to create an audio prefab. Each child of this prefab should be for 1 sound.
Clips are single use sounds that happen on certain events. For these, you use an AudioClipPortReader component. You can use all clips together on the same GameObject.
Examples of usage are:
- Turning off a diesel engine
- Contactors changing on the TMs
- Compressor finished charging reservoirs
These are used for any sounds that are constantly affected by ports.
Layered audio uses layers for complex output. The DE6's engine at idle has 3 layers, the engine itself, the shaft, and the compressor's whine.
Each layer has its own audio source. Position them where you want the sound to come from.
Each sound source you want affected by the doppler effect needs to have a component named DopplerProxy.
To actually affect the LayeredAudioProxy component, you'll need LayeredAudioPortReaderProxy components on the same object. Multiple can affect the same audio.
It is also possible to simply use an audio system from one of the base game's locomotives. Using the component CopyVanillaAudioSystem, you only need to position the GameObject where you want the sound to come from, and assign the correct port(s).
Some sound systems with multiple layers allow you to also change the position of each of them (like the DE6's mentioned above).
Cylinder cocks require a bit more setup than your usual sound, and have a dedicated component.
It is important to note the order in which you assing each cylinder's audio. The first cylinder should have its piston at one of the ends.

Warning
The GameObjects assigned must have either a LayeredAudioProxy or a CopyVanillaAudioSystem!
The chuffing of a steam locomotive is extremely complex, and have their own dedicated components.
The main component, it controls everything else.
The individual chuffs correspond to the clips that play per chuff normally, for 3 different pressure levels. Each cylinder usually has 2 chuffs per revolution, so most locomotives will need 4 chuffs here.
Water and ash chuffs are similar, but use audio clips directly.
Finally, the chuff loops correspond to chuffing loop audio, instead of a single chuff sound, to handle high frequency chuff outputs.
A simple container for chuff variations in the individual chuff clips.
Controls the volume of the chuffing loop from the chuff frequency.
Controls the individual chuff clips.
Because the chuffing setup is extremely complex, you can instead use the vanilla chuffing setup with the component CopyChuffSystem. All you need to do is assing the ports and CCL will take care of the rest.
Note
Currently, this only sounds correct with 2 cylinder locomotives.