Skip to content
WhistleWiz edited this page Apr 14, 2024 · 4 revisions

Base audio

CCL will automatically add the basic audio to your car (wheels, brakes, collisions...).

Locomotives will also include those sounds automatically.

Locomotive audio

For locomotives (slugs included), you will need to create an audio prefab. Each child of this prefab should be for 1 sound.

Clips

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

Layered Audio

These are used for any sounds that are constantly affected by ports.

Layers

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.

Dopler

Each sound source you want affected by the doppler effect needs to have a component named DopplerProxy.

LayeredAudioPortReaderProxy

To actually affect the LayeredAudioProxy component, you'll need LayeredAudioPortReaderProxy components on the same object. Multiple can affect the same audio.

Using vanilla systems

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

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.

image

Warning

The GameObjects assigned must have either a LayeredAudioProxy or a CopyVanillaAudioSystem!

Chuffing

Clone this wiki locally