"disc Changer" Script...?

l0tusl0tus Join Date: 2004-09-07 Member: 31492Members
edited April 2005 in Scripting Discussion
<div class="IPBDescription">i.e. switching through MP3 directories</div> would it be possible to get a script that switches between at least two different MP3 directories (i.e. between marine/alien-themed directories) in·game? if so, could you follow the switch with a 'nexttrack' so that it starts up a song from that directory, and a 'developer/echo' combo stating which directory you're in?

Comments

  • ReKReK Join Date: 2004-08-30 Member: 31058Members, Constellation, Reinforced - Shadow, WC 2013 - Silver
    I believe the variable that stores your mp3 directory is cl_musicsomethingorother. Whether or not that directory would be reloaded on change I don't know. If it is, then it is a simple matter to script it. Otherwise, you would have to wait for a mapchange for the change to take effect.

    If the former is true, then it would look something like this:
    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->//Toggle
    alias mp3.1 "cl_musicsomethingorother /mp3/alien; nexttrack; alias mp3.t mp3.2"
    alias mp3.2 "cl_musicsomethingorother /mp3/marine; nexttrack; alias mp3.t mp3.1"
    alias mp3.t "mp3.1"
    mp3.1
    bind "F11" "mp3.t"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    Obviously replacing the cl_musicsomethingorother with the real command, which I don't know off the top of my head.
  • obuhobuh Not Quite Smart at NS Join Date: 2003-03-31 Member: 15072Members, Constellation
    cl_musicdirectory "loldirectory"
  • ReKReK Join Date: 2004-08-30 Member: 31058Members, Constellation, Reinforced - Shadow, WC 2013 - Silver
    Thats it, thank you.

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->//Music Toggle
    alias mp3.1 "cl_musicdirectory /mp3/alien; nexttrack; alias mp3.t mp3.2"
    alias mp3.2 "cl_musicdirectory /mp3/marine; nexttrack; alias mp3.t mp3.1"
    alias mp3.t "mp3.1"
    mp3.1
    bind "F11" "mp3.t"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    Try that in userconfig.cfg. It will either work immediately or on mapchange. If it's on mapchange, I'm afraid that's the best you can do.
  • l0tusl0tus Join Date: 2004-09-07 Member: 31492Members
    ReK FTW. i'll try it out and let ya know. either way, it's much appreciated-
Sign In or Register to comment.