A few sound related questions...

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
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

A few sound related questions...

Post by Hidden Hands »

My game is in IPK3 format, and here's the things I'm having a few problems with...

Firstly, I have a folder called SOUNDS. Inside that folder, I have another directory called PLAYER. All the players sounds are in this folder.
Do I need to add some path finder in the SNDINFO because it's in a seperate directory? For example, instead of PLAYER/DEATH playdeth I would type PLAYER/DEATH sounds/player/playdeth ? Is this correct or no?

Secondly, I'm trying to change player sounds. I have 10 death sounds for example for the player to pick at RANDOM upon dying. (Much like the grunt/death sounds randomising in DOOM). How would I go about coding these? I mean, I'm not actually sure how Player sounds are done? For example, I mean when you look at the DECORATE of a player paun, there's no sounds listed to be called on: https://zdoom.org/wiki/Classes:DoomPlayer

I HAVE read this, and I don't understand a word of it.

Code: Select all

$playersound playerclass gender logicalname lumpname
Defines a sound used by a player. <playerclass> must be 'player' if the sound is used for a stock Doom, Strife, or Heretic class. If it is for a custom class, it can be named anything, so long as Player.SoundClass uses the same name. In Hexen, it can be either “fighter”, “mage” or “cleric”, in addition to any custom classes for the game. Gender can be “male”, “female” or “other”. Here you can find a list of all known player sounds and their meaning. If you wish to use additional sounds for custom skins, you use this like custom classes by defining the sounds that you wish to use, but instead you put the skin name into the <playerclass> string.
Note: An interesting note: ZDoom supports different player pain sounds depending on health. In Doom, Heretic and Hexen there is only one player pain sound, so it is handled like this in SNDINFO:
$playersound           player	male	*pain100	dsplpain
$playersounddup        player	male	*pain75		*pain100
$playersounddup        player	male	*pain50		*pain100
$playersounddup        player	male	*pain25		*pain100
The *pain100 used instead of a lump name for pain75, pain50, and pain25 tells those sounds to refer to pain100 for a sound lump to play. If you want you can change this, though, so you really have different pain sounds.

Another feature of the player sounds is that you can specify a custom damage type for pain and death sounds. You do this by defining the sound as follows:

$playersound           player  male    *death-fire     dsburn
When the player takes damage, ZDoom will attempt to find a sound with the matching damagetype first, and then will fall back to the generic sound (e.g. *death) if it is not found.

Finally, if a player sound is explicitly set to dsempty, no sound will be played. Setting it to another empty or invalid sound will make the engine look for a valid sound to play in the default or a parent player class.
I need the player to have the same as the monsters. IE; Pain sound, death sound, etc.

I hope someone can help, thanks in advance.
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: A few sound related questions...

Post by Jarewill »

Player sounds are defined differently than monster sounds.
For example:

Code: Select all

//Type             id        gender  name        sound
$playersound       hhound    male    *death      "sounds/HOUNDDIE.wav"
$playersound       hhound    male    *xdeath     "sounds/HOUNDDIE.wav"
$playersound       hhound    male    *gibbed     dsslop
$playersound       hhound    male    *pain100    "sounds/HOUNDPAIN.wav"
$playersounddup    hhound    male    *pain75     *pain100
$playersounddup    hhound    male    *pain50     *pain100
$playersound       hhound    male    *pain25     "sounds/HOUNDPAI2.wav"
$playersound       hhound    male    *grunt      DSSTNMOV
$playersounddup    hhound    male    *land       *grunt
$playersound       hhound    male    *jump       dsjump
$playersound       hhound    male    *fist       dspunch
$playersound       hhound    male    *usefail    DSSTNMOV
$playersound defines a new player sound, while $playersounddup defines a player sound from another player sound.
So in that example, *pain75 will sound the same as *pain100, while *pain25 will sound differently.

hhound is the player sound ID I used.
That ID is used in my player class with the SoundClass property:

Code: Select all

Player.SoundClass "hhound";
male is the player's gender, I actually have no idea if one has to define 3 genders or if the other ones will use the only defined one.

*death, *pain100, *grunt are all logical names used by the player. Here is a full list of them.

And finally the path to the sound.
You can define it normally, though I don't know if it will take them from subfolders.
Using paths ("sounds/player/playdeth") wouldn't hurt.

Now for making the death sound random, the first example at the SNDINFO wiki page actually has you covered:

Code: Select all

$random pl_death { player/death1 player/death2 player/death3 }

player/death1 pldth1
player/death2 pldth2
player/death3 pldth3

$playeralias           player  male    *death          pl_death
User avatar
Hidden Hands
Posts: 1053
Joined: Tue Sep 20, 2016 8:11 pm
Location: London, England
Contact:

Re: A few sound related questions...

Post by Hidden Hands »

I'm having a bit of trouble with this still. Let me give an example of what my SNDINFO looks like for player sounds...

Code: Select all

$random Hero/Pain { Hero/Pain01 Hero/Pain02 Hero/Pain03 Hero/Pain04 Hero/Pain05 Hero/Pain06 Hero/Pain07 Hero/Pain08 Hero/Pain09 Hero/Pain10 Hero/Pain11 Hero/Pain12 Hero/Pain13 Hero/Pain14 Hero/Pain15 Hero/Pain16 }
Hero/Pain01 GILCPN01
Hero/Pain02 GILCPN02
Hero/Pain03 GILCPN03
Hero/Pain04 GILCPN04
Hero/Pain05 GILCPN05
Hero/Pain06 GILCPN06
Hero/Pain07 GILCPN07
Hero/Pain08 GILCPN08
Hero/Pain09 GILCPN09
Hero/Pain10 GILCPN10
Hero/Pain11 GILCPN11
Hero/Pain12 GILCPN12
Hero/Pain13 GILCPN13
Hero/Pain14 GILCPN14
Hero/Pain15 GILCPN15
Hero/Pain16 GILCPN16

$random Hero/PhoneDead { Hero/PhoneDead01 Hero/PhoneDead02 Hero/PhoneDead03 Hero/PhoneDead04 Hero/PhoneDead05 Hero/PhoneDead06 Hero/PhoneDead07 Hero/PhoneDead08 Hero/PhoneDead09 Hero/PhoneDead10 Hero/PhoneDead11 }
Hero/PhoneDead01 GILCPD01
Hero/PhoneDead02 GILCPD02
Hero/PhoneDead03 GILCPD03
Hero/PhoneDead04 GILCPD04
Hero/PhoneDead05 GILCPD05
Hero/PhoneDead06 GILCPD06
Hero/PhoneDead07 GILCPD07
Hero/PhoneDead08 GILCPD08
Hero/PhoneDead09 GILCPD09
Hero/PhoneDead10 GILCPD10
Hero/PhoneDead11 GILCPD11
Do I have to use PLAYER to make this go correctly, or can I use this format I'm trying? Can I not get this to work?
Guest

Re: A few sound related questions...

Post by Guest »

You will have to use the $playeralias to set it as the player's death sound.
Or you can play those sounds manually using A_StartSound in the Pain and Death states instead of A_Pain and A_Scream.
Post Reply

Return to “Scripting”