Issue With Pistol Sound (SOLVED)

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
Exosphere
Posts: 168
Joined: Sun Jun 11, 2017 11:42 am
Location: New England, US

Issue With Pistol Sound (SOLVED)

Post by Exosphere »

I've noticed that the pistol doesn't have a pickup sound and, ever odder, it won't allow a sound to be played even when a pickup sound is explicitly defined. The sound won't even work even when the weapon is created using the WEAPON class. Whats going on and, if possible, how do I fix it?
Last edited by Exosphere on Tue Sep 12, 2017 12:36 pm, edited 1 time in total.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Issue With Pistol Sound

Post by Blue Shadow »

Are you talking about the original pistol or a custom one you're creating? If it's the original, then it's working fine. If it's a custom one, show us the code.
User avatar
Exosphere
Posts: 168
Joined: Sun Jun 11, 2017 11:42 am
Location: New England, US

Re: Issue With Pistol Sound

Post by Exosphere »

Blue Shadow wrote:Are you talking about the original pistol or a custom one you're creating? If it's the original, then it's working fine. If it's a custom one, show us the code.
Its a custom pistol (should have mentioned that), but the pickup sound works for the other custom weapons. Here is the weapon.

Code: Select all

ACTOR AutoMag : Weapon 19999
{
	Inventory.PickupMessage "You got the AutoMag Electromagnetic Handgun."
	Weapon.AmmoType "I_HandgunAmmo"
	Weapon.AmmoUse 1
	Weapon.AmmoGive 30
	
	+Weapon.NoAlert
	+NOAUTOFIRE
	
	Scale 0.2

	Inventory.PickupSound "items/wep_pickup"
	Weapon.SlotNumber 1
	
	States
	{
		Ready:
			PISG A 1 A_WeaponReady
			Loop
		Deselect:
			PISG A 1 A_Lower 
			Loop
		Select:
			PISG A 1 A_Raise
			Loop
		Fire:
			PISG A 1
			PISG B 1 BRIGHT A_FireBullets(3, 3, 2, 13, "BulletPuff", 1)
			TNT1 A 0 A_SetPitch(pitch-0.8)
			PISG B 1 BRIGHT A_GUNFLASH
			TNT1 A 0 A_SetPitch(pitch+0.8)
			PISG C 1 BRIGHT A_PlaySound("weapons/pfire", CHAN_WEAPON)
			PISG B 1
			Goto Ready
		Flash:
			PISF A 1 Bright A_Light1
			Goto LightDone
		Spawn:
			AMSP B -1
			Stop
	}	
}
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Issue With Pistol Sound

Post by Blue Shadow »

Bring up the console (press the ~ key on your keyboard), and enter this command:

Code: Select all

playsound items/wep_pickup
Do you hear the sound? If you don't, then make sure the sound file exist and is in the appropriate [wiki]namespace[/wiki]. Also make sure you have a definition for the sound in [wiki]SNDINFO[/wiki].
User avatar
Exosphere
Posts: 168
Joined: Sun Jun 11, 2017 11:42 am
Location: New England, US

Re: Issue With Pistol Sound

Post by Exosphere »

Blue Shadow wrote:Bring up the console (press the ~ key on your keyboard), and enter this command:

Code: Select all

playsound items/wep_pickup
Do you hear the sound? If you don't, then make sure the sound file exist and is in the appropriate [wiki]namespace[/wiki]. Also make sure you have a definition for the sound in [wiki]SNDINFO[/wiki].
Turns out I had the specified pick up sound name wrong. "items/wep_pkup" was the correct definition.
Thank you for your help Blue. :)
Locked

Return to “Editing (Archive)”