ID:180792
 
I can't get music to play for my life...I read the help tutorials but I still can't get...some1 plz just explain it to me on how to get music to play in a game.
On 2/15/01 5:36 pm Darkness wrote:
I can't get music to play for my life...I read the help tutorials but I still can't get...some1 plz just explain it to me on how to get music to play in a game.


Like dis,

area1
look = "Nice and jazzy, here..."
sound = 'jazzy.mid'

You need areas to get music on
In response to OmegaRed
I put my script as so:

area
sound = 'music.mid'

and when I compile it I get one error and I can not find out what it is...when I take this little script out the error goes a way...what am I doing wrong?

In response to Darkness
On 2/15/01 5:58 pm Darkness wrote:
I put my script as so:

area
sound = 'music.mid'

and when I compile it I get one error and I can not find out what it is...when I take this little script out the error goes a way...what am I doing wrong?

Have you declared the 'sound' var? Eg:

area
var/sound = 'music.mid'
In response to Tom H.
On 2/15/01 6:00 pm Tom H. wrote:
On 2/15/01 5:58 pm Darkness wrote:
I put my script as so:

area
sound = 'music.mid'

and when I compile it I get one error and I can not find out what it is...when I take this little script out the error goes a way...what am I doing wrong?

Have you declared the 'sound' var? Eg:

area
var/sound = 'music.mid'

OK...no errors...but...WHERES THE MUSIC????its not playing...
I can't get music to play for my life...I read the help tutorials but I still can't get...some1 plz just explain it to me on how to get music to play in a game.

I think this is actually what you need:

area
var/backgroundSound = 'whatever.mid'

Entered(mob/M)
M << sound(backgroundSound, 1)


Or you could do this instead:

mob
Login()
. = ..()
src << sound('whatever.mid', 1)
In response to Guy T.
In response to OmegaRed
On 2/15/01 5:36 pm Darkness wrote:
I can't get music to play for my life...I read the help tutorials but I still can't get...some1 plz just explain it to me on how to get music to play in a game.

Read Guy's post, it'll help you out.


On 2/15/01 5:39 pm OmegaRed wrote:
You need areas to get music on

Nope, not exactly!

You can play sound in any code you'd like, anywhere, anytime.

For example:

mob/Login()
..()
usr << sound('jazzy.mid',1)

Whenever the mob logs in, it plays the song for them.

Or you can make a special music box object that plays songs whenever someone comes nearby and they aren't listening to the song;

mob/var/song

obj/music_box
New()
..()
Music()
Music()
for(var/mob/M in view())
if(M.song != 'jazzy.mid' && M.client)
M.song = 'jazzy.mid'
M << sound('jazzy.mid',1)
spawn(10) Music()

The only restrictions on sound are that you need a specific mob (with a player connected to it) as a target when you do it. Well, actually, you can send to mobs that don't have players, and you won't get errors, but it's pointless. And that's all you need!

(Just as a design note, two music boxes nearby (i.e. on the same screen) will make the song go wacky, playing for a second before starting over. Whichever music box is further northeast will override the first.)