• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Random Sounds

Status
Not open for further replies.
Level 1
Joined
Feb 23, 2021
Messages
4
Hi folks,

I think I need some help regarding my random sound integer.

Each time a unit dies, I want one random sound out of a set of sounds to be played.

How would such a simple trigger look like?

Thank you very much in advance.
 
Level 21
Joined
Mar 29, 2020
Messages
1,237
first - go to the sound editor and make sure you hit "use as sound" on all the sounds you want to use.

next - create a trigger with the event "map initialization". create a sound array type variable and set each of your sounds to a different value of the array. (randsound[0] =dog bark, randsound[1] = orc shout, randsound[2] = elf death...etc')

last - create a trigger with the event - a unit dies. actions - play sound randsound[random integer between 0 and the number of variables you set]

this should do it. good luck!
 
Level 1
Joined
Feb 23, 2021
Messages
4
Thats it! Thanks man.

I did every what you said before, but failed on the last part. couldnt find the random number....

Thanks again!!
 
Status
Not open for further replies.
Top