Ykkrosh
cfca28cab0
Support sound group playback from simulation scripts. See #486. Update some sound group files to sound better for rough testing. Clean up CSoundGroup a tiny bit. This was SVN commit r7437.
14 lines
433 B
JavaScript
14 lines
433 B
JavaScript
/**
|
|
* Simple wrapper function for playing sounds that are associated with entities
|
|
* @param name Typically one of 'walk', 'run', 'attack', 'death', 'build',
|
|
* 'gather_fruit', 'gather_grain', 'gather_wood', 'gather_stone', 'gather_metal'
|
|
*/
|
|
function PlaySound(name, ent)
|
|
{
|
|
var cmpSound = Engine.QueryInterface(ent, IID_Sound);
|
|
if (cmpSound)
|
|
cmpSound.PlaySoundGroup(name);
|
|
}
|
|
|
|
Engine.RegisterGlobal("PlaySound", PlaySound);
|