Random sound clips?

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

Random sound clips?

Post by Hidden Hands »

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.
User avatar
Gifty
Posts: 615
Joined: Sat Jun 15, 2013 8:21 pm

Re: Random sound clips?

Post by Gifty »

All you gotta do is go into SNDINFO and define your sounds as $random, like this:

Code: Select all

$random monsters/zombie/die  { DIE1 DIE2  }

DIE1 DIE1
DIE2 DIE2
"$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!
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: Random sound clips?

Post by Nevander »

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?
You'd do the same thing Gifty did but include the already defined fireball sound in the $random definition.
Locked

Return to “Editing (Archive)”