Home   Help Search Login Register  

Author Topic: Play sound at location  (Read 1502 times)

0 Members and 1 Guest are viewing this topic.

Offline UH60MG

  • Members
  • *
Play sound at location
« 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.
« Last Edit: 02 Jun 2008, 20:34:41 by UH60MG »

Offline Rommel92

  • Members
  • *
Re: Play sound at location
« Reply #1 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.

Offline Cheetah

  • Former Staff
  • ****
Re: Play sound at location
« Reply #2 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.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline UH60MG

  • Members
  • *
Re: Play sound at location
« Reply #3 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.


Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Play sound at location
« Reply #4 on: 02 Jun 2008, 23:39:44 »
Also make sure the sound file you use (.ogg) is mono (not stereo).

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Play sound at location
« Reply #5 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?
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: Play sound at location
« Reply #6 on: 03 Jun 2008, 08:00:20 »
The aforementioned script seems overly complicated. Try:

gamelogicName say "soundname"
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: Play sound at location
« Reply #7 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:
urp!