I would like to be able to use a cvar to switch my map ambient sound to run 2 ways.
1 looped and
2 once
I could script it with the same sound named two different ways - and two seperate mus files basically for what is the same sound.
Any way I could do this without duplicating my sound file twice?
ambient sound ?
Moderator: Moderators
nope
In single player you can have stuff like this.
!normal volume 1.5
!normal loop
!aux1 volume 1.5
!aux1 loop
!aux2 volume 1.5
!aux2 loop
But, for multiplayer they only have "normal". However, there is a way around that. Check out my ambient sound tutorial map.
mp_ambient2

The tiny vis_leafgroups hide the outside speakers. So, you could have one set of speakers for loopsound, and one set for playsound.
!normal volume 1.5
!normal loop
!aux1 volume 1.5
!aux1 loop
!aux2 volume 1.5
!aux2 loop
But, for multiplayer they only have "normal". However, there is a way around that. Check out my ambient sound tutorial map.
mp_ambient2

The tiny vis_leafgroups hide the outside speakers. So, you could have one set of speakers for loopsound, and one set for playsound.
It can, in fact, be done easier
You can use aux1 to aux8 in mp too, make a .mus file like this:
normal somemp3.mp3
!normal volume 1.0
!normal loop
aux1 somemp3.mp3
!aux1 volume 1.0
Then in your script type, before level waittill prespawn:
soundtrack music/nameofmymusicfile.mus
Later on, you can use
forcemusic normal normal
to play a looped sound, or
forcemusic aux1 aux1
to play the sound just 1 time.

You can use aux1 to aux8 in mp too, make a .mus file like this:
normal somemp3.mp3
!normal volume 1.0
!normal loop
aux1 somemp3.mp3
!aux1 volume 1.0
Then in your script type, before level waittill prespawn:
soundtrack music/nameofmymusicfile.mus
Later on, you can use
forcemusic normal normal
to play a looped sound, or
forcemusic aux1 aux1
to play the sound just 1 time.



