Page 1 of 2

Sound trigger on locked door

PostPosted: Mon Sep 27, 2021 4:47 am
by Gunslaher_Pi
Hey Lads and Lassies.

I don't post often unless I'm in trouble so I Apologize if my post isn't in the right area.

Now, I don't know who is responsible for this but when I used to run BrutalDoom21v or Zion (dunno which mod), pressing on a locked door without the appropriate keycard/skullkey results in an audio cue of "access denied".

I have my own audio file for such an event, is there a specific sound sequence, ambient or other conditional trigger to make this state?

It's important to me, I'm making a megawad map pack. Any help would be greatly appreciated!

Ta!

Re: Sound activation on redundant wall

PostPosted: Mon Sep 27, 2021 6:34 am
by Enjay
there is a SNDINFO entry called misc/keytry that does what I think you are describing.

If you add a SNDINFO entry like this

Code: Select allExpand view
misc/keytry    mysound


where mysound is the name of your sound file it should do it.

Re: Sound activation on redundant wall

PostPosted: Tue Sep 28, 2021 5:44 am
by Gunslaher_Pi
yO,

I tried but she ain't working unfortunately. Generally if the coding supports such a command function it would change colour?

I tried the whole "misc/keytry mysound" and I know my files and script is perfect.

Being my first real go with GzDoom Builder, I've got the ambient sound functions sorted.

In simple, I'll repeat myself for anyone viewing this post.

I want to have a sound play when the player tries to access a locked or inaccessible door. Someone throw me a bone here, because I have no idea what I'm doing.

Re: Sound activation on redundant wall

PostPosted: Tue Sep 28, 2021 6:23 am
by Enjay
But I already threw that bone. :P

Unless I'm misunderstanding something, you just want the normal locked doors/scripts/etc to make a special sound when tried without they key - correct?

If so, then the misc/keytry thing that I suggested works. Example attached.

Locked.pk3


There is no special scripting or anything in that file. In fact, there are no scripts in the map at all and the mapinfo.txt file is only there to change the map name and the music; it has nothing to do with the door sounds at all.

If that's what you are looking for, then delete the maps folder (and the mapinfo.txt file) from the PK3 and then load it after other mods and it should still work.

If, however, you are only looking for certain doors to make the different sound, then that would be better done with scripting.

Re: Sound activation on redundant wall

PostPosted: Sun Oct 03, 2021 9:23 am
by Gunslaher_Pi
Hey, so I tried it again. Didn't work. Even loaded your map
And still nothing. I did notice however, you have two
Unknown sprites by the doors.

Am I missing something here?

Re: Sound activation on redundant wall

PostPosted: Sun Oct 03, 2021 9:42 am
by Enjay
Gunslaher_Pi wrote:Am I missing something here?

By the sound of it, you're missing an up to date version of GZDoom. The "unknown sprites" will be the dynamic lights that I placed in the map. They are attenuated lights and relatively new. So really old versions of GZDoom won't have them. In saying that, the misc/keytry thing should work. Even the last official version of ZDoom plays the sound just fine.

Here's how the map works for me.


I hope that will play. for some reason the copyright check on the video is taking forever. 8 minutes so far for a 22 second video.
[edit - hmm, it doesn't work yet as an embedded video, but it seems to be OK if you press the watch on YouTube link.]

Re: Sound activation on redundant wall

PostPosted: Tue Oct 05, 2021 11:01 pm
by Gunslaher_Pi
Hmmm, I see. What I'd give for my dumb doors to work
Properly. Uhm, does file format have much play in compatibility? I'm using .wav format for my ambience and it works just fine.

I've tried misc/keytry mysound
And the variant $alias misc/keytry mysound

But nothing works. ☹️

Re: Sound activation on redundant wall

PostPosted: Wed Oct 06, 2021 1:15 am
by Enjay
Any chance you could upload your mod file some where for me to check?

If you type playsound misc/keytry at the console do you hear the sound?

What version of gzdoom are you using?

WAV or any other supported file format should be fine.

Re: Sound activation on redundant wall

PostPosted: Wed Oct 06, 2021 1:32 am
by Gunslaher_Pi
Latest GzDoom Builder. However UMDF format. Designed and tested for zDoom. I have an inkling that my file format isn't correct.

Opened console typed playsound misc/keytry and then the file directly. It registers the existence of the file but won't play it. So it's a matter of format. I'll fix it and then try again.

As for uploading my file. That's not possible. The .pk3 file alone is over 200mb. Not advisable.

Re: Sound activation on redundant wall

PostPosted: Wed Oct 06, 2021 1:47 am
by Enjay
OK, so there could be something odd about the file. So, yup, definitely worth checking. GZDoom is pretty good at playing whatever you throw at it but there are occasionally weird files that don't work for one reason or another.

Other possibilities could be that the file is in the wrong place (not in the sounds folder of your pk3) or you are using a longer than 8 character file name or the file extention in your sndinfo.

Given that you have other sounds that work. Neither of these seem that likely but, just in case, check the location of the sound, check the spelling of the sound lump name in sndinfo and, if it is a long name, or you are using the file extension in sndinfo for some reason, put the name and path to the sound file in quotes.

Re: Sound activation on redundant wall

PostPosted: Wed Oct 06, 2021 1:53 am
by Gunslaher_Pi
Wait, I actually need a "Sounds" directory? Well I suppose that might also add to the confusion. Just fixed that. Changed my two access sounds to .ogg format.

I'll change my Sndinfo and let you know.

Re: Sound activation on redundant wall

PostPosted: Wed Oct 06, 2021 2:06 am
by Enjay
Yes, there are several specific directories/folders that are required in a properly set up pk3. Sounds is one of them (graphics, patches, textures, sprites are a few more and there are several others). These folders put the various file types into the correct namespace so that GZDoom knows what type of data it is supposed to be and where to look for it.

Don't just dump files into your pk3 and don't just throw WAD files in there either (can cause memory issues).

More details can be found in the wiki. Using_ZIPs_as_WAD_replacement

Re: Sound activation on redundant wall

PostPosted: Wed Oct 06, 2021 2:08 am
by Gunslaher_Pi
It works! It works it works it works!

Thank you so much! I tested first in console then went to a locked door and voila! Access denied!

Yaaaaay! Thank you very much friend! Now I can start really getting serious and into making the map more realistic and the entire episode (Consists of 8 maps per episode - 4 in total equalling 32 maps total) just that much more spookier and terrifying!

Once again, thanks Enjay! You're the best! Thank you for your patience!


*Request thread to be locked*

Re: Sound activation on redundant wall

PostPosted: Wed Oct 06, 2021 2:11 am
by Enjay
Glad you got it sorted. I just added the link to a useful wiki page to my previous post.

We tend not to lock threads here unless absolutely necessary. Someone might have something valuable to add or a related question to ask.

Re: Sound activation on redundant wall

PostPosted: Wed Oct 06, 2021 2:42 am
by Gunslaher_Pi
Alright. Good point. Well ensure to add *Test sound in console First*

Good indicator if the sound def/file has injected itself properly.

Doom map editors are so different to Ken Silverman's "build" editor for Duke3D. I've literally logged years on that editor with 3D Realms.

Going from that to GzDoom Builder has been a ride but I've been blessed with a disposition of previous mapping experience.

Well, I've finished with my thread. Leave it open for others if you wish. Thanks again Enjay.