Help - Search - Members - Calendar
Full Version: "disc Changer" Script...?
Unknown Worlds Forums > Natural Selection > Natural Selection Creation > Scripting Discussion
l0tus
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?
ReK
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:
CODE
//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"


Obviously replacing the cl_musicsomethingorother with the real command, which I don't know off the top of my head.
obuh
cl_musicdirectory "loldirectory"
ReK
Thats it, thank you.

CODE
//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"


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.
l0tus
ReK FTW. i'll try it out and let ya know. either way, it's much appreciated-
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.