ID:158285
 
I have a sound file playing during the Character Creation process of my login, how do I stop the music when the player logs in? This is what I have.

var/sound/s = sound('LoginTheme.mid')
client/base_num_characters_allowed = 5
mob/BaseCamp/ChoosingCharacter
ChooseCharacterMenu(list/menu)
var/menu_rows = ""
for (var/item in menu)
menu_rows += {"<tr><td align="center"><a href="?menu=choosing_character;choice=[item];src=\ref[src]">\[[item]]</a></td></tr>"}
var/page = {"
<body bgcolor=black font color=white scroll=no>
<center><img src="Earths Special Forces Banner.png"></center>
<center>
<font color=white>
<h2>Earths Special Forces</font></h2>
<font color=white>
<b>Choose a Character</b><br><br>
<table border=1 cellpadding=3>
[menu_rows]
</table>
</center>
"}

src.loc = locate(8,8,2)
src << s
Look up sound() in the ref.
In response to Vic Rattlehead
Vic Rattlehead wrote:
Look up sound() in the ref.

Just says how to start it, not stop it.
In response to Cyberlord34
Really? You sure you didn't skip past the part that said "play a sound once"?
In response to Vic Rattlehead
Vic Rattlehead wrote:
Really? You sure you didn't skip past the part that said "play a sound once"?

That doesn't stop it upon login though.
In response to Cyberlord34
usr<<'blah.wav'
Really, something like that isn't playing it once? Then I guess the ref has a typo.
In response to Vic Rattlehead
Vic Rattlehead wrote:
usr<<'blah.wav'
Really, something like that isn't playing it once? Then I guess the ref has a typo.

Well yes, its playing just once. But unfortunatley the song is like 3 minutes, and I want it to stop after Character Creation.
In response to Cyberlord34
Have you tried anything like outputting no sound to them after character creation?
In response to Vic Rattlehead
Vic Rattlehead wrote:
Well then, hmm, why are you playing it at all if it's WAY too long for what's needed?

The song fits so well.
In response to Cyberlord34
I'm sure some random song you don't own does fit well, but look at the edit I made in that post.
In response to Vic Rattlehead
Vic Rattlehead wrote:
I'm sure some random song you don't own does fit well,

Win

but look at the edit I made in that post.

Alright
In response to Vic Rattlehead
Vic Rattlehead wrote:
Have you tried anything like outputting no sound to them after character creation?

What like src << null or something?
In response to Cyberlord34
I'm thinking src<<sound(null), but I've never worked with sound-related procs before.
In response to Vic Rattlehead
Vic Rattlehead wrote:
I'm thinking src<<sound(null), but I've never worked with sound-related procs before.

Thanks, it worked.