HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

6+ Songs Music List function / Trigger

10-20-2003, 12:26 PM#1
Vexorian
This Pair of things will play random music from all of the Warcraft Music, you can change it to remove some music, but don't forget to change the max value, it will play the music as ambiental music

Ok , this function goes to the root section of the trigger list:

Code:
function VexorianMusicList takes nothing returns real
local string array music
local string list
local integer a=0
local integer b
local real duration=0.00
local integer max=43
    set music[0] = "Sound\\Music\\mp3Music\\ArthasTheme.mp3"
    set music[1] = "Sound\\Music\\mp3Music\\BloodElfTheme.mp3"
    set music[2] = "Sound\\Music\\mp3Music\\Comradeship.mp3"
    set music[3] = "Sound\\Music\\mp3Music\\Credits.mp3"
    set music[4] = "Sound\\Music\\mp3Music\\DarkAgents.mp3"
    set music[5] = "Sound\\Music\\mp3Music\\DarkVictory.mp3"
    set music[6] = "Sound\\Music\\mp3Music\\Doom.mp3"
    set music[7] = "Sound\\Music\\mp3Music\\HeroicVictory.mp3"
    set music[8] = "Sound\\Music\\mp3Music\\Human1.mp3"
    set music[9] = "Sound\\Music\\mp3Music\\Human2.mp3"
    set music[10] = "Sound\\Music\\mp3Music\\Human3.mp3"
    set music[11] = "Sound\\Music\\mp3Music\\HumanDefeat.mp3"
    set music[12] = "Sound\\Music\\mp3Music\\HumanVictory.mp3"
    set music[13] = "Sound\\Music\\mp3Music\\HumanX1.mp3"
    set music[14] = "Sound\\Music\\mp3Music\\IllidansTheme.mp3"
    set music[15] = "Sound\\Music\\mp3Music\\LichKingTheme.mp3"
    set music[16] = "Sound\\Music\\mp3Music\\Mainscreen.mp3"
    set music[17] = "Sound\\Music\\mp3Music\\NagaTheme.mp3"
    set music[18] = "Sound\\Music\\mp3Music\\NightElf1.mp3"
    set music[19] = "Sound\\Music\\mp3Music\\NightElf2.mp3"
    set music[20] = "Sound\\Music\\mp3Music\\NightElf3.mp3"
    set music[21] = "Sound\\Music\\mp3Music\\NightElfDefeat.mp3"
    set music[22] = "Sound\\Music\\mp3Music\\NightElfVictory.mp3"
    set music[23] = "Sound\\Music\\mp3Music\\NightElfX1.mp3"
    set music[24] = "Sound\\Music\\mp3Music\\Orc1.mp3"
    set music[25] = "Sound\\Music\\mp3Music\\Orc2.mp3"
    set music[26] = "Sound\\Music\\mp3Music\\Orc3.mp3"
    set music[27] = "Sound\\Music\\mp3Music\\OrcDefeat.mp3"
    set music[28] = "Sound\\Music\\mp3Music\\OrcTheme.mp3"
    set music[29] = "Sound\\Music\\mp3Music\\OrcVictory.mp3"
    set music[30] = "Sound\\Music\\mp3Music\\OrcX1.mp3"
    set music[31] = "Sound\\Music\\mp3Music\\PursuitTheme.mp3"
    set music[32] = "Sound\\Music\\mp3Music\\SadMystery.mp3"
    set music[33] = "Sound\\Music\\mp3Music\\Tension.mp3"
    set music[34] = "Sound\\Music\\mp3Music\\TragicConfrontation.mp3"
    set music[35] = "Sound\\Music\\mp3Music\\Undead1.mp3"
    set music[36] = "Sound\\Music\\mp3Music\\Undead2.mp3"
    set music[37] = "Sound\\Music\\mp3Music\\Undead3.mp3"
    set music[38] = "Sound\\Music\\mp3Music\\UndeadDefeat.mp3"
    set music[39] = "Sound\\Music\\mp3Music\\UndeadVictory.mp3"
    set music[40] = "Sound\\Music\\mp3Music\\UndeadX1.mp3"
    set music[41] = "Sound\\Music\\mp3Music\\War2IntroMusic.mp3"
    set music[42] = "Sound\\Music\\mp3Music\\War3XMainScreen.mp3"
    set music[43] = "Sound\\Music\\mp3Music\\PH1.mp3"
    loop
        exitwhen a>=4
        set a=a+1
        set b=GetRandomInt(0, max)
        set duration=duration+GetSoundFileDurationBJ(music[b])
        if a==1 then
            set list=music[b]
        else
            set list=list+";"+music[b]
        endif
        if not (b==max) then
            set music[b]=music[max]
        endif
        set max=max-1
    endloop
    call SetMapMusicRandomBJ( list )
    return(duration)
