Janat 10 Posted March 16, 2012 I can't get fadeMusic to work in a script. The script should first fade out any music track currently playing and then start playing a new track. Everything else works, but fadeMusic doesn't seem to do anything. The script has been compiled and preprocessed in init.sqf. init.sqf nextTrack = compile preprocessFile "nexttrack.sqf"; I call it via editor trigger trigger activated field [_next = "track", 3] spawn nextTrack; If I use call instead of spawn, sleep command doesn't obviously work, else it works the same way as it does when spawning it. How can I get the script to work the way it should work? Here's the script: nexttrack.sqf private ["_musicTrack","_transitionLength"]; _transitionLength fadeMusic 0; _musicTrack = _this select 0; _transitionLength = _this select 1; sleep _transitionLength + 2; playMusic _musicTrack; Share this post Link to post Share on other sites
fleepee 10 Posted March 16, 2012 I just changed the position of one line, it should work if you also add a fade in line (or volume remains at 0 level!!): private ["_musicTrack","_transitionLength"]; _musicTrack = _this select 0; _transitionLength = _this select 1; _transitionLength fadeMusic 0; sleep _transitionLength + 2; _transitionLength fadeMusic 1; playMusic _musicTrack; Share this post Link to post Share on other sites
Janat 10 Posted March 16, 2012 Thanks, wonder why the fade out doesn't work without fade in in this script... It does work everywhere else :confused: Share this post Link to post Share on other sites