Audio from a thing is going through walls too far.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Audio from a thing is going through walls too far.

Post by Hidden Hands »

This is a problem I've been struggling with for a while. I have a radio that loops music in my map but it can be heard through walls. This isnt too bad normally, but in this particular map it can be heard on the floor below 2 rooms over due to it being on the other side of the sector.

Is there a suitable way to prevent this or at the very least, lower its radius?

Thanks in advance.
User avatar
SanyaWaffles
Posts: 861
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields
Contact:

Re: Audio from a thing is going through walls too far.

Post by SanyaWaffles »

Raise the attenuation. There's ways of doing this in SNDINFO or in A_StartSound calls. The higher the number, the smaller the radius.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Audio from a thing is going through walls too far.

Post by Hidden Hands »

Is there an example using SNDINFO anywhere I can take a look at please?
User avatar
SanyaWaffles
Posts: 861
Joined: Thu Apr 25, 2013 12:21 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11 for the Motorola Powerstack II
Graphics Processor: nVidia with Vulkan support
Location: The Corn Fields
Contact:

Re: Audio from a thing is going through walls too far.

Post by SanyaWaffles »

Code: Select all

$attenuation aliasname value
The higher the value, the shorter the attenuation. 0.5 would make it much louder, 1.5 might make it too quiet. Experiment around a bit.

There's also the attenuation parameter in A_StartSound, which does the exact same thing except it can override it I think.
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: Audio from a thing is going through walls too far.

Post by Hidden Hands »

Nice one, thank you. This is exactly what I needed.
Post Reply

Return to “Scripting”