OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: pazuzu on 23 Sep 2005, 19:23:40

Title: Ambient sounds
Post by: pazuzu on 23 Sep 2005, 19:23:40
I'm trying to make some ambient music which I want to come from radio in my mission. I got the script from the Editors depot and it looks like this:

#loop
? (alive radio1)
~55
radio1 say "radio"
goto "loop"
#end

I'm trying to just use ofp music already in game(Like track1) but it wont work.

Does this require an ogg file in order to work?

Thanks.
Title: Re:Ambient sounds
Post by: THobson on 23 Sep 2005, 20:30:07
I suspect the problem is that music cannot be said, it has to be played.  If you really do want to use say rather than playMusic then I guess you do need to convert the music to an ogg file and put it in the sound folder.

Please treat this as a fairly intelligent guess - not an absolute fact.  You can test it by changing the say to playMusic
Title: Re:Ambient sounds
Post by: pazuzu on 23 Sep 2005, 21:02:07
Ok thank you.


I looped music to a truck in another map of mine but now I cant see what I did...I thought I used the say command...but then I had an ogg file for the music so...

I'll test it

Thanks for replying.
Title: Re:Ambient sounds
Post by: The-Architect on 24 Sep 2005, 21:51:22
Put this in your Description.ext where ambience is the name of your .ogg file.
Then call the file from a trigger or a script.

class CfgEnvSounds
{
   sounds[]={ambience};

   class Ambience
   {
      name="Ambience";
   sound[]={"Ambience.ogg",db-20,0,1};
   soundNight[]={"Ambience.ogg",db-40,0,1};
   };
};
Title: Re:Ambient sounds
Post by: pazuzu on 24 Sep 2005, 22:53:25
I dont have an ogg file...

I was wondering if this could be done with the ingame music or sounds?


Title: Re:Ambient sounds
Post by: The-Architect on 25 Sep 2005, 09:06:18
Ok dude, read carefully.

Make a trigger round your player.

Activation: Anybody
Present

On Activation: [] exec "LoopMusic.sqs"

Then put the put the attached script into your mission folder.

Save then preview.

What I did was time a Flashpoint music track with a stopwatch and then make it loop after that time. Simple.

For a full list of the music tracks in Flashpoint see this,
http://www.ofpec.com/editors/resource_view.php?id=843
Title: Re:Ambient sounds
Post by: pazuzu on 25 Sep 2005, 21:19:15
I appreciate your reply but your method doesn't work.

I want the music to have a source(A radio) so that the music is ambient. The volume should fade as you get farther from radio so it sounds like its coming from the radio. I know this can be done with ogg files because I've done it but I'm unable to get the ingame music to play this way.

Edit: I think THobson is right the music would have to be put in sound folder as ogg file to use the "say" command and get that ambient effect.

Thanks again.
Title: Re:Ambient sounds
Post by: The-Architect on 26 Sep 2005, 00:38:15
You didn't say anything about that.

Why don't you tell me what the track you want played is and I'll have a go at doing it for you.