Baphomet 0 Posted August 23, 2005 I was wondering if anyone knows how to make, or if anyone -has- made a dynamic music script for missions. I was thinking something based around the proximity of enemies, one track would play when enemies weren't around, and when they came within a certain distance, a different track would play. I'm making a multiplayer mission using Ocean island and General Barron's vampire pack, which suprisingly works well without any serious problems (mostly local script effects aren't viewed globally so players can't see the other's effects from holy strike, etc). So far the mission has a decidely resident evil outbreak kind of feel to it, what with being swamped with undead types in an urban setting. Share this post Link to post Share on other sites
Trapper 0 Posted August 23, 2005 If you're using Unified Zombie Mod for the undeads, this script can peek at the gblZombieList array for distance check: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> goto "init" #l1 ~1 if !(alive _t) then {exit} _nd = _d {if (_x distance _t < _nd) then {_nd = _x distance _t}} foreach gblZombieList if (_count1) then {_w1 = _w1 - 1} if (_count2) then {_w2 = _w2 - 1} if ((_nd < _d) && (_w1 == _s1)) then {goto "TrD"} if ((_nd == _d) && (_w2 == _s2)) then {goto "TrS"} if (_w1 <= 0) then {_w1 = _s1; _count1 = false; goto "l1"} if (_w2 <= 0) then {_w2 = _s2; _count2 = false; goto "l1"} goto "l1" #TrD 1 fademusic 0 ~1 1 fademusic 1; PlayMusic _m1; _count1 = true; _w2 = _s2; _count2 = false; goto "l1" #TrS 1 fademusic 0 ~1 1 fademusic 1; PlayMusic _m2; _count2 = true; _w1 = _s1; _count1 = false; goto "l1" #init _t = _this select 0 ;object for distance check _d = _this select 1 ;distance for music change _m1 = _this select 2 ;CfgMusic classname of the 'danger' track _s1 = _this select 3 ;'danger' tracklength in seconds _m2 = _this select 4 ;CfgMusic classname of the 'safe' track _s2 = _this select 5 ;'safe' tracklength in seconds _w1 = _s1; _w2 = _s2; _count1 = false; _count2 = false goto "l1" Let's say you want to change the music everytime a zombie is 5m or closer to the player, and 'safe' is Track11 with 0:53min lenght and 'danger' is I'm gonna fly with 4:04min length, then you have to call the script like this: [player,5,"7thIAmGonaFly",244,"Track11",53] exec "dm.sqs" 1. object for distance check 2. distance for music change 3. CfgMusic classname of the 'danger' track 4. 'danger' tracklength in seconds 5. CfgMusic classname of the 'safe' track 6. 'safe' tracklength in seconds As player is local, everyone in mp should have his own dynamic music detection running, but you have have to try if I'm right with that. If you're not using the Unified Zombie Mod, you have to create an array that's continously updated with all enemys still alive and replace gblZombieList in the script with it's name. Share this post Link to post Share on other sites
Balschoiw 0 Posted August 24, 2005 I´ve been making something like this but in a more complicated way. The samples I used are "cut-to-fit" and can be looped into each other without any noticeable cut. This way you can pretend that it is one song only. The timing of the script needs to be very detailed but it´s worth the effort. Check the corresponding thread and download the music-samples here Share this post Link to post Share on other sites
Trapper 0 Posted August 24, 2005 Your samples really sound like dynamic game music Balschoiw. Makes my script sound like a simple trackskip with fading. But I think it's very hard to find a track that can be used to create the samples, as it has to be a track which includes silent and aggressive parts without sounding repeating. Of course, if you're able to create electronic music by yourself it's not that hard. For someone who wants to use real and complete songs with lyrics, I think my script is almost perfect. If only real crossfading would be possible... EDIT: If needed, unlimited safe/danger songs could be defined for random selection, too. (But better hardcoded inside of the script, to keep the exec line short.) Share this post Link to post Share on other sites
Balschoiw 0 Posted August 24, 2005 Vocal music is not that useful imo. It get´s repetative very soon. The example is just an example. I did a lot of samples from a large variety of songs lately for some missions that work with a looped sound script to have some kind of a brick systrem that allows to combine sounds to a long music track without blowing the missionsize out of proportion. This way you can combine samples to a long music track without having to actually sample the whole track which means that the filesize with the brick system is much much smaller than a mission using complete samples of music tracks. Here´s another example from another mission: score of "push the button" There are 3 samples in the zip file. The overall size is ~ 300 KB. With this script you can make a score out of those samples which lasts around 1.40 minutes. Compared to a 1.40 minute sample done the regular way the filesize is very much smaller and therefore especially user-friendly when it comes to downloading multiplayermissions on dial-up connections. This is the script I used to get the sounds timed and combined perfectly: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">~ 0.5 playsound "missionafghaloop1" ~ 6.926 playsound "missionafghaloop1" ~ 6.926 playsound "missionafghaloop2" ~ 6.910 playsound "missionafghaloop2" ~ 6.910 playsound "missionafghaloop2" ~ 6.910 playsound "missionafghaloop2" ~ 6.910 playsound "missionafghaloop1" ~ 6.926 playsound "missionafghaloop1" ~ 6.926 playsound "missionafghaloop3" ~ 13.270 playsound "missionafghaloop2" ~ 6.910 playsound "missionafghaloop2" ~ 6.910 playsound "missionafghaloop1" ~ 6.926 playsound "missionafghaloop1" ~ 6.926 playsound "missionafghaloop2" ~ 6.910 playsound "missionafghaloop2" ~ 6.910 exit I hope you get the idea Share this post Link to post Share on other sites
Baphomet 0 Posted August 24, 2005 I'll have to give this all a look. Thanks for the replies guys. Share this post Link to post Share on other sites