ID:140899
 
Code:
area
var/music = 'test music.wma'
Enter()
. = ..()
if(.) usr << sound(music,1)


Problem description:
where do i put this file do i put it in the main directory of the folder (the first folder) or the second folder where this code is in please help if you need more details about whats in my folders or code just ask

If your files are at least included in the same folder as the environment, or are in a folder which is in the environment, you should be fine. You do need to have one of your preference boxes ticked, but it's like that by default, so I wouldn't worry about it.
In response to Demon_F0rce
its still not working i have just coppied the same code to my mates computer and it works

any ideas?
In response to Jordan30001
I'm sorry, but you never mentioned anything about it not working.

Do you get any runtime errors? Does it compile? Is your sound on? Are your speakers installed (this one I do suggest you look into, don't just go "They've always been installed!" because mine uninstalled themselves once)?
    Entered(mob/mob)
if(istype(mob)&&mob.client) mob << sound(music,1)
In response to Jemai1
Interesting how that istype() will always return true, but won't do what you want. Not to mention that all you've done here really is changed Enter() to Entered() and checked to see if mob is a client. That's not gonna do much difference 'cept save a lot of CPU.
In response to Demon_F0rce
Demon_F0rce wrote:
Interesting how that istype() will always return true, but won't do what you want. Not to mention that all you've done here really is changed Enter() to Entered() and checked to see if mob is a client. That's not gonna do much difference 'cept save a lot of CPU.

Not really. Aside from being logical, the code given fixes the bad usage of usr.
In response to Demon_F0rce
Demon_F0rce wrote:
I'm sorry, but you never mentioned anything about it not working.

Do you get any runtime errors? Does it compile? Is your sound on? Are your speakers installed (this one I do suggest you look into, don't just go "They've always been installed!" because mine uninstalled themselves once)?



no errors
no warnings
soundcard is installed just checked with belarc advisor
any other ideas im stumped with this one
In response to Jordan30001
In response to Jemai1
Jemai1 wrote:
You should know when to use and not use usr.

http://www.byond.com/developer/ forum/?id=712735&display=1&unread=712735#712724


what?
In response to Jordan30001
so dose anyone know why it dose not work?
In response to Demon_F0rce
That istype() will only return true if the movable entering the turf is a mob. How is that "always return true" or "won't do what you want"?

Changing Enter() to Entered() was correct. Changing usr to the argument was correct. The difference in CPU usage is negligible.
In response to Garthor
Garthor wrote:
That istype() will only return true if the movable entering the turf is a mob. How is that "always return true" or "won't do what you want"?

Changing Enter() to Entered() was correct. Changing usr to the argument was correct. The difference in CPU usage is negligible.

im am stupid i need somthing i can understand like maybe a mini explanation that is noob friendly =)