endfunction


and next is a Normal Trigger:

Code:
Music
    Events
        Map initialization
        Time - Music expires
    Conditions
    Actions
        Custom script:   set udg_MusicDuration=(VexorianMusicList()-2.00)
        Countdown Timer - Start Music as a One-shot timer that will expire in MusicDuration seconds

You need a Real Variable called MusicDuration (Case sensitive) and a timer variable called Music

==========================


On A side note, if you only need a 2 to 5 songs music list , just use this: (You need to now the mp3 files path) (You don't need the Function)


Code:
Music
    Events
        Map initialization
    Conditions
    Actions
        Custom script:   call SetMapMusicRandomBJ( "Sound\\Music\\mp3Music\\OrcX1.mp3;Sound\\Music\\mp3Music\\PursuitTheme.mp3;Sound\\Music\\mp3Music\\SadMystery.mp3;Sound\\Music\\mp3Music\\Tension.mp3" )
07-08-2004, 03:27 AM#2
Dragunov
THIS WORKS. For all you peeps out there looking for a way to make your own Music Lists, take a look at this. But I still have a question for you Vex. I was wondering what the path would be for an imported .mp3? Do you know how I'd get that to work? Also, which elements do I delete in order to make it so these songs aren't played randomly, but rather in order 1-10 or 1-43?

-Drag
07-08-2004, 02:13 PM#3
Vexorian
The path for an imported war3mapimported\music.mp3 would be "war3mapimported\\music.mp3"

And if you want it to keep an order, you'll need an MusicN integer variable:

Code:
function VexorianMusicList takes nothing returns real
local string array music
local string list
local integer a=0
local integer b
local real duration=0.00
local integer max=43
    set music[0] = "Sound\\Music\\mp3Music\\ArthasTheme.mp3"
    set music[1] = "Sound\\Music\\mp3Music\\BloodElfTheme.mp3"
    set music[2] = "Sound\\Music\\mp3Music\\Comradeship.mp3"
    set music[3] = "Sound\\Music\\mp3Music\\Credits.mp3"
    set music[4] = "Sound\\Music\\mp3Music\\DarkAgents.mp3"
    set music[5] = "Sound\\Music\\mp3Music\\DarkVictory.mp3"
    set music[6] = "Sound\\Music\\mp3Music\\Doom.mp3"
    set music[7] = "Sound\\Music\\mp3Music\\HeroicVictory.mp3"
    set music[8] = "Sound\\Music\\mp3Music\\Human1.mp3"
    set music[9] = "Sound\\Music\\mp3Music\\Human2.mp3"
    set music[10] = "Sound\\Music\\mp3Music\\Human3.mp3"
    set music[11] = "Sound\\Music\\mp3Music\\HumanDefeat.mp3"
    set music[12] = "Sound\\Music\\mp3Music\\HumanVictory.mp3"
    set music[13] = "Sound\\Music\\mp3Music\\HumanX1.mp3"
    set music[14] = "Sound\\Music\\mp3Music\\IllidansTheme.mp3"
    set music[15] = "Sound\\Music\\mp3Music\\LichKingTheme.mp3"
    set music[16] = "Sound\\Music\\mp3Music\\Mainscreen.mp3"
    set music[17] = "Sound\\Music\\mp3Music\\NagaTheme.mp3"
    set music[18] = "Sound\\Music\\mp3Music\\NightElf1.mp3"
    set music[19] = "Sound\\Music\\mp3Music\\NightElf2.mp3"
    set music[20] = "Sound\\Music\\mp3Music\\NightElf3.mp3"
    set music[21] = "Sound\\Music\\mp3Music\\NightElfDefeat.mp3"
    set music[22] = "Sound\\Music\\mp3Music\\NightElfVictory.mp3"
    set music[23] = "Sound\\Music\\mp3Music\\NightElfX1.mp3"
    set music[24] = "Sound\\Music\\mp3Music\\Orc1.mp3"
    set music[25] = "Sound\\Music\\mp3Music\\Orc2.mp3"
    set music[26] = "Sound\\Music\\mp3Music\\Orc3.mp3"
    set music[27] = "Sound\\Music\\mp3Music\\OrcDefeat.mp3"
    set music[28] = "Sound\\Music\\mp3Music\\OrcTheme.mp3"
    set music[29] = "Sound\\Music\\mp3Music\\OrcVictory.mp3"
    set music[30] = "Sound\\Music\\mp3Music\\OrcX1.mp3"
    set music[31] = "Sound\\Music\\mp3Music\\PursuitTheme.mp3"
    set music[32] = "Sound\\Music\\mp3Music\\SadMystery.mp3"
    set music[33] = "Sound\\Music\\mp3Music\\Tension.mp3"
    set music[34] = "Sound\\Music\\mp3Music\\TragicConfrontation.mp3"
    set music[35] = "Sound\\Music\\mp3Music\\Undead1.mp3"
    set music[36] = "Sound\\Music\\mp3Music\\Undead2.mp3"
    set music[37] = "Sound\\Music\\mp3Music\\Undead3.mp3"
    set music[38] = "Sound\\Music\\mp3Music\\UndeadDefeat.mp3"
    set music[39] = "Sound\\Music\\mp3Music\\UndeadVictory.mp3"
    set music[40] = "Sound\\Music\\mp3Music\\UndeadX1.mp3"
    set music[41] = "Sound\\Music\\mp3Music\\War2IntroMusic.mp3"
    set music[42] = "Sound\\Music\\mp3Music\\War3XMainScreen.mp3"
    set music[43] = "Sound\\Music\\mp3Music\\PH1.mp3"
    loop
        exitwhen a>=4
        set a=a+1
        set b=udg_MusicN
        set udg_MusicN=ModuloInteger(udg_MusicN+1 , 44 ) // replace 44 with the total number of music paths
        set duration=duration+GetSoundFileDurationBJ(music[b])
        if a==1 then
            set list=music[b]
        else
            set list=list+";"+music[b]
        endif
        if not (b==max) then
            set music[b]=music[max]
        endif
        set max=max-1
    endloop
    call SetMapMusicRandomBJ( list )
    return(duration)
endfunction
07-08-2004, 04:02 PM#4
Dragunov
Thanks Vex! Yet I have one last question, if you dont mind. How could I make this script force specific? In other words, I want to create two scripts that play different song lists for two forces. My first force is Human, my other, Undead. Obviously I dont want to be playing Human songs for Undead players. If you could help me out again, I would be grateful. And thanks for your help above!

-Drag
07-09-2004, 11:49 PM#5
Vexorian
That's some more difficult, will come with a local music list trigger soon
07-12-2004, 04:31 AM#6
Dragunov
Well, if you've got the time to kill, I'd appreciate it very much, but dont break a leg or nothin'. ;) Thanks a lot bro,

-Drag
07-23-2004, 01:12 AM#7
Dragunov
So, what'dya find? Is it possible? Or have you just not been able to do it? I'll understand if you couldn't. I appreciate your earlier help,

-Drag
07-23-2004, 09:53 PM#8
Vexorian
Sorry, I think I forgot, I am going to work on it now that I have nothing to do
07-25-2004, 08:51 PM#9
Dragunov
Oh thats fine, thanks a lot! =)