say: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<code>([^ ]*)\[\[([a-zA-Z][a-zA-Z0-9_]+)\]\]([^ ]*)<\/code>" to "<code>$1$2$3</code>")
m (Some wiki formatting)
 
(3 intermediate revisions by 2 users not shown)
Line 28: Line 28:
|gr1= Sounds
|gr1= Sounds


|descr= Make unit say given sound. The sound is defined in [[Description.ext#CfgSounds|CfgSounds]]. If the [[Object#Unit|unit]] is a [[Object#Person|person]], it will also perform corresponding lipsync effect provided an appropriate .lip file has been created for this sound.
|descr= Make unit say given sound. The sound is defined in [[Description.ext#CfgSounds|CfgSounds]].
If the [[Object#Unit|unit]] is a [[Object#Person|person]], it will also perform the corresponding lipsync effect provided an appropriate [[Lip File Format|.lip file]] has been [[WaveToLip|created]] for this sound.


* A dead or non-existent unit obviously cannot say anything.
* A dead or non-existent unit obviously cannot say anything.
Line 34: Line 35:
* See also [[playSound]] in order to play a sound wherever the [[cameraOn|camera/player]] is.
* See also [[playSound]] in order to play a sound wherever the [[cameraOn|camera/player]] is.


{{Feature | Informative | [[say]] will mimic either [[say2D]] or [[say3D]] depending on whether it is executed in a cutscene or in a game scene.}}
{{Feature|informative|[[say]] will mimic either [[say2D]] or [[say3D]] depending on whether it is executed in a cutscene or in a game scene.}}


|s1= from [[say]] sound
|s1= from [[say]] sound


|p1= from: [[Object]] - origin of the sound
|p1= from: [[Object]] or [[Array]] of [[Object]]s
* [[Object]] - the sound source
* [[Array]] - format [from, to]:
** from: [[Object]] - sound source
** to: [[Object]] - target


|p2= sound: [[String]] - sound classname
|p2= sound: [[String]] or [[Array]]
* [[String]] - class name of the sound to be played. Defined in CfgSounds including [[Description.ext]]
* [[Array]] - format [sound, maxTitlesDistance, speed]:
** sound: [[String]] - class name of the sound to be played. Defined in CfgSounds including [[Description.ext]]
** maxTitlesDistance: [[Number]] (Optional, default 100) - max. distance in meters at which the sound can be heard
** speed: [[Number]] (Optional, default 1) - pitch of the sound


|r1= [[Nothing]]
|r1= [[Nothing]]


|s2= from [[say]] [sound, maxTitlesDistance, speed]
|x1= <sqf>(units player select 1) say ["whisper1", 5];</sqf>


|p21= from: [[Object]] - origin of the sound
|x2= <sqf>player say "scuba_breath"; // Arma 3 vanilla sound</sqf>
 
|p22= sound: [[String]] - sound classname
 
|p23= maxTitlesDistance: [[Number]] - max distance at which the sound can be heard. Default: 100 m.
 
|p24= speed: [[Number]] - (Optional, default 1) pitch of the sound
 
|r2= [[Nothing]]
 
|s3= [from, to] [[say]] sound
 
|p41= from: [[Object]] - origin of the sound
 
|p42= to: [[Object]] - target
 
|p43= sound: [[String]] - sound classname
 
|r3= [[Nothing]]
 
|s4= [from, to] [[say]] [sound, maxTitlesDistance, speed]
 
|p61= from: [[Object]] - origin of the sound
 
|p62= to: [[Object]] - target
 
|p63= sound: [[String]] - sound classname
 
|p64= maxTitlesDistance: [[Number]] - max distance at which the sound can be heard. Default: 100 m.
 
|p65= speed: [[Number]] - (Optional, default 1) pitch of the sound.
 
|r4= [[Nothing]]
 
|x1= <code>(units player select 1) say ["whisper1", 5];</code>
 
|x2= Arma 3:
<code>player say "scuba_breath";</code>


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

Latest revision as of 15:17, 25 February 2023

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 the 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

Syntax:
from say sound
Parameters:
from: Object or Array of Objects
sound: String or Array
  • String - class name of the sound to be played. Defined in CfgSounds including Description.ext
  • Array - format [sound, maxTitlesDistance, speed]:
    • sound: String - class name of the sound to be played. Defined in CfgSounds including Description.ext
    • maxTitlesDistance: Number (Optional, default 100) - max. distance in meters 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:
player say "scuba_breath"; // Arma 3 vanilla sound

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