ID:1895058
 
(See the best response by Lummox JR.)
I am trying to do this:
mob/verb
Moosik_1(var/sound/S as sound)
S.channel=3
S.wait=1
world<<S


It brings a runtime error:
runtime error: Cannot modify A_Sound.wav.wait.
proc name: Moosik 1 (/mob/verb/Moosik_1)
usr: Ter4byte (/mob)
src: Ter4byte (/mob)
call stack:
Ter4byte (/mob): Moosik 1('A_Sound.wav')



BUT, if I do this:...
mob/verb
Moosik_2()
var/sound/S = sound('A_Sound.wav')
S.channel=3
S.wait=1
world<<S

...it works perfectly.

The thing is; I want the player to be able to upload their own files, but I want the sound files to wait until that channel is free.

Can I get some help with this?? Thank You!!!
Best response
Your verb is making a critical assumption that's incorrect: that S is a /sound datum rather than a cache file.

The "as sound" modifier means the value of S will be a cache file. The sound() proc, or new/sound(), will create a /sound datum that you can modify.

mob/verb
Moosik_1(sound_file as sound)
var/sound/S = new(sound_file)
S.channel = 3
S.wait = 1
world << S
In response to Lummox JR
Thank you so much!

I am also curious, is there a way to check at the sound files that are on the waiting list???

I'm sorry if I am a bother! I will appreciate the help!!
Once a sound has been sent there really isn't a way to check which ones are still waiting.
Ah! Okay, got it. Thanks a bunch!