Can't assign a class random hurt sounds

Discuss all aspects related to modding Zandronum here.
Post Reply
OkDoomer174
New User
Posts: 3
Joined: Sat Jul 03, 2021 8:35 pm

Can't assign a class random hurt sounds

#1

Post by OkDoomer174 » Sat Jul 03, 2021 9:21 pm

I've been trying to create a WAD with custom random hurt sound for its different classes, but it doesn't seem to work. Everything seems to be exactly as described on the ZDoom wiki, but the class plays the default player hurt sound. I've seen the Mecha-Demon from Zandronum's Community Classes work with a single sound, but my class won't. Strangely enough, it does work in GZDoom 4.6.

Here's some things to take a look at:

Class in DECORATE:

Code: Select all

actor Scout : DoomPlayer
{
	Player.DisplayName "Scout"
	Player.SoundClass "scout"
	Speed 1.25
	Player.StartItem "Shotgun"
	Player.StartItem "Pistol"
	Player.StartItem "Fist"
	Player.StartItem "Shell", 20
	Player.StartItem "Clip", 50
	Player.WeaponSlot 1, Shotgun
	Player.WeaponSlot 2, Pistol
	Player.WeaponSlot 3, Fist
}
Sounds for class in SNDINFO:

Code: Select all

scpain1 "sounds/scout/scpain1.ogg"
scpain2 "sounds/scout/scpain2.ogg"
scpain3 "sounds/scout/scpain3.ogg"
scpain4 "sounds/scout/scpain4.ogg"
scpain5 "sounds/scout/scpain5.ogg"
scpain6 "sounds/scout/scpain6.ogg"
scpain7 "sounds/scout/scpain7.ogg"
scpain8 "sounds/scout/scpain8.ogg"
$random sc_hurt { scpain1 scpain2 scpain3 scpain4 scpain5 scpain6 scpain7 scpain8 }

$playeralias	scout	male	*pain100	sc_hurt
$playeralias	scout	male	*pain75		*pain100
$playeralias	scout	male	*pain50		*pain75
$playeralias	scout	male	*pain25		*pain50
This is a .PK3, so all of the sounds above are located at sounds/scout. The SNDINFO has been tested without sounds/ at the beginning.

I would upload the file, but the forum is complaining that it's too large.

Any help would be greatly appreciated.

OkDoomer174
New User
Posts: 3
Joined: Sat Jul 03, 2021 8:35 pm

Re: Can't assign a class random hurt sounds

#2

Post by OkDoomer174 » Mon Jul 05, 2021 5:44 pm

I found it out, actually! Turns out in Zandronum, you can't redefine sound classes through inheritance after they've already been defined. All I needed to do is make Scout inherit from another class (called TFPlayer), make the TFPlayer class inherit from PlayerPawn instead of DoomPlayer (so PlayerPawn > TFPlayer > Scout) and paste all the regular DoomPlayer stuff into TFPlayer EXCEPT everything that gets redefined. People who had the same problem as me, you're welcome.

Post Reply