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

How to play music during map loading

Status
Not open for further replies.
Level 5
Joined
May 13, 2012
Messages
68
I noticed that Dota warcraft always is able to play its music once the map is selected and continues on during loading. However I cannot do so for my map when I use Warcraft sounds. How is this triggered or is this somewhere in the Editor?

I am aware you may not use custom sounds but nevertheless, I can make do with warcraft sounds.
 
Level 18
Joined
May 11, 2012
Messages
2,108
I am aware you may not use custom sounds but nevertheless, I can make do with warcraft sounds.
Yes you can.

It's not done with triggers
It is.

JASS:
//! inject config
    call SetPlayers(1)
   
    call DefineStartLocation(0, 704.0, - 832.0)

    call InitCustomPlayerSlots()

    call PlayMusic("Sound\\Music\\mp3Music\\PH1.mp3")
//! endinject

note that this code will fuck up with your player settings, so you will have to adjust this code to your needs.
I have complete working code that has settings for lobby my way, but it's really big and I forgot what each line does since it was long time I adjusted it. If you want it after all, I'll post it.
 
Level 5
Joined
May 13, 2012
Messages
68
Yes you can.


It is.

JASS:
//! inject config
    call SetPlayers(1)
   
    call DefineStartLocation(0, 704.0, - 832.0)

    call InitCustomPlayerSlots()

    call PlayMusic("Sound\\Music\\mp3Music\\PH1.mp3")
//! endinject

Can you explain this (I'm mainly GUI coding) as to where I'm supposed to put this and how this thing loads? I thought Map Initialize trigger fires only on map loading not in lobby.

I think what you're getting is right. Specifically, Dota warcraft plays the sound once you get into lobby after selecting map, that sounds continues to play as you get into loading screen. The sound stops running if you exit lobby and switch to another map
 
Level 18
Joined
May 11, 2012
Messages
2,108
Yes you can.


It is.

JASS:
//! inject config
    call SetPlayers(1)
   
    call DefineStartLocation(0, 704.0, - 832.0)

    call InitCustomPlayerSlots()

    call PlayMusic("Sound\\Music\\mp3Music\\PH1.mp3")
//! endinject

Can you explain this (I'm mainly GUI coding) as to where I'm supposed to put this and how this thing loads? I thought Map Initialize trigger fires only on map loading not in lobby.

I think what you're getting is right. Specifically, Dota warcraft plays the sound once you get into lobby after selecting map, that sounds continues to play as you get into loading screen. The sound stops running if you exit lobby and switch to another map

That's correct.
You should create new Lobby trigger and convert it to custom script and delete all inside it and paste this code and firstly see does it work for you and what happend to your lobby. And then we'll move on, I have to recall how to configure this propely.
 
Status
Not open for further replies.
Top