• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Random playing music

Status
Not open for further replies.
Level 7
Joined
Aug 17, 2012
Messages
256
Is there a way to make a trigger like:

You got two or three music theme. Each time you go in and then out an inn (with the help of triggers :ogre_datass:) or enter battle, the trigger plays a music theme randomly from the three (or two).


Thanks for help :ogre_datass:
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
If you use a sound variable with array, it becomes quite easy.
Something like this:
Setup:
  • Set Music[1] = Undead2 <gen>
  • Set Music[2] = UndeadX1 <gen>
  • Set Music[3] = War3XMainScreen <gen>
Play music:
  • Sound - Play Music[(Random integer number between 1 and 3)]
However, now it's classified as a sound (not music).

If you would really like it to be classified as "music", then something like this should work:
  • Actions
    • Set randInt = (Random integer number between 1 and 3)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • randInt Equal to 1
      • Then - Actions
        • Sound - Play Tension <gen>
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • randInt Equal to 2
          • Then - Actions
            • Sound - Play TragicConfrontation <gen>
          • Else - Actions
            • Sound - Play War2IntroMusic <gen>
 
Status
Not open for further replies.
Top