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?
Ability to play sounds only in LOS
Moderator: Moderators
Re: Ability to play sounds only in LOS
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
Yes, but smoke (and all other CEGs) can be fixed by changing a parameter in the CEG: set "alwaysVisible=0".