ID:145012
 
Code: 3D Sound. Just 3D Sound.
var/sound/S = sound('G13.wav')
//Changed later, and the next bit is cut off..
S.x = M.x
S.y = M.y
S.z = 1
view(M) << S


Problem description: The sound trails away the further the Player is from possibly (1,1,1), even though the Player is the actual maker of the sound.

You set it to the player's current location, not the player. However, I'm not sure how to fix this, but I know this is not the right way :P
In response to Dark Weasel
Eek... but isn't that meant to be right? I mean, the Player does move... the sound should go with him if it is his Current Location.
In response to RedlineM203
It all depends on how you're doing it. You've only given us a sinppet, so we can only infer from that snippet.
In response to Popisfizzy
turf
icon = 'Turf.dmi'
Pavement
Slab
icon_state = "P1"
Enter(mob/Player/M)
if(ismob(M))
..()
S = sound(pick('FM_conc1.wav','FM_conc2.wav','FM_conc3.wav'))
S.x = M.x
S.y = M.y
S.z = 1
view(M) << S
return ..()
else
return ..()


mob/verb/Fire()
set hidden = 1
if(usr.weapon == "Unarmed")
src<<"<font color = red><b>Equip a weapon!"
return
else
if(src.weapon.bullets >= 1)
if(src.weapon.fired == 0)
var/obj/O
if(src.weapon.name == "Glock 13")
O = new /bullets/G13(src.loc)
if(src.weapon.name == "Desert Eagle")
O = new /bullets/DE(src.loc)
walk(O,src.dir)
S = sound(usr.weapon.firesound)
S.x = src.x
S.y = src.y
S.z = 1
view(src) << S
src.weapon.fired = 1
src.weapon.bullets -= 1
sleep(src.weapon.firedelay)
src.weapon.fired = 0


And screw you if its stolen. :(
In response to RedlineM203
the X, Y and Z represent the mob's position relative to the origin of the sound. Look at the DM reference for more information.
In response to D4RK3 54B3R
So I should use Get Step?


I needa littttle more detailed help then that.
In response to RedlineM203
Read the reference. It has a few different pages about 3D sound and how it works.

The X, Y, and Z variables aren't related to the BYOND map. They're where the sound seems to be coming from, relative to the player. A sound with x=-5 and z=5 would sound like it's coming from somewhere ahead and to the left.

If you want it to sound like a sound is coming from a certain mob, then you need to compare the map X variable of the sound source and the person that hears it as well as the same with the map Y variable.
In response to Jon88
Jon88 wrote:
Read the reference. It has a few different pages about 3D sound and how it works.

The X, Y, and Z variables aren't related to the BYOND map. They're where the sound seems to be coming from, relative to the player. A sound with x=-5 and z=5 would sound like it's coming from somewhere ahead and to the left.

If you want it to sound like a sound is coming from a certain mob, then you need to compare the map X variable of the sound source and the person that hears it as well as the same with the map Y variable.

Indeed these aspects of the sound system can be confusing. I've actually had a BYONDscape article on the new sound features ready to go for some time, but I've been waiting to publish it until more content arrived. Since I see there's been more in the interim, I think I'll go ahead and submit it.

Lummox JR
In response to Lummox JR
I think I've figured it, but I'm having the sound cut bug that some guy was having a while back. After a while, you don't hear anything, if you don't remember.

Is there any help on that?
In response to RedlineM203
You mean this one?
http://developer.byond.com/forum/ index.cgi?action=message_read&id=449865&forum=2&view=1&displ ay=1

I haven't found anything to fix it yet, but I never got around to running those test. Maybe you should try Shadowdarke's suggestion, and we can compare notes? :)

My bet is on some kind of memory leak, though.