PlayerSound for morph not working?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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
cawmageddon
Posts: 9
Joined: Thu May 25, 2023 6:45 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

PlayerSound for morph not working?

Post by cawmageddon »

Hi all,

I want to morph the player into a female version for one area of the map and back.
The female character is called "Telos", so I have got some sounds and defined them in SNDINFO as follows:

Code: Select all

FEMUSER1 FEMUSER1
FEMDEATH FEMDEATH
FEMPAIN1 FEMPAIN1
FEMPAIN2 FEMPAIN2
FEMPAIN3 FEMPAIN3
FEMPAIN4 FEMPAIN4
$random RFEMPAIN { FEMPAIN1 FEMPAIN2 FEMPAIN3 FEMPAIN4}

$playersound telos male *death FEMDEATH
$playersounddup telos male *xdeath *death
$playersound telos male *gibbed dsslop
$playersound telos male *pain100 RFEMPAIN
$playersounddup telos male *pain75 *pain100
$playersounddup telos male *pain50 *pain100
$playersounddup telos male *pain25 *pain100
$playersound telos male *jump dsempty
$playersound telos male *fist dsempty
$playersound telos male *usefail FEMUSER1
$playersounddup telos male *grunt *usefail
$playersounddup telos male *land *usefail
Then I have my Morph item and player morph class setup like this:

Code: Select all

Class TelosMorph : PowerMorph
{
	Default {
		Powerup.Duration 0x7FFFFFFD;
		PowerMorph.PlayerClass "GirlPlayer";
		PowerMorph.MorphStyle MRF_FULLHEALTH | MRF_WHENINVULNERABLE | MRF_LOSEACTUALWEAPON;
		PowerMorph.MorphFlash "NoFlash";
		PowerMorph.UnMorphFlash "NoFlash";
	}
}

Class GirlPlayer : PlayerPawn
{ 
	Default {
		Player.ForwardMove 0.5, 0.5;
		Player.SideMove 0.5, 0.5;
		Player.ViewBob 0.5;
		Player.Face "VRK";
		Player.DisplayName "You";
		Player.SoundClass "telos";
		Player.MorphWeapon "Flashlight";
		+PLAYERPAWN.CROUCHABLEMORPH;
		+PICKUP
	}
}
For some reason, this works only for the "use fail" sound. All other sounds (pain, landing, death) are simply silent.
I tried playing the sounds from the console in-game and they all work fine - so it's not a problem with the sound files or the way they're set up in SNDINFO.

Does anyone know why it will work only for the "*usefail" sound and not the others? Is it something to do with how Morphs work?
Post Reply

Return to “Scripting”