monkeybrain Posted July 5, 2014 Report Share Posted July 5, 2014 So I want to add a sound to a spot on a map when you walk into that area. Here is what I have so far. Description.ext class CfgSounds { sounds[] = {introSong,CaveAmbient}; class introSong { name="introSong"; sound[]={introSong.ogg,0.9,1}; titles[] = {}; }; class CaveAmbient { name="CaveAmbient"; sound[]={\sound\CaveAmbient.ogg,1,1.0}; titles[] = {}; }; }; CaveAmbient is the sound. My trigger located in a scripts folder if (isServer) then { __this = createTrigger ["EmptyDetector", [6553.4043, 14202.878, 81.481537]]; _this setTriggerArea [100, 100, 0, false]; _this setTriggerActivation ["WEST", "PRESENT", false]; _this setTriggerStatements ["this", "playSound ""CaveAmbient"";", ""]; _trigger_0 = _this; }; which i exectued in the init folder [] execVM "Scripts\trigger.sqf"; Anyone done this before? Link to comment Share on other sites More sharing options...
0 Halvhjearne Posted July 5, 2014 Report Share Posted July 5, 2014 you need to change your statement, or it will not work, try this: _this setTriggerStatements ["(vehicle player) in thislist", "playSound ""CaveAmbient"";", ""]; Link to comment Share on other sites More sharing options...
0 monkeybrain Posted July 5, 2014 Author Report Share Posted July 5, 2014 Hrmm that didn't see to work, maybe I have done something else wrong? Link to comment Share on other sites More sharing options...
0 Halvhjearne Posted July 5, 2014 Report Share Posted July 5, 2014 you propperbly need to set the trigger client side aswell then, but why didnt you just add the trigger in your mission.sqm? Link to comment Share on other sites More sharing options...
0 monkeybrain Posted July 5, 2014 Author Report Share Posted July 5, 2014 Because I have never done this before : P, ill give it a go Link to comment Share on other sites More sharing options...
0 monkeybrain Posted July 5, 2014 Author Report Share Posted July 5, 2014 ok i got the sounds working heres my mission sqm class item8 { position[]={6553.4043,81.481537,14202.878}; activationBy="WEST"; interruptable=1; repeating=1; age="UNKNOWN"; class Effects { voice="CaveAmbient"; }; }; I am also looping my sound Musicloop.sqf: while {true} do { playsound "CaveAmbient"; sleep 21; }; but I can't seem to get the deactivation trigger to work. When I teleport away from the area the sound continues looping heres what i have for the trigger _this setTriggerStatements ["this", "playSound ""CaveAmbient""; music = true; nul = [] execVM ""Musicloop.sqf"";", "music=false"]; Link to comment Share on other sites More sharing options...
0 Halvhjearne Posted July 5, 2014 Report Share Posted July 5, 2014 you are quite confusing and dosnt make much sense, but ill try and explain this for you in your first example you have no activation, deactivation or condition line, making it impossible to do much with your music loop, also you have no way to exit the loop, so it will obviusly keep running until the player logs off. i propose you do something like this: onactivation: cave = execVM 'Musicloop.sqf'; ondeactivation: terminate cave; monkeybrain 1 Link to comment Share on other sites More sharing options...
0 monkeybrain Posted July 6, 2014 Author Report Share Posted July 6, 2014 on activation I now have playSound "CaveAmbient"; cave = execVM 'Musicloop.sqf'; on deactivation i now have terminate cave; the sound loops keeps playing after i leave the trigger area, i tried without playSound "CaveAmbient" but still same problem nvm I turned repeating on and it works now. Thanks! Also do you know if it possible to have a trigger to make part of the map darker? I have a cave but its pretty bright inside. Would be nice to make it darker if that's possible. Link to comment Share on other sites More sharing options...
0 TheVampire Posted July 6, 2014 Report Share Posted July 6, 2014 on activation I now have playSound "CaveAmbient"; cave = execVM 'Musicloop.sqf'; on deactivation i now have terminate cave; the sound loops keeps playing after i leave the trigger area, i tried without playSound "CaveAmbient" but still same problem nvm I turned repeating on and it works now. Thanks! Also do you know if it possible to have a trigger to make part of the map darker? I have a cave but its pretty bright inside. Would be nice to make it darker if that's possible. Unless you want to write custom dialog, it's not possible. Link to comment Share on other sites More sharing options...
0 monkeybrain Posted July 7, 2014 Author Report Share Posted July 7, 2014 Hrmm how do you change it so when one person enters the area it doesn't play to the whole server nvm I think I just need a condition in the sqm Link to comment Share on other sites More sharing options...
Question
monkeybrain
So I want to add a sound to a spot on a map when you walk into that area.
Here is what I have so far.
Description.ext
CaveAmbient is the sound.
My trigger located in a scripts folder
which i exectued in the init folder
[] execVM "Scripts\trigger.sqf";
Anyone done this before?
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now