Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

**MOVE TO DEVELOPERS GUIDE - CAR SOUNDS** AND DELETE THIS TEXT!

Table of Contents

Things you'll need:

...

The following event types exist:

Type IdentifierPropertyDescriptionInherits from
bank
Base event. All other types inherit all properties from it. If it contains any other events, when fired, it will fire those events passing them the same event name it was fired with. Generally unused.-

eventsAn array containing other events this event can fire and interact with.

volume(optional) Either a fixed number or a curve (see doc "Volume and Pitch Curves"). Special property: Applies to all children ontop of their own volume.

pitch(optional) Same as volume.

position(optional) An array with 3 elements containing the local position of this emitter relative to its parent. If no parent exists or all parents have the offset 0,0,0, this is relative to the car's pivot point.

direction(optional) An array with 3 elements defining the euler angles of the emitter. This is only useful if an event related to this event uses a cone shape (see burst type)

nameIdentifier. Used to fire the event. This only has to exist if this event's parent is a type that fires by name, otherwise it may be used for identification but is not required by the system.
multibank
Contains multiple events and only ever plays one at a time. Commonly used to separate between internal and external sounds, or different types of terrain for road noise. When an event of this type gets fired, the name of the event that gets fired will be passed on to the active child of it.bank

bankKeyString containing the name of the property that will be used to determine which event to play. For example, "camera-in-out" will lead to either "inside" or "outside" being played depending on where the camera is. When the camera changes position, the property will automatically update this event causing it to switch the event it plays back - which could be an event containing the whole spectrum of events needed to represent a full car for one of the camera perspectives in this case.

allowEmpty(optional) If true, when the bankKey refers to an event name that does not exist, it will stop playing until the bankKey refers to an existing event again. Otherwise it will simply continue playing the previously valid event.
crossfade
This event is identical to multibank, except it crossfades between events when it switches, causing a smoother transition.multibank

timeTime in seconds for the crossfade to complete.

exponentShape of the fade. 0 is linear, 1 is exponential. Anything in-between is valid.
multi
Simply plays back every event it contains. If called as part of a loop, all contained events must be loops. If called as a burst, they must be burst.bank




random
Randomly picks a contained event to play it back each time it gets fired. In case of loops, this selection only changes when the loop stops. Contained events may be empty or with invalid samples in order to create an event that only plays sometimes.bank




burst
Plays a single burst sound.bank

cone(optional) Array with 3 elements specifying radius at which to start fading out, radius at which to end fading out, gain when fully faded out. Used in combination with direction to create sounds that can only be heard from certain directions. Very useful for separating exhaust and intake engine samples.

samplePath to sample this event will play back. This path can be local to the vehicle's subdirectory in moddev and the sample does not have to be in a MAS archive. Presently, only 16-bit PCM WAV files are officially supported, but certain other PCM formats might work. Stereo samples will be downmixed to mono, so ideally just use mono mixes. This is necessary for attenuation and panning.

randomSample(optional) If bigger than 0, it determines the random playback offset each time this event gets fired.

refDistance(optional) Distance (in m) where gain will be 1.0. Reasonable defaults have been chosen, so this is not required. If used, try applying it to the whole car for consistency. Automatic inheritance should make that a two line change to the file.

rolloff(optional) Rolloff. Works together with refDistance. Lower numbers mean higher attenuation.

doNotRestart(optional) If true, will prevent the sample from being fired again when it's still in the middle of playing.

effect(optional) String referring to the name of the environment effect used for this event.

filter(optional) String referring to the name of the direct path filter used for this event. Combine with effects to achieve a sensation of depth and a wide sound stage!
loop
Plays a looping soundburst

loopSample(optional) If defined, specifies offset in samples where the sound will loop when it reaches the end. This can be used to add fake transmission wobble or more pleasant back-on-throttle or post-shift effects without hearing them in a loop, and can dramatically reduce the length of a sample used for loops compared to the old system before it inevitably repeats in an immersion-breaking manner.
template
This is a special type. It does not inherit from anything, but is used to create more events from a single input to avoid lots of copy-paste work for easy iteration. Useful for defining only one wheel, but applying the info to all four wheels instead. See Templates section for more info!


List of Events and Variables

...