ID:261765
 
My code is as follows:

mob
Login()
..()
if (!istype(src, /mob/create_character))
world << "<B><font color = silver>------<font color = blue>[src] has logged in!<font color = silver>------</font>"
if(src.KO == 1)
src.KO = 0
src.PL = 1
src.blasting = 0
src.EBing = 0
src << sound('Intro.midi',0)


The sound wont play
First off, close your HTML tags, second off, use <DM> at the beginning of your code, and </DM> at the end of your code. And lastly, tell us what the problem is, so we can help you.
SSj2-Mystic wrote:
src << sound('Intro.midi',0)

It appears you have everything right, you could try replacing src << sound with usr << sound('Intro.midi',0)

A few things to note here. Make sure Intro is spelt with a capital "I" also normally most midi files are saved as mid not midi, so just re-verify that information. Going to your HD and renaming the Intro.midi -> intro.mid and naming it that in your code should help. Also ensure the intro.mid is in the same folder as your project. If you're putting it in another folder like "/sounds" you'll need to tell DM that.

usr << sound("sounds/intro.mid",0)

Hope this helps you out.
LJR
In response to LordJR
LordJR wrote:
It appears you have everything right, you could try replacing src << sound with usr << sound('Intro.midi',0)

usr will sometimes work okay in Login(), but if another player causes the login (from one mob to a different one) then it will equal that player. Unless that's what is happening, better to stick with src.
In response to Crispy
Crispy wrote:
LordJR wrote:
It appears you have everything right, you could try replacing src << sound with usr << sound('Intro.midi',0)

usr will sometimes work okay in Login(), but if another player causes the login (from one mob to a different one) then it will equal that player. Unless that's what is happening, better to stick with src.

Yeah I normally do try to stick to src these days. Or pre-define usr more precisely.