Maybe someone can help me here. I'm trying to make a special jingle play when you pick up a key in my game. I only want it to play this for keys though, not health or armour or ammo. How can I make it so that just that one type of item plays the sound? Does it have to call an ACS Script? Because when I tried doing that, it plays the new sound but also the original sound at the same time. I only want it to play the one key jingle sound. Can it be done please? How?
Thanks in advance.
Item Pickups that have their own PICKUP sound
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
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.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
- Hidden Hands
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
- Contact:
Re: Item Pickups that have their own PICKUP sound
The various pickup types already have their own sounds defined, it's just that they are mapped to the same sound lump.
So, if you just want to change all keys, map misc/k_pkup to your own sound lump in SNDINFO.
If you want any individual items to have their own specific sound, this can be done by defining a unique pickup sound in SNDINFO and then telling the item to use that sound as its pickup sound in its DECORATE or ZScript.
Code: Select all
misc/w_pkup dswpnup // Pickup weapon
misc/p_pkup dsgetpow // Pickup powerup
misc/i_pkup dsitemup // Pickup item
misc/k_pkup dsitemup // Pickup key
If you want any individual items to have their own specific sound, this can be done by defining a unique pickup sound in SNDINFO and then telling the item to use that sound as its pickup sound in its DECORATE or ZScript.
- Hidden Hands
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
- Contact:
Re: Item Pickups that have their own PICKUP sound
Okay, so basically, if I'm getting this right, my SOUNDINFO should have this:Enjay wrote:The various pickup types already have their own sounds defined, it's just that they are mapped to the same sound lump.
So, if you just want to change all keys, map misc/k_pkup to your own sound lump in SNDINFO.Code: Select all
misc/w_pkup dswpnup // Pickup weapon misc/p_pkup dsgetpow // Pickup powerup misc/i_pkup dsitemup // Pickup item misc/k_pkup dsitemup // Pickup key
If you want any individual items to have their own specific sound, this can be done by defining a unique pickup sound in SNDINFO and then telling the item to use that sound as its pickup sound in its DECORATE or ZScript.
Code: Select all
misc/w_pkup weappick // Pickup weapon
misc/p_pkup powrpick // Pickup powerup
misc/i_pkup itempick // Pickup item
misc/k_pkup keyspick // Pickup key
EDIT: Well I did it and it worked great. Wonderful work man, thank you so much!
- Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
- Contact:
Re: Item Pickups that have their own PICKUP sound
For reference, the engine knows which sound to use because each superclass of item has its Inventory.PickupSound property set to the appropriate sound name, and the individual item types inherit that. If you ever need to give a specific item its own unique pickup sound, you can toss that into the item's definition and it'll work just fine ... provided you've set up the sound in SNDINFO, anyway.
