Home   Help Search Login Register  

Author Topic: Accessing a Trigger's environmental sounds  (Read 754 times)

0 Members and 1 Guest are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Accessing a Trigger's environmental sounds
« on: 26 May 2005, 20:14:36 »
A trigger can play some environmental sounds for example a bird singing.  

If I de-pbo the sounds in the mission I find all the components of the bird song, but not the song in its entirity, so clearly the coding behind the trigger is playing these individual components in some sort of random order to give a continuous and ever changing sound.

I want to be able to get at the sound that the trigger uses.  At the moment I am using triggers to play the sound, but this introduces lag and the need for global variables.  I tried using just one trigger and setPosing to where I want it, but it seems that if a trigger is setPosed it locates itself at sealevel - so I can't hear the sounds it is making because it is too far away.  I may resort to writing my own random snippet player and using a GL.  But before going there I thought I would check if anyone know how to access what is already built in to OFP.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Accessing a Trigger's environmental sounds
« Reply #1 on: 26 May 2005, 20:28:54 »
Do you mean the sounds like:

hedgesparrow or

skylark etc.


Planck
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Accessing a Trigger's environmental sounds
« Reply #2 on: 26 May 2005, 20:51:50 »
Exactly.

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Accessing a Trigger's environmental sounds
« Reply #3 on: 26 May 2005, 21:43:29 »
I would assume that it would be found somewhere in the game's config. Download one from the breath site (no link at hand), and try searching thru it. I'm sure there is just a list of random sounds, and random intervals at which to play those sounds. Sorry I can't help more.
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Accessing a Trigger's environmental sounds
« Reply #4 on: 26 May 2005, 22:24:38 »
Thanks.  I'll have a look.  This 'simple' task is turning into a nightmare

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Accessing a Trigger's environmental sounds
« Reply #5 on: 26 May 2005, 22:46:47 »
Yes, its in the cfgSFX section.

Small example:

Code: [Select]
class skylark
   {
      sounds[]={"sing1","sing2","sing3","sing4","sing5","sing6","sing7"};
      name="$STR_CFG_SFX_SKYLARK";
      sing1[]={"animals\skylark7",0.01,1,0.1,0.2,0.4,1};
      sing2[]={"animals\skylark6",0.01,1,0.2,0.2,0.3,1};
      sing3[]={"animals\skylark5",0.01,1,0.1,0.1,0.2,1.2};
      sing4[]={"animals\skylark4",0.01,1,0.2,0.1,0.2,1.2};
      sing5[]={"animals\skylark3",0.01,1,0.1,0.3,0.4,0.75};
      sing6[]={"animals\skylark2",0.01,1,0.1,0.2,0.4,0.8};
      sing7[]={"animals\skylark1",0.01,1,0.1,0.1,0.5,0.8};
      empty[]={"","","","",1,5,40};
   };

The sounds of course are in the Sound.pbo in .wav and .wss format



Planck
« Last Edit: 26 May 2005, 22:48:40 by Planck »
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Accessing a Trigger's environmental sounds
« Reply #6 on: 26 May 2005, 23:11:23 »
I fear I need my hand held on this one.

I have the 1.91 commented config files and can find nothing that looks like  SFX.  I am either missing is or I don't have the right files to start with.

Once I have it how would I use it?  Is this something I would put in my description.ext and then use:

GL say "skylark" or playsound "skylark"?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Accessing a Trigger's environmental sounds
« Reply #7 on: 26 May 2005, 23:18:39 »
I never thought about cfgSFX in description.ext, I'm not even sure if it would work.

You should be able to play all the sounds with playsound, I'm not sure how the game plays them or how it decides on the order.

I  imagine it is done by the game engine from the triggers.

I have posted below a complete copy of the cfgSFX section from the game config.bin.


Planck
I know a little about a lot, and a lot about a little.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Accessing a Trigger's environmental sounds
« Reply #8 on: 27 May 2005, 07:36:55 »
Planck:  Thank you so much.  I must figure out how to get into bins and what to do when I get there.