usr()<<sound('birds.wav')
Something like that but a way to project to only the the person hearing it, though I'm not sure if I should use src instead.
I'm trying to create a proc or something that will play a random sound at intervals while on a certain map but I can't seem to figure out how. I'm trying to get wind blowing or birds chirping while outside.
usr()<<sound('birds.wav')
Something like that but a way to project to only the the person hearing it, though I'm not sure if I should use src instead. |
Thank you! Also how could I create one simple line that plays random sounds to the view?
I tried view()<<sound('punchhit1.wav','punchhit2.wav') but that didn't work, it always plays the first sound. |
You'd have to make it pick from a list, passing extra arguments to sound() isn't gonna do much besides mess things up.
view() << pick(list('punchhit1.wav','punchhit2.wav')) I also recommend converting those wav files to ogg or similar formats, it will greatly decrease the resource download for your game. |
This is purely an example written on the fly, of course. There are definitely improvements to be made, and I'm sure it could be made more efficient as well. This should give you an idea of where you should start though.