PlaySound works in Zandronum, does not work in GZDOOM

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!)
trudaddy
Posts: 1
Joined: Sun Nov 13, 2022 3:33 pm

PlaySound works in Zandronum, does not work in GZDOOM

Post by trudaddy »

Hi All,

I am at my wit's end with this issue. In short, PlaySound works in Zandronum in-game. Sounds play from all scripts, whether they are played by activator or other channels/map spots. Playsound works in the console. However when I test my mod in GZDOOM, PlaySound no longer works. The sound file names are less than 8 characters. I can use Playsound in the console and the sounds play. They just simply do not play in the game world. Below is code from the first level, and this is literally the first thing that happens to the player. Again, the intro audio plays 100% in Zandronum. I am using a .pk3 file. All sounds are in /sounds.

Code: Select all

script 15 ENTER

{

	FadeTo (0, 0, 0, 1.0, 0.0);
	SetPlayerProperty (1, 1, PROP_TOTALLYFROZEN);
	DELAY (35);
	PlaySound(0,"STUCKBR", CHAN_VOICE, 1.0, FALSE, ATTN_NONE);
	delay (425);
	FadeTo (0, 0, 0, 0, 8.0);
	SetPlayerProperty (1, 0, PROP_TOTALLYFROZEN);

}
Here is my a sample of sndinfo sample:

Code: Select all

	TERRI	TERRI
	STUCKBR	STUCKBR
	HELLA	HELLA	
	CLNWTR	CLNWTR
	HELPME	HELPME
	AWFUCK	AWFUCK
	THKGD	THKGD
	INDRM1	INDRM1
	WTRCMDR	WTRCMDR
	VENTS	VENTS
	ADMIR	ADMIR
	NIRVANA	NIRVANA
	AGHH	AGHH
	SITREP	SITREP
	MTDIE	MTDIE
	MEATSND	MEATSND
I'm at a loss, here. I am a lurker, but I had to finally make an account because I have not seen this issue anywhere else. I am using the lastest GZDOOM. Any help would be greatly welcomed.
Jarewill
Posts: 1400
Joined: Sun Jul 21, 2019 8:54 am

Re: PlaySound works in Zandronum, does not work in GZDOOM

Post by Jarewill »

Try including the full path to the sound file with the extension, for example:
weapons/cbowfire1 "sounds/CBOWFIRE1.wav"

If that doesn't work then you might need to upload a file showcasing your issue.

Return to “Scripting”