Quack O'Neill 11 Posted October 31, 2018 Hi Iv made a hostage rescue scenario, and people can play the slot in coop / multiplayer. but I want there to be a flickering film on the screen in the room with a sound looping infinatly. Description code class CfgSounds { sounds[]={}; class Music1 { name = "Music1"; sound[] = {"\music\ee3.ogg", db+0, 1.0}; titles[] = {0,""}; }; }; Trigger code. tor1 say3D ["Music1", 1000, 3]; I found this script but it locked my computer up. I think it was working but i dont know how fix it. while {true} do { tor1 say3D ["Music1", 1000, 3]; sleep x; } Share this post Link to post Share on other sites
davidoss 552 Posted October 31, 2018 use playSound3D instead. //description.ext by KK __EXEC (MISSION_ROOT = __FILE__ select [0, count __FILE__ - 15]) // trigger on activation code if (isServer) then { _root = parsingNamespace getVariable "MISSION_ROOT"; _sound = _root + "music\ee3.ogg"; playSound3D [_sound, tor1, false, getPos tor1, 10, 1, 50]; }; 1 Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 thank you daviddoss i will try that out. Share this post Link to post Share on other sites
HazJ 1289 Posted October 31, 2018 Or init.sqf: MISSION_ROOT = call { private _arr = toArray (str missionConfigFile); _arr resize (count _arr - 15); toString _arr }; // Also KK I believe... 95% sure! This little baby snippet I've been using for years. Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 I pasted your code into my description file but i got and error when i ran the mission file.if: (encountered instead of '=' I tried just the first lin in the description and the code part in my onActivtion but that didnt work either. Share this post Link to post Share on other sites
HazJ 1289 Posted October 31, 2018 The code part goes in init.sqf or just ditch the isServer check and add directly to initServer.sqf instead. https://community.bistudio.com/wiki/Event_Scripts Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 thanks hazj Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 sorry for being an idiot. so what goes in my onActivation ? every time i change tor1 say3D ["Music1", 1000, 3]; to tor1 playSound3D ["Music1", 1000, 3]; i get errors tor1 playSound3D "Music1"; didnt work either. tor1 playSound3D _sound = _root + "music\ee3.ogg"; also not working. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 31, 2018 3 hours ago, Quack Rejackt said: while {true} do { tor1 say3D ["Music1", 1000, 3]; sleep x; } Did you checked the 2nd ex. ? https://community.bistudio.com/wiki/say3D check: class Music1{name = "Music1";sound[] = {"music\ee3.ogg", db0, 1.0};titles[] = {};}; Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 the sound isnt playing after putting that code in my description file and my init.sqf and i cant work out how to write or rephrase the right code into the OnActivation because thats how the sound was being triggered. what second "ex" ? there is only 1 x in that script and i imagine it means forever or something. Share this post Link to post Share on other sites
HazJ 1289 Posted October 31, 2018 https://community.bistudio.com/wiki/Description.ext#CfgSounds See this. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 31, 2018 16 minutes ago, Quack Rejackt said: putting that code in my description class CfgSounds { sounds[] = {}; //adjust the volume from db0 class Music1{name = "Music1";sound[] = {"music\ee3.ogg", db0, 1.0};titles[] = {};}; }; 20 minutes ago, Quack Rejackt said: second "ex" https://community.bistudio.com/wiki/say3D Example 2: Workaround for dead bodies. private _dummy = "#particlesource" createVehicleLocal ASLToAGL getPosWorld _corpse; _dummy say3D "whatever"; _dummy spawn { sleep 5; //Atleast the length of your sound deleteVehicle _this; }; Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 it don't really make sense to me haz j. playSound "Music1"; if i type this in the On Act it just plays once and its 2D. I had it working as a 3D sound but it wouldnt loop for ever. repleay = true; didnt work. now iv the code you both wrote for me in the right place but why cant i hear the sound. how do i trigger it in the trigger ? like i was before with the cfg Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 oh the the second example sorry george. Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 31, 2018 you can work with say3d or playSound3D either . Just to understand you want this sound to play once it's triggered and then play forever , right ? Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 right so this would work while {true} do { tor1 say3D ["Music1", 1000, 3]; sleep 21; } the audio is 21 seconds Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 yes forever. i dont need it to stop. Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 x as a sleep value crashed the game and so did a value like 25 & a value like 3600 Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 i could make a 2 hour ogg file but thats got to cost more ? Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 31, 2018 2 minutes ago, Quack Rejackt said: sleep 21; } finishing with }; it's good to add the codes in your posts with the code button <> 1 minute ago, Quack Rejackt said: i could make a 2 hour ogg file but thats got to cost more ? Do you mean about the MB ? Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 yes the MB and time to render and convert it compared to just looping a small file. yeah sorry. ill try to keep the posts cleaner. 1 Share this post Link to post Share on other sites
GEORGE FLOROS GR 4207 Posted October 31, 2018 you can find a loopable sound and add some less sleep on the code Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 while {true} do { tor1 say3D ["Music1", 1000, 3]; sleep 21; }; i just tried this and it crashed the game again. Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 why dont replay = true work ? it looks like it used to work. Share this post Link to post Share on other sites
Quack O'Neill 11 Posted October 31, 2018 do you think it crashed because the doppler value is on 3 instead of 1 ? or if i changed the sleep to 7 ? anyway i dont like the way the computer performs when i run this. while {true} do { tor1 say3D ["Music1", 1000, 3]; sleep -; }; my sound is loopable. Share this post Link to post Share on other sites