Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:1.00

Description

Description:

Commands the unit to make the given sound (has no effect on dead or non-existing units, unlike playSound, which always plays a sound at the player location).

When the unit is a person, it also performs the corresponding lipsync effect, provided an appropriate .lip file is available for this sound.

If subtitles are defined for the sound, they appear if the "speaker" is within 5m of the listener.

If alternative syntax is used, and a sound speed is defined, then the actual display time is calculated by the following formula: speed * (duration + defaultTime), where duration is taken from the sound definition in CfgSounds (see Class CfgSounds in the VBS3 Developer Reference), and defaultTime is taken from CfgTitles >> defaultTime (currently always 10).

Examples:

  • If speed is 2 and subtitle duration 2, then the subtitle appears for 24 seconds: 2 * ( 2 + 10 )
  • If speed is 0.1 and subtitle duration 5, then the subtitle appears for 1.5 seconds: 0.1 * ( 5 + 10 )

If the delay and duration are defined in sound subtitle (in CfgSounds), and the actual length of the sound is shorter than the specified delay, then the sound is repeated, until it matches the duration (for example, the sound is 1 second long, but the delay is set to 5, so the sound is repeated 5 times). The sound is defined in the CfgSounds class in description.ext (see Scripting with description.ext in the VBS3 Scripting Manual) or CfgSounds (see Class CfgSounds in the VBS3 Developer Reference).

Syntax

Syntax:unit say sound
Parameters:
  • unit: Object - Affected unit.
  • sound: String - Sound class name.
Return Value:Nothing

Alternative Syntax

Syntax:unit say [sound, distance, speed]
Parameters:
  • unit: Object - Affected unit.
  • sound: String - Sounds class name.
  • distance: Number - Maximum distance at which subtitles appear.
  • speed: Number - Factor for the subtitle display duration (optional).
Return Value:Nothing

Examples

Examples:

car1 say "vbs2_carHorn"player say ["M11v02",5,2]

Demo missions:

Additional Information

See also: playSound, createSoundSource
Multiplayer:
Problems:

Notes