Page 1 of 1

Changing sound channels for pickups?

Posted: Wed Aug 15, 2012 6:58 am
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?

Re: Changing sound channels for pickups?

Posted: Wed Aug 15, 2012 10:20 am
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.

Re: Changing sound channels for pickups?

Posted: Tue Aug 25, 2015 10:46 am
by C343
Thanks for pointing this method out! Really helped.

Re: Changing sound channels for pickups?

Posted: Tue Aug 25, 2015 4:31 pm
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.

Re: Changing sound channels for pickups?

Posted: Tue Aug 25, 2015 6:56 pm
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.

Re: Changing sound channels for pickups?

Posted: Tue Aug 25, 2015 7:28 pm
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.

Re: Changing sound channels for pickups?

Posted: Tue Aug 25, 2015 7:30 pm
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. :)

Re: Changing sound channels for pickups?

Posted: Wed Aug 26, 2015 1:56 am
by The Zombie Killer

Re: Changing sound channels for pickups?

Posted: Wed Aug 26, 2015 1:57 am
by Ed the Bat
You are the KING! :D