How can I make it so that the monsters place a random variant of each sound? For example, they have two dying sounds like the zombiemen. How can I make it pick a random one each time?
Also, if I was to say take the DOOM imp, and wanted to add but not replace sounds of the fireballs, how would I do that since it's attack is already defined?
Thanks in advance.
Random sound clips?
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.
- Hidden Hands
- Posts: 1053
- Joined: Tue Sep 20, 2016 8:11 pm
- Location: London, England
- Contact:
Re: Random sound clips?
All you gotta do is go into SNDINFO and define your sounds as $random, like this:
"$random" tells the game to randomly pick one of the sounds defined between the curly brackets (you can list more than two if you want lots of death sounds). "Monsters/zombie/die" is a tag that you can use to call the sound in decorate later, it doesn't have to be exactly the same as mine, so long as there's something written there. The DIE1, DIE2 definitions at the bottom simply tell the engine which audio files to match up with the names you've written between the brackets, but I find it's easier to make the bracketed names match the filenames, hence why it looks redundant.
Hope this helps!
Code: Select all
$random monsters/zombie/die { DIE1 DIE2 }
DIE1 DIE1
DIE2 DIE2
Hope this helps!
Re: Random sound clips?
You'd do the same thing Gifty did but include the already defined fireball sound in the $random definition.Hidden Hands wrote:Also, if I was to say take the DOOM imp, and wanted to add but not replace sounds of the fireballs, how would I do that since it's attack is already defined?