Jump to content
  • 0

Quake-like key sounds without editing a ton of files


DaAndroid614

Question

Pertaining to GZDOOM editing specifically

If I wanted to change the sounds the keys make based on what type of key was picked up, as it is in Quake, I wouldn't be able to do it entirely through SNDINFO since only one specific key pickup sound is defined, so the other way I would think to do it would be to use DECORATE (I'm not that experienced with ZScript so there might be a simpler solution through that) to make new versions of each key which have their sound changed to a unique one, but if I did that, I would also need to edit SBARINFO to show the new keys instead of the old ones so they actually show up on the HUD and LOCKDEFS so you would be able to open doors with the new keys.
Changing this many files seems like overkill just to accomplish a sound change, is there a way of going about this that wouldn't require fiddling with as many (mostly) unrelated files? 

Share this post


Link to post

5 answers to this question

Recommended Posts

  • 3
20 minutes ago, DaAndroid614 said:

I had already tried this before posting in the thread, and unfortunately it either doesn't work or I had done something wrong 

I misremembered. It's the Species property that handles it.

Actor RedCardCustomSound : RedCard replaces RedCard
{
	Species RedCard
	PickupSound RedCardSound
}

That should work.

 

21 minutes ago, DaAndroid614 said:

The ACS solution did end up working, though.

Glad you did find a workaround anyway!

Share this post


Link to post
  • 1
1 hour ago, Gez said:

I believe there was an update to make the status bar and locks take replaced keys into account? You should be able to test that quickly. Something like:


Actor RedCardCustomSound : RedCard replaces RedCard { PickupSound RedCardSound }

Change as appropriate and try to see if the status bar and red locks still work. I think they will.

I had already tried this before posting in the thread, and unfortunately it either doesn't work or I had done something wrong

 

The ACS solution did end up working, though.

#library "KEYSOUND"
#include "zcommon.acs"

bool REDCARD = false;
bool BLUECARD = false;
bool YELLOWCARD = false;
bool REDSKULL = false;
bool BLUESKULL = false;
bool YELLOWSKULL = false;

script "SOUNDMIX_KEYSOUND" ENTER
{
	while (true)
	{
		if (REDCARD != CheckInventory("RedCard"))
		{
			PlaySound(0,"Q_CARD",3);
			REDCARD = true;
		}
		if (BLUECARD != CheckInventory("BlueCard"))
		{
			PlaySound(0,"Q_CARD",3);
			BLUECARD = true;
		}
		if (YELLOWCARD != CheckInventory("YellowCard"))
		{
			PlaySound(0,"Q_CARD",3);
			YELLOWCARD = true;
		}
		if (REDSKULL != CheckInventory("RedSkull"))
		{
			PlaySound(0,"Q_SKULL",3);
			REDSKULL = true;
		}
		if (BLUESKULL != CheckInventory("BlueSkull"))
		{
			PlaySound(0,"Q_SKULL",3);
			BLUESKULL = true;
		}
		if (YELLOWSKULL != CheckInventory("YellowSkull"))
		{
			PlaySound(0,"Q_SKULL",3);
			YELLOWSKULL = true;
		}
		delay(1);
	}
}

 

Edited by DaAndroid614
fixed embedded code

Share this post


Link to post
  • 0

You can add custom "A_PlaySound" for every key in Decorate (and make "none" for Pickupsound to prevent playing 2 sounds at once). But first you must define all new sounds in SNDINFO and after that add PlaySound with those sounds.

Edited by Dexiaz

Share this post


Link to post
  • 0
29 minutes ago, Dexiaz said:

You can add custom "A_PlaySound" for every key in Decorate (and make "none" for Pickupsound to prevent playing 2 sounds at once). But first you must define all new sounds in SNDINFO and after that add PlaySound with those sounds.

I think you might have misunderstood what I was asking, A_PlaySound can only be used inside a state, which means once the key is picked up I won't be able to use it to do anything.
Besides, even if I could use it to play a sound when they key is picked up, it wouldn't let me overwrite the original keys and I'd be back at the same issue of needing to change SBARINFO and LOCKDEFS in order to keep the keys working.
Although muting the pickup sound and playing a sound from a different source isn't a bad idea, I'll look into using ACS to detect the keys in the player's inventory and playing them through there

Share this post


Link to post
  • 0
2 hours ago, DaAndroid614 said:

Changing this many files seems like overkill just to accomplish a sound change, is there a way of going about this that wouldn't require fiddling with as many (mostly) unrelated files? 

I believe there was an update to make the status bar and locks take replaced keys into account? You should be able to test that quickly. Something like:

Actor RedCardCustomSound : RedCard replaces RedCard { PickupSound RedCardSound }

Change as appropriate and try to see if the status bar and red locks still work. I think they will.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...