OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: UH60MG on 02 Jun 2008, 19:45:43

Title: Play sound at location
Post by: UH60MG on 02 Jun 2008, 19:45:43
Hi,

Want an alarm to play at unspecified times throughout a mission.

Is there a command to play a sound at a given location? I know there's playsound but that just plays the sound as ambient noise.
Title: Re: Play sound at location
Post by: Rommel92 on 02 Jun 2008, 21:17:43
Say Command
http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=s#277

Regarding the unspecified times, do you mean random intervals between the sound? Ie:
Code: [Select]
while {alive ROADCONEX} do
{
sleep (random 500);
ROADCONEX say ["alarm",200];
};

The source must be an object (or GameLogic?), it canno't (AFAIK) be a position. It will also stop transmitting on death. A roadcone is used for example above.
Title: Re: Play sound at location
Post by: Cheetah on 02 Jun 2008, 21:26:07
I suggest using a gamelogic, it cannot be killed/destroyed and can be placed anywhere. Of course, some objects are really easy to use for this purpose.
Title: Re: Play sound at location
Post by: UH60MG on 02 Jun 2008, 22:05:16
That's just what I was looking for thanks.

A game logic could be used instead of a cone.

Title: Re: Play sound at location
Post by: Mandoble on 02 Jun 2008, 23:39:44
Also make sure the sound file you use (.ogg) is mono (not stereo).
Title: Re: Play sound at location
Post by: johnnyboy on 03 Jun 2008, 05:26:18
I'm curious, would the sound move if the source object moved?

Like a long fading scream (a single .ogg file), if someone falls off a bridge or building?
Title: Re: Play sound at location
Post by: nominesine on 03 Jun 2008, 08:00:20
The aforementioned script seems overly complicated. Try:

gamelogicName say "soundname"
Title: Re: Play sound at location
Post by: Mr.Peanut on 03 Jun 2008, 16:20:52
Quote
would the sound move if the source object moved? Like a long fading scream (a single .ogg file), if someone falls off a bridge or building?
:yes: