unerground2 Posted April 3, 2015 Report Share Posted April 3, 2015 Hello i would like to bring back the random scenery sounds from arma2 Dayz to my epoch server. https://www.youtube.com/watch?v=WicdjM0aE5w Does anyone have a script that plays sound files randomly??? Link to comment Share on other sites More sharing options...
0 Gr8 Posted April 3, 2015 Report Share Posted April 3, 2015 Hello i would like to bring back the random scenery sounds from arma2 Dayz to my epoch server. https://www.youtube.com/watch?v=WicdjM0aE5w Does anyone have a script that plays sound files randomly??? Its possible but your mission file will be huge with all the sound files. Link to comment Share on other sites More sharing options...
0 unerground2 Posted April 5, 2015 Author Report Share Posted April 5, 2015 I rly dont care about that. i dont need all of em you know :D i was asking for a script here. because i have 0 experience with scripting. i would love the guy who tells me how to do it @Gr8 do you know how this would work? Link to comment Share on other sites More sharing options...
0 Wargog Posted April 6, 2015 Report Share Posted April 6, 2015 You can get the sound script from the Arma 2 epoch repo on GitHub. Link to comment Share on other sites More sharing options...
0 unerground2 Posted April 6, 2015 Author Report Share Posted April 6, 2015 i dont think thats gonna work. isnt there a simple script out there? Link to comment Share on other sites More sharing options...
0 RimBlock Posted April 6, 2015 Report Share Posted April 6, 2015 Music requires a special config entry called CfgMusic. This can be defined in the Description.ext or a config.cpp / and included .hpp file. This entry defines what name the music will be referenced as in the SQF code and where the music track is located (the track must be .ogg). You can then use the playMusic command in SQF files to play the music defined in the CfgMusic class. You could also look at the addMusicEventHandler which can be set to fire on music stop so you could have it then select another track to play. The .ogg files need to be on any client that is asked to play the as ARMA does not stream the music over the network. Link to comment Share on other sites More sharing options...
0 unerground2 Posted April 6, 2015 Author Report Share Posted April 6, 2015 SO. ive tried to make my first kinda script thing. but like i expected it doesnt work. what i did is. Description.ext class CfgMusic { tracks[]={r1,r2}; class sound1 { name = "r1"; sound[] = {"r1.ogg", db+5, 1.0}; }; class sound2 { name = "r2"; sound[] = {"r2.ogg", db+5, 1.0}; }; }; init.sqf execVM "music.sqf"; music.sqf playMusic ["r1", 1]; it doesnt work so. the music file r1 and r2.ogg are in the root of my mission.pbo Link to comment Share on other sites More sharing options...
0 RimBlock Posted April 6, 2015 Report Share Posted April 6, 2015 What messages are in the client side rpt file ?. Likely causes are that it cannot find the music files or there is an error in the description.ext or music.sqf files. Link to comment Share on other sites More sharing options...
0 unerground2 Posted April 6, 2015 Author Report Share Posted April 6, 2015 where are those RPT files located? how can i make a random playlist out of lets say 20 different ogg files ??? Link to comment Share on other sites More sharing options...
0 RimBlock Posted April 6, 2015 Report Share Posted April 6, 2015 Client side report is located at C:\Users\[YOUR WINDOWS LOGIN ID]\AppData\Local\Arma 3 For 20 tracks, make 20 class entries like you have for sound1 etc. Then put the config entry names in to an array. _jukeBox = ["song1","song2"]; // etc for all 20 song names To select a random song _nextSong = _jukeBox call BIS_fnc_selectRandom; playMusic [_nextSong, 1]; Make sure you define the variables in a private line at the top of any scripts those variables are used in. Private ["_jukeBox","_nextSong"]; // include all variables you are using in the script Link to comment Share on other sites More sharing options...
0 unerground2 Posted April 6, 2015 Author Report Share Posted April 6, 2015 Allright made some progress. RPT 19:23:43 Starting mission: 19:23:43 Mission file: music%20test 19:23:43 Mission world: Stratis 19:23:43 Mission directory: D:\Eigene Dateien\Documents\Arma 3 - Other Profiles\myprofilename\missions\music%20test.Stratis\ 19:23:43 EPE manager release (0|0|0) 19:23:43 EPE manager release (0|0|0) 19:23:43 EPE manager release (0|0|0) 19:23:43 EPE manager release (0|0|0) 19:23:44 Attempt to override final function - bis_functions_list 19:23:44 Attempt to override final function - bis_functions_listpreinit 19:23:44 Attempt to override final function - bis_functions_listpostinit 19:23:44 Attempt to override final function - bis_functions_listrecompile 19:23:45 Attempt to override final function - bis_fnc_missiontaskslocal 19:23:45 Attempt to override final function - bis_fnc_missionconversationslocal 19:23:45 Attempt to override final function - bis_fnc_missionflow 19:23:46 Music song2 not found 19:23:46 No owner 19:23:48 No owner 19:23:49 No owner music.sqf Private ["_jukeBox","_nextSong"]; _jukeBox = ["song1","song2"]; _nextSong = _jukeBox call BIS_fnc_selectRandom; playMusic [_nextSong, 1]; description.ext class CfgMusic { tracks[]={"song1","song2"}; class song1 { name = ""; sound[] = {"\music\song1.ogg", db+5, 1.0}; }; class song2 { name = ""; sound[] = {"\music\song2.ogg", db+5, 1.0}; }; }; song1.ogg and song2.ogg are located in a music folder inside the mission.pbo it says cant find song2 but song 1 doesnt play to. Whats causing this problem? Link to comment Share on other sites More sharing options...
0 Gr8 Posted April 6, 2015 Report Share Posted April 6, 2015 You need to remove / From the front of music in your description.ext Link to comment Share on other sites More sharing options...
0 unerground2 Posted April 6, 2015 Author Report Share Posted April 6, 2015 Still 20:23:19 Music song1 not found 20:23:21 No owner 20:23:23 No owner 20:23:24 No owner 20:23:35 Music song2 not found Link to comment Share on other sites More sharing options...
0 Gr8 Posted April 6, 2015 Report Share Posted April 6, 2015 Replace playMusic [_nextSong, 1]; with playMusic _nextSong; Link to comment Share on other sites More sharing options...
0 RimBlock Posted April 7, 2015 Report Share Posted April 7, 2015 Replace playMusic [_nextSong, 1]; with playMusic _nextSong; Shouldn't make a difference to the current issue. It just controls the point in the track to start from (1 sec in in this case unless the track is only 1 sec long) :) . It is not needed though unless the song should start 1 sec in (to cut out a long intro or somthing like that). @unerground2 I believe the issue is that it cannot find the music tracks (as stated in the error messages). What prefix does your pbo file have ?. You need to use that prefix + path in the PBO file to reference the song. i.e. If your PBO has a prefix of '\music' and the files are in a music_file directory in the PBO then the reference would be '\music\music_files\song1.ogg'. What tool are you using to create the pbo file ?. Link to comment Share on other sites More sharing options...
0 unerground2 Posted April 10, 2015 Author Report Share Posted April 10, 2015 isnt there an already premade script out there? Link to comment Share on other sites More sharing options...
0 Gr8 Posted April 10, 2015 Report Share Posted April 10, 2015 isnt there an already premade script out there? haha, we are trying you help u and u are asking like if there was 1000s of other people's free work . and you suppose there would be one that u want. help us help u create this simple script. only way to make this happen is to answer rimblocks question or go somewhere else to look for this premade script KiloSwiss 1 Link to comment Share on other sites More sharing options...
0 unerground2 Posted April 11, 2015 Author Report Share Posted April 11, 2015 Found something: http://forums.bistudio.com/showthread.php?108535-CLY-Jukebox-play-music-and-remember-its-progress! Link to comment Share on other sites More sharing options...
Question
unerground2
Hello i would like to bring back the random scenery sounds from arma2 Dayz to my epoch server.
https://www.youtube.com/watch?v=WicdjM0aE5w
Does anyone have a script that plays sound files randomly???
Link to comment
Share on other sites
17 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