I was wondering if there was any way around the peice of code for sound to only play one like
usr << sound('sound.wav')
I want to do this because I have quite a few monsters in my game and I want to store the name of their attack wav in an interchangable sound proc. I want to be able to do
something like usr << sound('[M.attacksound]')
So does anyone know a way around this and not having to create a new proc to run if checks for every monster.
ID:170873
![]() Dec 4 2004, 3:01 pm
|
|
![]() Dec 4 2004, 3:15 pm
|
|
I think you can do something like the following, but I'm not sure.
|
Just to make Jon's statement more clear, that IS indeed how you would do such a thing. It'd be best to hold the monster's sound in a defined variable, so you wouldn't have to do much work to change the sound... Embedding it in an attack variable would just be blasphemous.
mob Alternately, it would be cool to have multiple sounds per monster... Though, it'd be a shame to do this with a list. Here's a cool way to do this: mob |
yeah jons way was it. I just thought it had to be in ''s instead of just in the parenthesis. I didn't want to have to code 1000 if statements.
|
I just tried it out and it didn't work. It doesn't pplay any sound at all. This is just a brief overview of the code. Is there another way?
mob var hitsound="_novice_attack.wav" mob verb Attack() view() << sound(usr.hitsound) |
InuTracy wrote:
I just tried it out and it didn't work. It doesn't pplay any sound at all. This is just a brief overview of the code. Is there another way? Lummox JR wrote: No usr in procs. Ungh. |
InuTracy wrote:
Looks like Lummox was wrong. I tried both of his methods. Are you using src << sound(file("[M.FightSong]")) ? I can only remember 2 occasions in which Lummox was wrong, and they both involved undocumented features of DM, such as \c. lol |
mob I'm not sure. :( [Edit]Added what Wizzy said |
Hell Ramen wrote:
mob FYI, that only works if hitsound includes single quotes: mob/var/hitsound='MySong.wav' |
Hell Ramen wrote:
Wiz: I know; just explaing that he needed to use single quotes for his var too :) |