say: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\|x([0-9])= *<code>([^<]*)<\/code>" to "|x$1= <sqf>$2</sqf>")
m (Text replacement - "<code>([^\[]+)<\/code>" to "<sqf>$1</sqf>")
Line 83: Line 83:


|x2= Arma 3:
|x2= Arma 3:
<code>player say "scuba_breath";</code>
<sqf>player say "scuba_breath";</sqf>


|seealso= [[say3D]] [[say2D]] [[playSound]] [[createSoundSource]] [[playSoundUI]]
|seealso= [[say3D]] [[say2D]] [[playSound]] [[createSoundSource]] [[playSoundUI]]
}}
}}

Revision as of 20:08, 13 May 2022

Hover & click on the images for description

Description

Description:
Make unit say given sound. The sound is defined in CfgSounds. If the unit is a person, it will also perform corresponding lipsync effect provided an appropriate .lip file has been created for this sound.
  • A dead or non-existent unit obviously cannot say anything.
  • If the camera is not within given range, title is not shown and the sound will not be heard.
  • See also playSound in order to play a sound wherever the camera/player is.
say will mimic either say2D or say3D depending on whether it is executed in a cutscene or in a game scene.
Groups:
Sounds

Syntax 1

Syntax:
from say sound
Parameters:
from: Object - origin of the sound
sound: String - sound classname
Return Value:
Nothing

Syntax 2

Syntax:
from say [sound, maxTitlesDistance, speed]
Parameters:
from: Object - origin of the sound
sound: String - sound classname
maxTitlesDistance: Number - (Optional, default 100) max distance at which the sound can be heard.
speed: Number - (Optional, default 1) pitch of the sound
Return Value:
Nothing

Syntax 3

Syntax:
[from, to] say sound
Parameters:
from: Object - origin of the sound
to: Object - target
sound: String - sound classname
Return Value:
Nothing

Syntax 4

Syntax:
[from, to] say [sound, maxTitlesDistance, speed]
Parameters:
from: Object - origin of the sound
to: Object - target
sound: String - sound classname
maxTitlesDistance: Number - (Optional, default 100) max distance at which the sound can be heard.
speed: Number - (Optional, default 1) pitch of the sound.
Return Value:
Nothing

Examples

Example 1:
(units player select 1) say ["whisper1", 5];
Example 2:
Arma 3:
player say "scuba_breath";

Additional Information

See also:
say3D say2D playSound createSoundSource playSoundUI

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note