• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

3 Sounds Trigger

Status
Not open for further replies.
Level 5
Joined
Oct 7, 2005
Messages
102
Hey guys, I'm trying to do a trigger that randomly plays from a selection of 3 sounds.

Trying to do the random integer trigger, but can't figure out how to do 3 options.

Thanks
 
You will use a Sound variable, with array ticked, e.g.:
  • Tr
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Sounds[1] = AltarOfDepthsWhat1 <gen>
    • Set Sounds[2] = CoralBedWhat1 <gen>
    • Set Sounds[3] = PeasantYes1 <gen>
  • Tn
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Sound - Play Sounds[(Random integer number between 1 and 3)]
However, this method leaks a bit, you would need Jass for an non-leaking version. If you want that one, let me know; I just used GUI, in case you are not familiar with Jass. (In Jass, you would need String variables instead.)
 
Right, doesn't seem to be working. I'm pretty sure I've done the right trigger. Can I try out this JASS version then mate? If you tell me how I use it as well that is.
 
Status
Not open for further replies.
Back
Top