Issue With Pistol Sound (SOLVED)
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.
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.
Issue With Pistol Sound (SOLVED)
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.
-
- Posts: 4949
- Joined: Sun Nov 14, 2010 12:59 am
Re: Issue With Pistol Sound
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.
Re: Issue With Pistol Sound
Its a custom pistol (should have mentioned that), but the pickup sound works for the other custom weapons. Here is the weapon.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.
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
}
}
-
- Posts: 4949
- Joined: Sun Nov 14, 2010 12:59 am
Re: Issue With Pistol Sound
Bring up the console (press the ~ key on your keyboard), and enter this command:
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].
Code: Select all
playsound items/wep_pickup
Re: Issue With Pistol Sound
Turns out I had the specified pick up sound name wrong. "items/wep_pkup" was the correct definition.Blue Shadow wrote:Bring up the console (press the ~ key on your keyboard), and enter this command:
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].Code: Select all
playsound items/wep_pickup
Thank you for your help Blue.