(done) Pain sounds for hitting monsters?
Posted: Mon Apr 25, 2011 10:00 pm
In RTC you can specify a playlist of sounds that will be randomly played when you successfully hit a monster. It adds to the dynamism of the creatures when they make different noises 
I can't see a property for this in the object definitions for monsters. Could this be added to DSB?
Also, related, when specifying values for an objects properties, can any value also be a function? For example, if I called a function on the attack_sound property, could the function generate a random sound and pass it back, something like this? (Note, this is my first attempt at Lua in DSB and may be all sorts of wrong
)

I can't see a property for this in the object definitions for monsters. Could this be added to DSB?
Also, related, when specifying values for an objects properties, can any value also be a function? For example, if I called a function on the attack_sound property, could the function generate a random sound and pass it back, something like this? (Note, this is my first attempt at Lua in DSB and may be all sorts of wrong

Code: Select all
attack_sound=random_orc_attack_sound
Code: Select all
function random_orc_attack_sound()
local sound = "_files\\_sfx\\foe\\orc\\orc-attack" .. math.random(3) ..".wav"
local snd = dsb_get_sound("orc_attack",sound),
return snd
end