say2D: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Category:Scripting Commands ArmA2" to "Category:Scripting Commands Arma 2")
m (Some wiki formatting)
 
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma2 |Game name=
|game1= arma2
|version1= 1.00


|1.00|Game version=
|game2= arma2oa
|version2= 1.50


|arg= global |Multiplayer Arguments=
|game3= tkoh
|version3= 1.00


|eff= local |Multiplayer Effects=
|game4= arma3
____________________________________________________________________________________________
|version4= 0.50


| Plays given sound in 2D|DESCRIPTION=
|arg= global
____________________________________________________________________________________________


| from [[say2D]] sound |SYNTAX=
|eff= local


|p1= from: [[Object]] - origin of the sound
|gr1= Sounds
|p2= sound: [[String]] - classname of the sound to be played. Defined in CfgSounds including [[Description.ext]]


| [[Nothing]] |RETURNVALUE=
|descr= Plays given sound in 2D.


| s2 = from [[say2D]] [sound, maxTitlesDistance, speed] |SYNTAX2=
|s1= from [[say2D]] sound


|p21= from: [[Object]] - origin of the sound
|p1= from: [[Object]] or [[Array]] of [[Object]]s
|p22= [sound, maxTitlesDistance, speed]: [[Array]]
* [[Object]] - the sound source
|p23= sound: [[String]] - classname of the sound to be played. Defined in CfgSounds including [[Description.ext]]
* [[Array]] - format [from, to]:
|p24= maxTitlesDistance: [[Number]] - max distance at which the sound can be heard. Default: 100 m.
** from: [[Object]] - sound source
|p25= speed (Optional): [[Number]] - pitch of the sound. Default: 1.
** to: [[Object]] - target


| r2= [[Nothing]] |RETURNVALUE2=
|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


| s3= [from, to] [[say2D]] sound|SYNTAX3=
|r1= [[Nothing]]


|p41= [from, to]: [[Array]]
|x1= <sqf>player say2D "HelloThere";</sqf>
|p42= from: [[Object]] - origin of the sound
|p43= to: [[Object]] - target
|p44= sound: [[String]] - classname of the sound to be played. Defined in CfgSounds including [[Description.ext]]


| r3= [[Nothing]] |RETURNVALUE3=
|x2= <sqf>[player, _officer] say2D ["HelloThere", 50, 0.9];</sqf>


| s4 = [from, to] [[say2D]] [sound, maxTitlesDistance, speed] |SYNTAX4=
|seealso= [[say]] [[say3D]] [[playSound]] [[createSoundSource]] [[playSoundUI]]
 
|p61= [from, to]: [[Array]]
|p62= from: [[Object]] - origin of the sound
|p63= to: [[Object]] - target
|p64= [sound, maxTitlesDistance, speed]: [[Array]]
|p65= sound: [[String]] - classname of the sound to be played. Defined in CfgSounds including [[Description.ext]]
|p66= maxTitlesDistance: [[Number]] - max distance at which the sound can be heard. Default: 100 m.
|p67= speed (Optional): [[Number]] - pitch of the sound. Default: 1.
 
| r4= [[Nothing]] |RETURNVALUE4=
____________________________________________________________________________________________
 
|x1= <code>[[player]] [[say2D]] "HelloThere";</code> |Example 1=
 
|x2= <code><nowiki>[</nowiki>[[player]], _officer] [[say2D]] ["HelloThere", 50, 0.9];</code> |Example 2=
____________________________________________________________________________________________
 
| [[say]], [[say3D]], [[playSound]], [[createSoundSource]] |SEEALSO=
 
|  |MPBEHAVIOUR=
}}
}}
<h3 style='display:none'>Notes</h3>
<dl class='command_description'>
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style='display:none'>Bottom Section</h3>
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]

Latest revision as of 16:07, 25 February 2023

Hover & click on the images for description

Description

Description:
Plays given sound in 2D.
Groups:
Sounds

Syntax

Syntax:
from say2D 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:
player say2D "HelloThere";
Example 2:
[player, _officer] say2D ["HelloThere", 50, 0.9];

Additional Information

See also:
say say3D 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