OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting Multiplayer => Topic started by: CAS_Daniel on 10 Oct 2009, 18:06:53

Title: Carrier Background Noise [SOLVED]
Post by: CAS_Daniel on 10 Oct 2009, 18:06:53
Long time no post OFPEC!  :cool2:

I'm making an mp mission where we start on the aircraft carrier. And i've found the .sqf in the first mission of Harvest Red called shipsound.

So now I want to have this sound running in a constant loop, but only audible when on the carrier.

Could someone tell me a good method? Can't seem to figure out how it's been done in the mission.

Thanks.
Title: Re: Carrier Background Noise
Post by: tcp on 10 Oct 2009, 18:34:30
The easiest way is to make a trigger and edit the effects section. I don't think any of the sounds are looping by default, so look at this script: http://85.17.58.182/ed_depot/index.php?action=details&id=592

createSoundSource or say are the scripting commands.

However, a way I've seen it done is to use the editor to place CRRC boats hidden inside the carrier to simulate the boat rocking sounds.
Title: Re: Carrier Background Noise
Post by: Mandoble on 11 Oct 2009, 03:02:40
lets say your sound resource is named "carrier_sound".
You may create a script running from init.sqf and place a gamelogic in the carrier named sound_source
the script code would be:
Code: [Select]
while {true} do
{
   sound_source say3D "carrier_sound";
   Sleep XXX; // Being XXX the duration of the sound less 1 second
};
Title: Re: Carrier Background Noise
Post by: CAS_Daniel on 11 Oct 2009, 15:13:09
Thanks Mandoble!

There's still a slight pause regardless of what I set XXX to, though I think this may be the nature of the resource. Anyway, it's hardly noticeable.

And tcp, nice tip about the CRRCs, I've got one at either end of the deck and the gamelogic of the engine hum in the middle.

Thanks again,

Daniel
Title: Re: Carrier Background Noise [SOLVED]
Post by: nominesine on 12 Oct 2009, 15:28:14
The exact same script can be found in the first campaign mission. If my memory serves me right the loop is 6.8 seconds long. But as you've pointed out it still causes a brief moment of silence before it starts all over again. I don't consider this to be a big problem though.
Title: Re: Carrier Background Noise [SOLVED]
Post by: Ironman on 19 Dec 2009, 08:17:50
Can someone inform me of the sound resource name?
Title: Re: Carrier Background Noise [SOLVED]
Post by: savedbygrace on 28 Nov 2011, 02:26:21
I know this is old but just to conclude the post properly. The following script was what BIS used in that mission. I adjusted the sleep to 6.7 to remove the sound gap. It works splendidly.
Code: [Select]
//shipsound.sqf called in the init;

while {true} do
 {
playSound "LHD_engine";
sleep 6.7;
};