• 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.

Buying Music Functions

Status
Not open for further replies.
Level 3
Joined
Aug 10, 2011
Messages
41
Hey there !

playing a music theme aint a prob. the thing i want to do is the following:

When a hero buys from a certain shop. then it plays a song. the thing is i need it to randomly pick a song from a selection of 3-5 song. so that it aint the same song everytime. the songs are 5 imported songs of my own. i simply just need a trigger that makes a kinda "random" pick of 4 things.


Im sure this a easy trigger :b so help me out and get some rep in return ;)
 
  • Map init
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Set sound[1] = //custom path here
      • Set sound[2] = //custom path here
      • Set sound[3] = //custom path here
      • Set sound[4] = //custom path here
      • Set sound[5] = //custom path here
Now, when unit buys item:
  • sound
    • Events
      • Unit - A unit Sells item (from shop)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to //enter shop type here
    • Actions
      • Sound - Play sound[(Random integer number from 1 to 5)]
 
Oh Holmenlund.. You should have said that you have problems with variables too. >.<
Yes 'sound' is sound array variable. Enter variable editor and in Name field enter 'sound', from type filter choose: Sound. Follow this with ticking the 'Array' box just below type field. "Custom path here" means that after choosing action: Set Variable and selecting the sound one you have to Select option 'Variable' and choose the imported sound. Done, enjoy.
 
Level 3
Joined
Aug 10, 2011
Messages
41
It sounds like ur in a different section/spot than i am ?
let me illustrate it hah :D :

scaled.php


First i import a sound/song then its variable name become the name of the file "almost"

scaled.php


then i make the trigger(set) where i enter a new variable which name was: sound[1] = "then you say i shall insert the custom path here" well i don´t see how to do it ?

scaled.php


You say that after i checked the Array then the custom path should be right under ? where ? XD haha :D

now i can´t explain it better, so what i am doing wrong? :p
 
Level 3
Joined
Aug 10, 2011
Messages
41
nice thanks m8 :D ! it was actually quite easy lol :D

just got one prob, the "main background music" still runs throughout the game, and it kinda destroy the music :p ? any ideá on how to dissable these ?
 
Status
Not open for further replies.
Top