ID:159284
 
Hi,

I'm just wondering if it's possible to overwrite the Sound() proc.

EG:
Sound()
..()
No. It's like overriding step(). Why would you want to?
I believe that sound() is the equivalent of creating a new sound, so you would want to override sound/New(). If this doesn't work, then just call new /sound() rather than sound(); they are the same thing.
In response to Jeff8500
Thanks that's just what I was looking for but how would I be able to tell which mob it is being played to? I want to access mob variables while in the sound/New() overwriting part
In response to Liens
Pass an arg at the end of sound (or new/sound()) that is equal to the mob. Make sure you either used all of the default args up, or you name said arg (named args must be placed at the end of the proc).

sound
var/mob/being_played_to
New(defaultarg1, defaultarg2, mob/listening) //fill in the all the default args
being_played_to = listening
..()

mob/verb/play_sound()
src << new/sound ('sound.ogg', listening = src)


Notice how I placed listening = in the end of new/sound. That is a named arg.
In response to Jeff8500
Thanks again, I was hoping there was an easier way because all it is, is just the music settings the person has set that is being send. So I didn't really want to have to pass that every time I called sound()