So has anyone played with modding your server music so that your music slider in the options wasn't so useless?
I wanted to add some atmospheric tracks to my server and decided to poke into how dayz does its music instead of smoldering my map in a range of triggers.
What i've found (if its not common knowledge) is that compiles.sqf calls player_music.sqf.
Player_music.sqf is in dayz_code.pbo in the compile folder.
It looks like so:
Its randomizing which track to play, getting the length, and then choosing a random point to stop the music track at.
So for one thing, if you wanted to stop all the ambient noise on your server (other than death I believe and sounds for being unconscious) you could just comment out this line in your compiles.
Since the file names and locations are defined in cfgMusic.hpp which cannot be modified serverside, and cfgMusic's location is defined in config.cpp which also isn't modifiable serverside, there isn't much hope in changing those.
I do think it may be possible to modify player_music.sqf and make it randomize between a bunch of tracks you have defined in your description.ext.
for example.
Dayz randomizes between 37 tracks totaling 19mb so this would of course lead to a large mission file, but I think I'm gonna play around with adding some Namalsk ambience to my Chernarus map.
Anyone else ever play with this?
I wanted to add some atmospheric tracks to my server and decided to poke into how dayz does its music instead of smoldering my map in a range of triggers.
What i've found (if its not common knowledge) is that compiles.sqf calls player_music.sqf.
Player_music.sqf is in dayz_code.pbo in the compile folder.
It looks like so:
Code:
private ["_sound","_num","_length","_pause"];
while {!r_player_dead} do {
_num = floor(random 36);
_sound = "z_suspense_" + str(_num);
_length = getNumber(configFile >> "cfgMusic" >> _sound >> "Duration");
_pause = ((random 5) + 2) + _length;
if (!r_player_unconscious and !r_pitchWhine) then {
playMusic _sound;
};
sleep _pause;
};
Its randomizing which track to play, getting the length, and then choosing a random point to stop the music track at.
So for one thing, if you wanted to stop all the ambient noise on your server (other than death I believe and sounds for being unconscious) you could just comment out this line in your compiles.
Code:
player_music = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_music.sqf"; //Used to generate ambient music
Since the file names and locations are defined in cfgMusic.hpp which cannot be modified serverside, and cfgMusic's location is defined in config.cpp which also isn't modifiable serverside, there isn't much hope in changing those.
I do think it may be possible to modify player_music.sqf and make it randomize between a bunch of tracks you have defined in your description.ext.
Code:
class CfgMusic
{
tracks[]={nam,eve};
class nam
{
name = "Music_Name_Here";
sound[] = {\Music\Sound_Name_Here.ogg, db+1, 1.0};
};
class eve
{
name = "Music_Name_Here";
sound[] = {\Music\Sound_Name_Here.ogg,db+1, 1.0};
};
};
Dayz randomizes between 37 tracks totaling 19mb so this would of course lead to a large mission file, but I think I'm gonna play around with adding some Namalsk ambience to my Chernarus map.
Anyone else ever play with this?