Force underwater reverb sound for player via scripting?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Spaceman333
Posts: 622
Joined: Thu Oct 13, 2016 8:40 pm

Force underwater reverb sound for player via scripting?

Post by Spaceman333 »

I've encountered in some newer doom maps to have sections that I can actually swim in and go underwater. When I do so, the sounds suddenly get this really cool reverb effect.

How could this reverb effect be activated through a script on demand, regardless if I'm in water or not?

I would like to apply this to my slomo mod, while other potential applications can be for a stun grenade status effect or a monster that gives an impression of distorting reality by activating the reverb for the player temporarily.
Last edited by Spaceman333 on Tue Jul 11, 2017 8:15 am, edited 1 time in total.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: Force underwater reverb sound for player via scripting?

Post by Nevander »

The only way I can think of is to place sound environment things on new maps and set them to the underwater preset and another with preset 0, 0 (or off). Make them both disabled to start and give them a TID. Then in ACS, activate the underwater one when you want to, and then deactivate it and activate the one that turns the reverb off.

I wonder if it's possible to do this in any map by using DECORATE to spawn sound environment things under the player on each map start? Probably not.

It would be nice if ACS had a reverb function built in without needing to mess with sound environments. Something like... Reverb(first number, second number, on/off); Obviously turning another on without turning the first off would cancel the first one.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Force underwater reverb sound for player via scripting?

Post by Enjay »

The thing about reverbs is, the last one activated is the one that is used in that area. So the suggested principle would work up to a point. It would fail(ish) if an area already had a reverb active. e.g. Imagine if you were in an echoey pipe (set using a reverb thing). You activate the slo-mo mod and get the underwater effect but then when the slo-mo runs out and reverb is set to 0,0 the echoey-ness of the pipe would be gone.
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Force underwater reverb sound for player via scripting?

Post by Nash »

When Randi was around, she'd tell me about how she planned to allow modder-programmable DSP. That would have been the perfect solution to this (and more sound manipulation effects)...
User avatar
Spaceman333
Posts: 622
Joined: Thu Oct 13, 2016 8:40 pm

Re: Force underwater reverb sound for player via scripting?

Post by Spaceman333 »

Thank you all who posted in this thread for your replies, I had been busy so I didn't get the chance to give gratitude yet.
Enjay wrote:The thing about reverbs is, the last one activated is the one that is used in that area. So the suggested principle would work up to a point. It would fail(ish) if an area already had a reverb active. e.g. Imagine if you were in an echoey pipe (set using a reverb thing). You activate the slo-mo mod and get the underwater effect but then when the slo-mo runs out and reverb is set to 0,0 the echoey-ness of the pipe would be gone.
Ah so thats how that works. Yeah that doesn't make it possible to use it as a player driven feature as opposed to a map-baked feature. I'll need to request this as a feature, otherwise this is impossible to do.
Nevander wrote:The only way I can think of is to place sound environment things on new maps and set them to the underwater preset and another with preset 0, 0 (or off). Make them both disabled to start and give them a TID. Then in ACS, activate the underwater one when you want to, and then deactivate it and activate the one that turns the reverb off.

I wonder if it's possible to do this in any map by using DECORATE to spawn sound environment things under the player on each map start? Probably not.
I tried to this with a different thing, but it didn't work. It was an attempt to silence all sounds with a SectorSilencer thing. I spawned that SS thing at the player's location and moved it with the player every frame, but it didn't do anything:

Image

I browsed through all 12 pages on the Editing section of the forums that had the mention of a Reverb and I saw some folks wanting to do the same thing as I did, but it wasn't possible back then either apparently. Someone also mentioned that the way map things work is that they need to bound the to map sectors to work, so I can't just spawned them during runtime. They essentially had to be pre-baked during the mapping process.
It would be nice if ACS had a reverb function built in without needing to mess with sound environments. Something like... Reverb(first number, second number, on/off); Obviously turning another on without turning the first off would cancel the first one.
Yes, this is definitely something I'd want to see. I'm going to the feature suggestions forum and make a post about it. Maybe it might get greenlight at some point. Thanks for writing that example, it'll make it easier for me to write a suggestion for it.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: Force underwater reverb sound for player via scripting?

Post by Nevander »

Spaceman333 wrote:
It would be nice if ACS had a reverb function built in without needing to mess with sound environments. Something like... Reverb(first number, second number, on/off); Obviously turning another on without turning the first off would cancel the first one.
Yes, this is definitely something I'd want to see. I'm going to the feature suggestions forum and make a post about it. Maybe it might get greenlight at some point. Thanks for writing that example, it'll make it easier for me to write a suggestion for it.
One thing though: I just realized it should be this if it were possible:

Reverb(id argument 1, id argument 2);

To turn a reverb off you'd do Reverb(0,0); since 0 0 is the ID for "off." And like I said above in the quote, this method would apply to the entire map since anything else would have to be set on the map itself using sound environments. There would be no way for ACS to distinguish map zones.
User avatar
Spaceman333
Posts: 622
Joined: Thu Oct 13, 2016 8:40 pm

Re: Force underwater reverb sound for player via scripting?

Post by Spaceman333 »

Nevander wrote:
Spaceman333 wrote:
It would be nice if ACS had a reverb function built in without needing to mess with sound environments. Something like... Reverb(first number, second number, on/off); Obviously turning another on without turning the first off would cancel the first one.
Yes, this is definitely something I'd want to see. I'm going to the feature suggestions forum and make a post about it. Maybe it might get greenlight at some point. Thanks for writing that example, it'll make it easier for me to write a suggestion for it.
One thing though: I just realized it should be this if it were possible:

Reverb(id argument 1, id argument 2);

To turn a reverb off you'd do Reverb(0,0); since 0 0 is the ID for "off." And like I said above in the quote, this method would apply to the entire map since anything else would have to be set on the map itself using sound environments. There would be no way for ACS to distinguish map zones.
Thanks, I appreciate the input. I added your post as a quote to the thread that I made in the Feature Suggestions section.
Locked

Return to “Editing (Archive)”