Playing random sound from a sound list? when ...

Troll

New Member
Reaction score
4
So, my trigger is, player has pwned player

play sound, but i want this sound to be a random one from a large list, i think i need to use variables setting the random sounds by arrays and then setting all that arrays to a variable? can anyone help me with this? how it should look like?!
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Code:
Setting Array
    Events
        Map Initialization
    Conditions
 
    Actions
        Set MusicList[1] = Music
        etc..


Code:
Play Sound
    Events
        Your Event
    Conditions
        Your Conditions
    Actions
        Play MusicList[Random integer between 1 and YourNumber]
 

Troll

New Member
Reaction score
4
LOL, too late bro, i done it myself.


here is the code if anyone wants to learn.


Code:
init 19
    Events
        Map initialization
    Conditions
    Actions
        Set RANDOM_KILLING_SOUNDS_ARRAYS[1] = Excelent_u <gen>
        Set RANDOM_KILLING_SOUNDS_ARRAYS[2] = Fatality_u <gen>
        Set RANDOM_KILLING_SOUNDS_ARRAYS[3] = Holy_shit_u <gen>
        Set RANDOM_KILLING_SOUNDS_ARRAYS[4] = Humiliation_u <gen>
        Set RANDOM_KILLING_SOUNDS_ARRAYS[5] = Ownage_u <gen>
        Set RANDOM_KILLING_SOUNDS_ARRAYS[6] = Well_done_u <gen>
        Set RANDOM_KILLING_SOUNDS_TOTAL = 6


Code:
init 20
    Events
        Unit - A unit Dies
    Conditions
        ((Dying unit) is A Hero) Equal to True
    Actions
        Sound - Play RANDOM_KILLING_SOUNDS_ARRAYS[(Random integer number between 1 and RANDOM_KILLING_SOUNDS_TOTAL)]
        Game - Display to (All players) for 2.00 seconds the text: (PLAYER_COLORS[(Player number of (Owner of (Killing unit)))] + ((Name of (Owner of (Killing unit))) + (|r + ( has just owned  + (PLAYER_COLORS[(Player number of (Owner of (Dying unit)))] + ((Name of (Owner of (Dying unit))) + |r))))))


thx for helping me in this noobish thing anyway, rep+.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top