bombajack Posted August 1, 2015 Report Share Posted August 1, 2015 Anybody have an idea how to make ambient sound as A2? Randomly selected track on the background of the game ..? Must be on server side,because it would be mission files too big... Thanks to all scripters ;) Link to comment Share on other sites More sharing options...
0 Sp4rkY Posted August 1, 2015 Report Share Posted August 1, 2015 Impossible... At least serverside because every player needs the soundfile(s) to here it. Sounds and Pictures have to be placed in missionfile, same as vehicle textures and so on. Link to comment Share on other sites More sharing options...
0 bombajack Posted August 1, 2015 Author Report Share Posted August 1, 2015 Impossible... At least serverside because every player needs the soundfile(s) to here it. Sounds and Pictures have to be placed in missionfile, same as vehicle textures and so on. Then how to do on Missionfile? Link to comment Share on other sites More sharing options...
0 Sp4rkY Posted August 1, 2015 Report Share Posted August 1, 2015 //description.ext: class CfgSounds { sounds[] = {}; class track1 { name = "track1"; sound[] = {"track1.ogg", 1.0, 1}; titles[] = {}; }; class track2 { name = "track2"; sound[] = {"track2.ogg", .8, 1}; titles[] = {}; }; class track3 { name = "track3"; sound[] = {"track3.ogg", 1.0, 1}; titles[] = {}; }; }; //or you can use CfgMusic (keep in mind, for this the player have to activate his music volume at ingame options to here anything) class CfgMusic { tracks[]={}; class track1 { name = "track1"; sound[] = {"track1.ogg", db+0, 1.0}; }; class track2 { name = "track2"; sound[] = {"track2.ogg", db+0, 1.0}; }; class track3 { name = "track3"; sound[] = {"track3.ogg", db+0, 1.0}; }; }; //the sqf from where to start the sounds: private "_tracks"; _tracks = ["track1","track2","track3"] call BIS_fnc_selectRandom; playSound _tracks; //or playMusic _tracks; Untested, but it should works this way. cheers btw: no need to quote a message directly after itself. :) Link to comment Share on other sites More sharing options...
0 bombajack Posted August 1, 2015 Author Report Share Posted August 1, 2015 sqf must be called from init?Like []execVM ambient.sqf ? Link to comment Share on other sites More sharing options...
0 bombajack Posted August 1, 2015 Author Report Share Posted August 1, 2015 And one more Q: And how do pause between songs as the A2? Link to comment Share on other sites More sharing options...
0 Sp4rkY Posted August 1, 2015 Report Share Posted August 1, 2015 yes from init.sqf, but best thing is, tell me, "how" you want to play this stuff ? Explain a bit excactlier... In my example it would run only one track at one server period. It should be only an example ;) Link to comment Share on other sites More sharing options...
0 bombajack Posted August 1, 2015 Author Report Share Posted August 1, 2015 Know you game DayZ Epoch (A2) and ambient sound in it? :) This is it...Randomly play track,but randomly gaps between tracks... ..if you know what i think... Thx. Link to comment Share on other sites More sharing options...
0 Sp4rkY Posted August 1, 2015 Report Share Posted August 1, 2015 Sure i know it, but i don´t can remember the ambient sound stuff :) It´s a long time ago... I could write you something like your wish but i have to say i dont can give you predictions for the performance because i should use some waitUntils or sleep commands to get this working. Perhaps i find a better way, but also then i don´t can say anything about the performance. You can only give it a try. I would use playSound for this because this is hearable for everyone (it doesnt matter if the players music volume is activated or not), but with playSound you dont can interrupt the music playing... Only that u know. <_< Link to comment Share on other sites More sharing options...
0 Sp4rkY Posted August 1, 2015 Report Share Posted August 1, 2015 Test this one, but its untested and i give no warranty if it works: //the sqf from where to start the ambient: private["_tracks","_minGap","_maxGap"]; _tracks = ["track1","track2","track3"]; //insert the "names" of the soundfiles you described in description.ext "without" file-extension _minGap = 3; //number in minutes of the smallest gap between the tracks //DON´T USE A SMALLER NUMBER THAN THE SHORTEST SOUNDLENGTH!!! _maxGap = 10; //number in minutes of the longest gap between the tracks /******* dont edit below ********/ private["_minT","_maxT","_rndT"]; _minT = (_minGap *60); _maxT = (_maxGap *60); _rndT = round(random _maxT) _minT; while{true}do{ _rndTrck = _tracks call BIS_fnc_selectRandom; playSound _rndTrck; sleep _rndT; //perhaps use of uiSleep is possible }; Surely anybody else have a better way to do this, but this is my attempt in a few minutes :P Give response about functionality please, cheers Link to comment Share on other sites More sharing options...
0 bombajack Posted August 1, 2015 Author Report Share Posted August 1, 2015 Ok..thank you so much.I give you feedback when i try it.... Link to comment Share on other sites More sharing options...
0 unerground2 Posted August 1, 2015 Report Share Posted August 1, 2015 Test this one, but its untested and i give no warranty if it works: //the sqf from where to start the ambient: private["_tracks","_minGap","_maxGap"]; _tracks = ["track1","track2","track3"]; //insert the "names" of the soundfiles you described in description.ext "without" file-extension _minGap = 3; //number in minutes of the smallest gap between the tracks //DON´T USE A SMALLER NUMBER THAN THE SHORTEST SOUNDLENGTH!!! _maxGap = 10; //number in minutes of the longest gap between the tracks /******* dont edit below ********/ private["_minT","_maxT","_rndT"]; _minT = (_minGap *60); _maxT = (_maxGap *60); _rndT = round(random _maxT) _minT; while{true}do{ _rndTrck = _tracks call BIS_fnc_selectRandom; playSound _rndTrck; sleep _rndT; //perhaps use of uiSleep is possible }; Surely anybody else have a better way to do this, but this is my attempt in a few minutes :P Give response about functionality please, cheers doesnt work for me i called the sounds from a custom pbo but path should be set correctly Link to comment Share on other sites More sharing options...
0 Sp4rkY Posted August 1, 2015 Report Share Posted August 1, 2015 custom pbo... serverside ? If yes, then look at post #2. The script itself i will test later, then i give response if it works :) EDIT: Correct, it fails... Actually work in progress, i post the finished script if im done.... EDIT 2: It´s running, i will post a tutorial in a few minutes :D unerground2 1 Link to comment Share on other sites More sharing options...
0 bombajack Posted August 1, 2015 Author Report Share Posted August 1, 2015 custom pbo... serverside ? If yes, then look at post #2. The script itself i will test later, then i give response if it works :) EDIT: Correct, it fails... Actually work in progress, i post the finished script if im done.... EDIT 2: It´s running, i will post a tutorial in a few minutes :D You are simply the best :D unerground2 and Sp4rkY 2 Link to comment Share on other sites More sharing options...
0 Sp4rkY Posted August 1, 2015 Report Share Posted August 1, 2015 Well done! It should be found in a few time at the Scripts section in this forum, it still has to be checked from admins here ;) unerground2 1 Link to comment Share on other sites More sharing options...
0 READTHESCROLL Posted August 2, 2015 Report Share Posted August 2, 2015 I wonder if you could setup triggers so when a player enters a certain zone the background noise changes? Salt flats would have a windy-er sound to them, forest areas maybe would maybe have more wildlife sounds, etc.. Link to comment Share on other sites More sharing options...
0 KiloSwiss Posted August 2, 2015 Report Share Posted August 2, 2015 Use playMusic (so players have control over the volume and/or can turn it off) and work with the appropriate musicEventHandlers for it https://community.bistudio.com/wiki/Arma_3:_Event_Handlers#addMusicEventHandler @READTHESCROLLThere are better ways to get the terrain & surroundings, without triggers.Look how it is done in mods like JSRS. Greez Kilo Link to comment Share on other sites More sharing options...
0 Sp4rkY Posted August 2, 2015 Report Share Posted August 2, 2015 yes, playMusic would be a better way to change sounds etc... because they can forced to stop, which isnt possible with playSound until you use an attached object to the player. _____________________________________________________________ Because my release threat is still in checking, i will post the github link here for now: https://github.com/SPKcoding/SPK_RAS Updates will come... Link to comment Share on other sites More sharing options...
0 bombajack Posted August 7, 2015 Author Report Share Posted August 7, 2015 Sparky..god job! ;) Link to comment Share on other sites More sharing options...
0 bombajack Posted August 7, 2015 Author Report Share Posted August 7, 2015 One more thing... It would be good if player enter to City start ambient...into any City.But then you need lot of triggers..right? Link to comment Share on other sites More sharing options...
Question
bombajack
Anybody have an idea how to make ambient sound as A2?
Randomly selected track on the background of the game ..?
Must be on server side,because it would be mission files too big...
Thanks to all scripters ;)
Link to comment
Share on other sites
19 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now