ID:140159
 
Code:
mob/verb/Accel()
if(!usr.auto)
usr << sound(pick('se_motion.ogg','se_motion2.ogg'),1,0,8)
walk(usr,usr.dir,1)
usr.auto = 1

else
usr << sound(null,0,0,8)
walk(usr,0,1)
usr.auto = 0

return


Problem description:

The sound does not always null. Sometimes it might, most of the time it continues to loop in the background - even though auto has been set to 0 so it has gone through the If() else () correctly.

Can't figure out whats up.
make sure the sound is set to a specific channel, then null out that channel and the sound should stop. sometimes it won't null the sound so if you want,you could also make a fake sound file and replace it with that/ you can use the microphone utility, (without a mic) to make a wav file to replace it.
In response to Bravo1 (#1)
Yep its trying to null out channel 8.

I guess a null sound file would be a good idea as a work around. This still should be working though humm.
In response to EternalDuelistSoul (#2)
Having an empty sound file would be profoundly silly. My suggestion would be to construct a sound object and use that to mute, either by setting its status to SOUND_MUTE|SOUND_UPDATE or by setting its volume to 0 and its status to SOUND_UPDATE.
In response to Garthor (#3)
But from what i just read the sound will still keep playing, you just wont be able to hear it.

I don't understand why setting it to null does not work. It should do.

EDIT:

sound/motion1

file = 'motion.ogg'
channel = 8
repeat = 1
volume = 100


mob/proc/makesnd()

var/sound/S1 = new /sound/motion1
usr << S1


Any reason why the above does not work? I don't hear anything...
In response to EternalDuelistSoul (#4)
You are not supposed to create a subtype of the sound type, simply create one using sound() and then set any other variables you need.

Using SOUND_PAUSED might be better than SOUND_MUTE I guess.
In response to Garthor (#5)
So i can't preset them? :/ This sounds less useful.

SOUND_PAUSED might work i guess. However still really isnt quite there... it needs to stop fully. It might not be used for the rest of their time on the game. Its an engine sound effect so if they decide to go walk, its going to be redundant.