More then one Pain sound?
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.
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.
More then one Pain sound?
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.
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: More then one Pain sound?
You mean a sound that is randomly selected from a group of sounds to be played?
- Remmirath
- Posts: 2562
- Joined: Sun Dec 23, 2007 3:53 am
- Graphics Processor: nVidia with Vulkan support
- Location: My house
- Contact:
Re: More then one Pain sound?
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.
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
Re: More then one Pain sound?
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."
*pain has already been used for a non-player sound."
Re: More then one Pain sound?
Post your full SNDINFO.
Re: More then one Pain sound?
$playeralias player male *pain PL_PAIN
$random PL_PAIN { player/pain1 player/pain2 player/pain3}
player/pain1 PLPAIN1
player/pain2 PLPAIN2
player/pain3 PLPAIN3
$random PL_PAIN { player/pain1 player/pain2 player/pain3}
player/pain1 PLPAIN1
player/pain2 PLPAIN2
player/pain3 PLPAIN3
Re: More then one Pain sound?
Use different name instead of *pain, such as plpain.
Re: More then one Pain sound?
Alright, how do I make it use the *plpain?
- Remmirath
- Posts: 2562
- Joined: Sun Dec 23, 2007 3:53 am
- Graphics Processor: nVidia with Vulkan support
- Location: My house
- Contact:
Re: More then one Pain sound?
You might have to make an inherited playerpawn class.
Full documentation here:
https://zdoom.org/wiki/Using_inheritance
Full documentation here:
https://zdoom.org/wiki/Using_inheritance
Re: More then one Pain sound?
Basically, create a new player class that plays that sound in the Death state.Graaicko wrote:Alright, how do I make it use the *plpain?
Look it up on the ZDoom Wiki.
Re: More then one Pain sound?
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.