Page 1 of 1

Ability to play sounds only in LOS

Posted: 13 Apr 2012, 12:29
by Jools
In order to make sounds more contextual, I'm exploring the ways to only play them when the player has line of sight. Currently mod sounds from weapons are played by the engine from weapons.tdf using the tags soundstart for shooting a projectile, and soundhit for the explosion sound. But is there a way to make these be contingent upon having line of sight?

Only hack I can think of is replacing those sound files with dummy, silent sounds and handling the explosion sounds myself, via tracking projectiles and explosions. But that is unelegant and hackish. Any better solution? Is this already possible?

Re: Ability to play sounds only in LOS

Posted: 13 Apr 2012, 14:39
by Anarchid
There are other things that betray stuff outside los, like smoke emitted from units. This is of no direct relevance, but i'd like a way to handle that too.

Re: Ability to play sounds only in LOS

Posted: 13 Apr 2012, 14:59
by Jools
Yes, but smoke (and all other CEGs) can be fixed by changing a parameter in the CEG: set "alwaysVisible=0".