More then one Pain sound?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Graaicko
Posts: 513
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

More then one Pain sound?

Post by Graaicko »

So In regards to my project, Shadow Elite: http://www.moddb.com/mods/shadow-elite. It's moving along slow, but I just added some cool new weapons. I'm beginning to learn the basic code. I was wondering what the code would look like to have more then one pain sound effects. Lets say five sounds. Similar to "Reelism" mod.
User avatar
Blue Shadow
Posts: 4904
Joined: Sun Nov 14, 2010 12:59 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: More then one Pain sound?

Post by Blue Shadow »

You mean a sound that is randomly selected from a group of sounds to be played?
User avatar
Remmirath
Posts: 2561
Joined: Sun Dec 23, 2007 3:53 am
Discord: Remmirath#0424
Twitch ID: TheRemmirath
Graphics Processor: nVidia with Vulkan support
Location: My house

Re: More then one Pain sound?

Post by Remmirath »

SNDINFO is your friend, mate.

https://zdoom.org/wiki/SNDINFO

This is an excerpt taken straight from the above link; in particular, this one randomizes player death sounds. You can rework this piece of code to suit your needs.

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
Graaicko
Posts: 513
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Re: More then one Pain sound?

Post by Graaicko »

Alright I used the code and a selected three sounds, changed the "*death to *pain". and i get this error "Script error, "SE5.wad:SNDINFO" line 23:
*pain has already been used for a non-player sound."
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: More then one Pain sound?

Post by Nevander »

Post your full SNDINFO.
User avatar
Graaicko
Posts: 513
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Re: More then one Pain sound?

Post by Graaicko »

$playeralias player male *pain PL_PAIN

$random PL_PAIN { player/pain1 player/pain2 player/pain3}

player/pain1 PLPAIN1
player/pain2 PLPAIN2
player/pain3 PLPAIN3
User avatar
Voros
Posts: 151
Joined: Fri Feb 03, 2017 11:47 pm

Re: More then one Pain sound?

Post by Voros »

Use different name instead of *pain, such as plpain.
User avatar
Graaicko
Posts: 513
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Re: More then one Pain sound?

Post by Graaicko »

Alright, how do I make it use the *plpain?
User avatar
Remmirath
Posts: 2561
Joined: Sun Dec 23, 2007 3:53 am
Discord: Remmirath#0424
Twitch ID: TheRemmirath
Graphics Processor: nVidia with Vulkan support
Location: My house

Re: More then one Pain sound?

Post by Remmirath »

You might have to make an inherited playerpawn class.

Full documentation here:

https://zdoom.org/wiki/Using_inheritance
User avatar
Voros
Posts: 151
Joined: Fri Feb 03, 2017 11:47 pm

Re: More then one Pain sound?

Post by Voros »

Graaicko wrote:Alright, how do I make it use the *plpain?
Basically, create a new player class that plays that sound in the Death state.

Look it up on the ZDoom Wiki.
User avatar
Graaicko
Posts: 513
Joined: Tue Jun 17, 2014 11:22 pm
Graphics Processor: nVidia (Legacy GZDoom)

Re: More then one Pain sound?

Post by Graaicko »

Alright, I defined a new player class. Even got custom sprite states for it. Cant find anything about using player classes and how to use custom player sounds on them on the wiki.

Return to “Editing (Archive)”