Home   Help Search Login Register  

Author Topic: Attach sound to projectile  (Read 1488 times)

0 Members and 1 Guest are viewing this topic.

Offline Dobermann

  • Members
  • *
  • Ready to disturb you anytime
Attach sound to projectile
« on: 11 Jul 2007, 13:28:30 »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Attach sound to projectile
« Reply #1 on: 11 Jul 2007, 13:58:20 »
Configure your sound in description.exp

Code: [Select]
class CfgSounds
{
sounds[] = {D30_sound};

class D30_sound
{
name = "D30_sound";
sound[] = {"D30_sound.ogg", db-0, 1.0};
titles[] = {0};
};
};

Then, when you get the round object:
Code: [Select]
_object say "D30_sound";

D30_sound.ogg should be "mono" and stored into the "Sound" folder of your mission.

Offline Dobermann

  • Members
  • *
  • Ready to disturb you anytime
Re: Attach sound to projectile
« Reply #2 on: 13 Jul 2007, 02:14:31 »
Code: [Select]
this AddEventHandler ["Fired",{[_This Select 0, NearestObject [_This Select 0,_This Select 4]] ExecVM "arisound.sqs"}]
The arisound.sqs looks like this:
Code: [Select]
_Gun= _This Select 0;
_Round= _This Select 1;

//Length of the sound sample in seconds
_SoundDuration=2;

WaitUntil
       {
_Round Say "arifly";

       Sleep _SoundDuration;

       !(Alive _Round)
       };

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Attach sound to projectile
« Reply #3 on: 13 Jul 2007, 02:19:52 »
The game runs into trouble when an object is saying something on the move. I had a helicopter flying around me and I tried to simulate loud speakers on it. I used the "Say" command and ingame it warped terribly. Speeding up and slowing down as the chopper flew about.

Unfortunatley I never got over the problem. :confused:
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."

Offline Dobermann

  • Members
  • *
  • Ready to disturb you anytime
Re: Attach sound to projectile
« Reply #4 on: 13 Jul 2007, 08:25:00 »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Attach sound to projectile
« Reply #5 on: 13 Jul 2007, 09:52:30 »
In sound mods the sounds are defined in the addond config, not in any mission, and that is totally different thing than the one you're trying to achieve here..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Dobermann

  • Members
  • *
  • Ready to disturb you anytime
Re: Attach sound to projectile
« Reply #6 on: 13 Jul 2007, 11:29:47 »
I know but the principle should be the same as the projectile in both cases is the sound emitter and I do not think that
those emitters are handled different by the engine.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Attach sound to projectile
« Reply #7 on: 13 Jul 2007, 11:58:41 »
I use the method described above for my missiles, and the "object class" of these missiles is in most cases a missile, a bomb or a shell. So far the sound works well, while the maximum speed I did test is only around 900 m/s.

You may do a test, attach a camera to the your projectile (a _shell switchCamera "EXTERNAL" should be enough) and check how that sound is heard this way, because may be your problem is with the sound propagation system of ArmA.

Offline Dobermann

  • Members
  • *
  • Ready to disturb you anytime
Re: Attach sound to projectile
« Reply #8 on: 16 Jul 2007, 21:18:32 »