Hello,
Is it possible to have a trigger that plays a sound when a player enters it?
Like say, 25 meters around a VIP you would hear "help me" or something like that?
Hello,
Is it possible to have a trigger that plays a sound when a player enters it?
Like say, 25 meters around a VIP you would hear "help me" or something like that?
Yes, add the sound to description.ext and select the named sound from the effect list.
Regards
Carl Gustaffa - left this game due becoming Steam Exclusive
Try using the Say command rather than playsound. It will force the sound from the object that is saying it and affect the hearing direction of the player rather than just playing the sound globally.
You could also insert the codeinto the condition field of a trigger and you would not need a radius. This would allow you to make the VIP placement random and thus different for every restart. It will also allow you to place the VIP into a building on a higher level and the player would not activate the trigger until he/she is within 25 or whatever distance seems more appropriate of the VIP. A radius would allow the trigger to be tripped as soon as the player entered it's perimeter whether that be in the air or on the ground.Code:(player distance VIP <= 25)
Good luck and happy editing!
@savedbygrace
Well that sounded like a good idea.. but how do i use say commnad instead of playsound?
EDIT:
Like this:
Code:player say ["wolf1", 100];
ORCode:VIP say "sound_file"
if you have subtitles attached to your sound file in the description. That would only allow the subtitle to be displayed if the player was within 5 meters. Change it of course to your choosing.Code:VIP say ["sound_file",5]
If you really want to get dynamic, add multiple sound files that are played at specific distances. Perhaps a shouting "Help" at>>>. A softer cry for help or grunt or something at>>>Code:(player distance VIP >= 25) && (player distance VIP <= 35). Perhaps struggled breathing at>>>Code:(player distance VIP < 25) && (player distance VIP >= 10). That would be three different Triggers. Or to eliminate the need for more triggers just execute a script when the player gets within a certain distance which loops and checks the distance and plays different sound files, exiting once the player reaches the VIP.Code:(player distance VIP > 1) && (player distance VIP < 10)
Just some thoughts. Not trying to make it complicated just mentioning possibilities.
Cant get it to work...
When i get close to the VIP the trigger goes off.. but it says it cant find the file... ?
You have to define the sound file in description.ext: http://community.bistudio.com/wiki/D...ion.ext#Sounds
My apologies, I thought you understood Carl Gustaffa above. (Thanks Janat)
In addition, your actual sound(the one you include to be used) must be placed into the mission folder. Most folks create a sound folder inside the mission folder and then place their sounds there. It helps to keep your mission folder organized. Make sure that the sound entry within the description.ext points to that folder. For example...
The underlined text is the directory to where your sound is located. It can be as long as you like, named whatever you like as long as it is correct. For uniformity though, it's best to maintain some sort of standard that the community recognizes such as a simple "sound" folder.Code:class CfgSounds { this is the introductory bracket for the sounds class sounds[] = {}; class help1 //This begins a new sound class { //This is needed to introduce the class name = "Frosties_Help1"; // What the sound is labeled as in a trigger (e.g. trigger effects) sound[] = {"Sound\help1.ogg", 1, 1}; // filename, volume, pitch titles[] = {};//The text(subtitle) that will appear when the file is played. }; //This is needed to close the class class help2 { name = "Frosties_Help2"; // What the sound is labeled as in a trigger (e.g. trigger effects) sound[] = {"Sound\help2.ogg", 1, 1}; // filename, volume, pitch titles[] = {};//The text(subtitle) that will appear when the file is played. }; }; //this is the closing bracket for the Sounds class
The description.ext file is simply created with notepad and then saved as Description.ext. It also goes inside your mission folder.
Last edited by savedbygrace; Dec 5 2010 at 17:47.
oh, i did miss that part !
Got it to work nowThanks guys!