Changing sound channels for pickups?

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
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Changing sound channels for pickups?

Post by Ed the Bat »

Does anyone know of a simple way to manually dictate what sound channel an inventory's pickupsound is played on? I know that the default choice is the ITEM channel (understandably enough), but say for instance that I'd like the pickupsound to be a sample of the player character's voice. I would then most likely wish that sound to play on the VOICE channel, particularly to avoid it clashing with other sounds played on that channel such as cries of pain, etc., lest the player be heard talking over himself.

So far, this is the best solution I was able to come up with:

Code: Select all

ACTOR ItemGiver : CustomInventory
{
	+INVENTORY.AUTOACTIVATE
	Inventory.PickupSound ""
	States
	{
	Use:
		TNT1 A 0 A_PlaySound("*itempickup",CHAN_VOICE)
		Stop
	}
}
I then have actors inherit from this to act as pickups, and have their Pickup states give the real item (ammo, weapon, etc.), so that the player can run over it, get the true item, and play a voice sample on the VOICE channel. This is nearly a perfect solution to what I want, except for a few subtle nuances, such as the weapon pickups not being subject to certain flags/variables (weaponstay, anybody?).

Anyone know of a healthier solution than what I'm doing?
User avatar
Xtyfe
Posts: 1490
Joined: Fri Dec 14, 2007 6:29 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support

Re: Changing sound channels for pickups?

Post by Xtyfe »

I do the same for many things, and Is the only way as far as I know. You have better control over a sound with A_PlaySound then any of the actor properties that deal with sounds. Except for some things which are not doable without them, Though that only deals with monsters and the player and such.
C343
Posts: 49
Joined: Sat Jun 20, 2015 1:50 pm

Re: Changing sound channels for pickups?

Post by C343 »

Thanks for pointing this method out! Really helped.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Changing sound channels for pickups?

Post by NeuralStunner »

Unfortunately, the sound channels used for actor properties are still hardcoded. I think there might be a suggestion for channel parameters somewhere, though.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Changing sound channels for pickups?

Post by Ed the Bat »

Yes, I made that suggestion, which has unfortunately garnered no attention as far as I can tell. As I stated in the OP of this thread so long ago (three years and ten days, apparently), I'm not happy about the limitations of this workaround I've employed.
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Changing sound channels for pickups?

Post by The Zombie Killer »

I don't think it'd be an overly difficult feature to add. I might take a look at it once I get home from school in a few hours.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Changing sound channels for pickups?

Post by Ed the Bat »

Wouldn't be the first time that you've come through in a big way for me. You're the best. :)
User avatar
The Zombie Killer
Posts: 1528
Joined: Thu Jul 14, 2011 12:06 am
Location: Gold Coast, Queensland, Australia

Re: Changing sound channels for pickups?

Post by The Zombie Killer »

Last edited by The Zombie Killer on Wed Aug 26, 2015 1:58 am, edited 1 time in total.
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Changing sound channels for pickups?

Post by Ed the Bat »

You are the KING! :D
Locked

Return to “Editing (Archive)”