Sound trigger on locked door

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze 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.

Sound trigger on locked door

Postby Gunslaher_Pi » Mon Sep 27, 2021 4:47 am

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!
Last edited by Gunslaher_Pi on Wed Oct 06, 2021 8:55 pm, edited 1 time in total.
User avatar
Gunslaher_Pi
 
Joined: 17 Jan 2021
Location: Aussieland
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Sound activation on redundant wall

Postby Enjay » Mon Sep 27, 2021 6:34 am

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Sound activation on redundant wall

Postby Gunslaher_Pi » Tue Sep 28, 2021 5:44 am

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.
User avatar
Gunslaher_Pi
 
Joined: 17 Jan 2021
Location: Aussieland
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Sound activation on redundant wall

Postby Enjay » Tue Sep 28, 2021 6:23 am

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.
You do not have the required permissions to view the files attached to this post.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Sound activation on redundant wall

Postby Gunslaher_Pi » Sun Oct 03, 2021 9:23 am

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?
User avatar
Gunslaher_Pi
 
Joined: 17 Jan 2021
Location: Aussieland
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Sound activation on redundant wall

Postby Enjay » Sun Oct 03, 2021 9:42 am

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.]
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Sound activation on redundant wall

Postby Gunslaher_Pi » Tue Oct 05, 2021 11:01 pm

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. ☹️
User avatar
Gunslaher_Pi
 
Joined: 17 Jan 2021
Location: Aussieland
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Sound activation on redundant wall

Postby Enjay » Wed Oct 06, 2021 1:15 am

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Sound activation on redundant wall

Postby Gunslaher_Pi » Wed Oct 06, 2021 1:32 am

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.
User avatar
Gunslaher_Pi
 
Joined: 17 Jan 2021
Location: Aussieland
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Sound activation on redundant wall

Postby Enjay » Wed Oct 06, 2021 1:47 am

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Sound activation on redundant wall

Postby Gunslaher_Pi » Wed Oct 06, 2021 1:53 am

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.
User avatar
Gunslaher_Pi
 
Joined: 17 Jan 2021
Location: Aussieland
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Sound activation on redundant wall

Postby Enjay » Wed Oct 06, 2021 2:06 am

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
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Sound activation on redundant wall

Postby Gunslaher_Pi » Wed Oct 06, 2021 2:08 am

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*
User avatar
Gunslaher_Pi
 
Joined: 17 Jan 2021
Location: Aussieland
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)

Re: Sound activation on redundant wall

Postby Enjay » Wed Oct 06, 2021 2:11 am

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.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Sound activation on redundant wall

Postby Gunslaher_Pi » Wed Oct 06, 2021 2:42 am

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.
User avatar
Gunslaher_Pi
 
Joined: 17 Jan 2021
Location: Aussieland
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: Intel (Modern GZDoom)


Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 0 guests