[SOLVED: DEV IS HALF BLIND] Attacksound Not Playing

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!)
Post Reply
User avatar
Niekitty
Posts: 12
Joined: Fri Aug 04, 2023 10:48 pm
Operating System Version (Optional): Win 10 Pro
Location: Sadly not hell.

[SOLVED: DEV IS HALF BLIND] Attacksound Not Playing

Post by Niekitty »

Ooooookay. I've spent two days looking stuff up and beating my head against this problem. I've Googled until even phone started giving me weird looks.
I am working on a mod, mostly for the fun of it and to kill time at work (lots of hours with nothing else to do). I took the UAC Pistol mod and took some pieces of it to assemble a new pistol for my mod. I didn't want the whole reloading mechanic going on for this, for one thing, and for another I converted it from Decorate to zScript so that I could attach a dynamic light to it for a flashlight. Absolutely everything worked fine.
Except the sound effects.
Picking it up makes a sound. Doing anything in the entire pk3 makes the right sounds. The custom zombie scientists I ported into my mod? Yeah, their sound is fine, no issues at all there. All the sounds are working perfectly... except this one, specific, pistol attacksound.

My (likely whacko) File Structure:
[imgur]https://imgur.com/a/inYDv6g[/imgur]

The zScript for the weapon:

Code: Select all

Class UACPistol : Weapon
{
	Default
	{
		Obituary "They landed on the multiplication table.";
		Inventory.pickupmessage "UAC Security Pistol. At least they don't jam. Often.";
		Weapon.SelectionOrder 3500;
		Weapon.AmmoUse 1;
		Weapon.AmmoGive 12;
		Weapon.SlotNumber 2;
		Weapon.kickback 100;
		Weapon.AmmoType "Clip";
		Decal "BulletChip";
		+WEAPON.NOAUTOFIRE;
	}
	States
	{
		Spawn:
			Wp0f A -1;
			Stop;
		Ready:
			Wp01 A 1 A_Weaponready;
			Loop;
		Select:
			Wp03 A 2 A_Attachlight ("pstllight", DynamicLight.PointLight, "ffffe6", 128,0, DYNAMICLIGHT.LF_DONTLIGHTSELF|DYNAMICLIGHT.LF_ATTENUATE|DYNAMICLIGHT.LF_SPOT, (0,0,24),0,10,32,100);
			Wp03 A 2 A_Raise(16);
			Loop;
		Deselect:
			Wp03 B 2 A_Removelight ("pstllight");
			Wp03 B 2 A_Lower(16);
			Loop;
		Fire:
			Wp02 A 0 Bright A_Attachlight ("pstlflsh", DynamicLight.PointLight, "ffffff", 128,0, DYNAMICLIGHT.LF_DONTLIGHTSELF|DYNAMICLIGHT.LF_ATTENUATE,(0,0,24));
			Wp02 A 0 Bright A_PlaySound ("weapon/gock", CHAN_WEAPON);
			Wp02 A 2 Bright A_FireBullets (1,1,0,15,"BulletPuff");/* horz spread, vert spread, spreadtype, damage, ammo*/
			Wp02 B 4 A_Removelight ("pstlflsh");
			Wp02 C 4;
			Goto Ready;
	}
}
FOR THE RECORD: I originally had it set up the way it was with the Decorate file that came with the mod, where it had an actual

Code: Select all

Attacksound "weapon/gock"
instead of the A_PlaySound. That didn't work either. Same issue.

SNDINFO:

Code: Select all

KnifeHit DSKNIFE
CrowbarHit DSCBAR
Steam/Loop	STEMLOOP
Steam/Fire	STEMFIRE
$random	fem/death { fem/death1 fem/death2 }
$random	fem/sight { fem/sight1 fem/sight2 }
fem/sight1 FEMZSIT
fem/sight2 FEMZSI2
fem/pain FEMZPAIN
fem/death1 FEMZDHT
fem/death2 FEMZDT2
fem/active FEMZACT
KnifeHit DSKNIFE
weapons/gock GOCK
EVERYTHING in this SNDINFO works except that last one, and I have no freaking clue why not.

I have checked the .ogg, it works just fine on its own, and plays through the file viewer in Slade without issue.
Last edited by Niekitty on Wed May 01, 2024 3:51 am, edited 1 time in total.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Attacksound Not Playing

Post by ramon.dexter »

Does the sound play if you play it from console with PlaySound <sound>?
User avatar
Niekitty
Posts: 12
Joined: Fri Aug 04, 2023 10:48 pm
Operating System Version (Optional): Win 10 Pro
Location: Sadly not hell.

Re: Attacksound Not Playing

Post by Niekitty »

ramon.dexter wrote: Tue Apr 30, 2024 11:26 pm Does the sound play if you play it from console with PlaySound <sound>?
No it does not. No error message, just... nothing.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Attacksound Not Playing

Post by ramon.dexter »

Yes, thats okay. So the sounds are defined incorrectly. How does your archive look like&how does you sndinfo look like? Show whole archive and whole sndinfo, not snippets.
User avatar
Niekitty
Posts: 12
Joined: Fri Aug 04, 2023 10:48 pm
Operating System Version (Optional): Win 10 Pro
Location: Sadly not hell.

Re: Attacksound Not Playing

Post by Niekitty »

Those aren't snippets. The screenshot is my entire audio file structure so far, and the SNDINFO is the whole SNDINFO copied and pasted. Thhhhat's all there is.
I mean... the rest of the custom sounds are all working perfectly, which is why I'm so confused with this one sound effect, but I quite literally posted the entire sound structure and sound definitions for this project up there.
If there's something more I'm missing that only applies to weapons, or things in my inventory, or something, I haven't seen mention of it.

No idea if it'll help at all figuring out what I screwed up this time, but...
https://www.dropbox.com/scl/fi/tryclfpv ... 4dfkn&dl=0
User avatar
phantombeta
Posts: 2177
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Attacksound Not Playing

Post by phantombeta »

Your SNDINFO defines weapons/gock while your ZScript tries to play weapon/gock.
Also, your "sounds" folder is actually named " sounds", which I also had to fix to get the sound to work.
User avatar
Niekitty
Posts: 12
Joined: Fri Aug 04, 2023 10:48 pm
Operating System Version (Optional): Win 10 Pro
Location: Sadly not hell.

Re: Attacksound Not Playing

Post by Niekitty »

phantombeta wrote: Wed May 01, 2024 2:25 am Your SNDINFO defines weapons/gock while your ZScript tries to play weapon/gock.
Also, your "sounds" folder is actually named " sounds", which I also had to fix to get the sound to work.
Head. Freaking. Desk.

Thank you, Phantom!!!

I've been driving myself nuts for two days looking for some fiddly little detail I missed, like a colon instead of semi-colon or something. How the chickenmcnuggets did I miss that?!?!
WELL, now that I feel like a right PROPER idiot, I will be going and hiding under a rock for a month.
...and probably seeing if I can screw up anything ELSE super simple in here...
Post Reply

Return to “Scripting”