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.
|
In response to Jon88
|
|
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 |
In response to Ter13
|
|
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.
|
In response to InuTracy
|
|
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) |
In response to InuTracy
|
|
Try this: '_novice_attack.wav'
|
In response to Ter13
|
|
Does anyone else have another suggestion? There has to be a way.
|
In response to InuTracy
|
|
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. |
In response to Mega fart cannon
|
|
Are you blinde? That clearly says verb. Anyway I tried src but it still didn't work. Anyone?
|
In response to Wizkidd0123
|
|
Looks like Lummox was wrong. I tried both of his methods.
|
In response to InuTracy
|
|
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 |
In response to InuTracy
|
|
mob I'm not sure. :( [Edit]Added what Wizzy said |
In response to Hell Ramen
|
|
Hell Ramen wrote:
mob FYI, that only works if hitsound includes single quotes: mob/var/hitsound='MySong.wav' |
In response to Wizkidd0123
|
|
Wiz:
usr << sound('sound.wav') From that, I belive he is putting 's around his sound. |
In response to Hell Ramen
|
|
Hell Ramen wrote:
Wiz: I know; just explaing that he needed to use single quotes for his var too :) |
In response to Wizkidd0123
|
|
THANK YOU VERY MUCH! It's so obvious now! You have to define the variable as a file with single quotes.
|