Not getting the pickup sound for ammo

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom 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.

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!)
IgnyteZero
Posts: 10
Joined: Thu Jan 16, 2025 12:17 pm
Operating System Version (Optional): Windows 10

Not getting the pickup sound for ammo

Post by IgnyteZero »

Ok, so I working on doing a sort of remaster of some levels I did almost 30 years ago or so. And I've added some new stuff to the project. Now I can't code to save my life so this have been a learning process, using Slade and all. Anyway, while I originally worked with Boom I decided to be able to add new stuff to run in UDMF mode instead and I playtest it with GZDoom.

So, my current issue is I addd the UTNTFlamethrower (dl:ed it from Realm667) to the WAD. It works great, just had to rebalance the damage a little as it was a bit too powerful for the kind of maps I'm working on. But this worked fine, seemingly. But something that I haven't gotten to work yet is the pickup sound for the ammo. The .pk3 of the weapon includes only three soundfiles, and they are for the weapon fire. They work fine, and are defined in the SNDINFO. The ZSCRIPT points the weapon pickup to it's sound with the phrase:

Code: Select all

Inventory.PickupSound "misc/w_pkup";"
This works just fine. The actual ammo is referred to it's sound with the phrase

Code: Select all

Inventory.PickupSound "misc/pickup";
. But picking up this ammo in the game creates no sound effect at all. I tried to, with my limited (read: nonexistent) knowledge have it point to the DSITEMUP sound in the original DOOM2 iwad instead, but since I don't know what I'm doing that apparently didn't work. So I removed that.

So, my guess is that that variable misc/pickup is a broken reference, and that's why it's not playing. If anyone could help me get the regular pickup sound for the ammo working that would be immensily helpful, and I would be equally grateful. It's very unsatisfying picking up that ammo atm.

So, here's the snippet about ammo from my ZSCRIPT file for the weapon:

Code: Select all

Class Gas : Ammo
{
  Default
  {
    Inventory.PickupSound "misc/pickup";
    Inventory.Amount 24;
    Inventory.MaxAmount 300;
    Ammo.BackpackAmount 24;
    Ammo.BackpackMaxAmount 600;
    Inventory.PickupMessage "You picked up a cannister of hellgas";
    Inventory.Icon "AGASA0";
  }

  States
  {
  Spawn:
    AGAS A -1;
    Loop;
  }
}

Class BigGas : Gas
{
  Default
  {
    Inventory.Amount 80;
    Inventory.PickupMessage "You picked up a large cannister of hellgas";
    Inventory.Icon "AGASB0";
  }
As nothing in the ZSCRIPT regarding ammo refers the files listed in the SNDINFO I doubt it's meaningful, but here's that file too anyway:

Code: Select all

Flamethrower/Fire FMTRFIRE
Flamethrower/Hit FMTRHIT
Flamethrower/Flame FMTRFLAM
I am assuming it's an easy fix if you just know how. Unlike me. :D
IgnyteZero
Posts: 10
Joined: Thu Jan 16, 2025 12:17 pm
Operating System Version (Optional): Windows 10

Re: Not getting the pickup sound for ammo

Post by IgnyteZero »

Solved it on my own. Had to manually export the default pickup sound DSITEMUP from Doom2, import it into my wad, rename it, make a referral in SNDINFO. And most importantly convert it to .wav format instead of the Doom default format. So now it works.
User avatar
Enjay
 
 
Posts: 26697
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Not getting the pickup sound for ammo

Post by Enjay »

If you just want the Doom item pickup sound, none of what you did should be necessary.

The sound name you need is "misc/i_pkup" as defined in the SNDINFO lump in gzdoom.pk3/filter/game-doomchex/sndinfo.txt

Code: Select all

misc/secret			dssecret
misc/w_pkup			dswpnup		// Pickup weapon
misc/p_pkup			dsgetpow	// Pickup powerup
misc/i_pkup			dsitemup	// Pickup item
misc/k_pkup			dsitemup	// Pickup key
misc/spawn			dsitmbk		// Item respawn
misc/chat			dsradio		// Doom 2 chat sound
misc/chat2			dstink		// Chat sound for everything else
If you are interested, there is also this in the root sndinfo:

Code: Select all

// Pickup sounds that were not unique before
$alias misc/health_pkup		misc/i_pkup	// Pickup health
$alias misc/armor_pkup		misc/i_pkup	// Pickup armor
$alias misc/ammo_pkup		misc/i_pkup	// Pickup ammo
So, those names are valid too.

BTW, you can check if a sound is working from the console.
Simply type playsound [soundname]
e.g. playsound misc/i_pkup
and,if valid, the sound should play.
IgnyteZero
Posts: 10
Joined: Thu Jan 16, 2025 12:17 pm
Operating System Version (Optional): Windows 10

Re: Not getting the pickup sound for ammo

Post by IgnyteZero »

Thank you! I was looking for lists like that but couldn't find it. Guess I wasn't looking hard enough. Didn't think of looking in the gzdoom sndinfo.

That is very helpful.

Return to “Scripting”