• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Play Music during Map Selection/Hosting map

Level 15
Joined
Nov 30, 2013
Messages
927
"Play Music during Map Selection/Hosting map"
Submitted on: January 31, 2017

Introduction
Hello there! In this tutorial, I'm going to show you how to play any music you wanted to play outside your map.

There's some minor things you need to know before we're getting starting about this.

Requirements:
Getting Started
1.) Go to your map's Custom Script Code.
To do this, open your map and go to your map's Custom Script Code. This where we gonna create our codes.
tut1-png.259787

2.) Insert //! inject.
After that, we're going to insert this out.
JASS:
//! inject config

//! endinject
The //! inject config can allow us to modify the 'Config' function within our Map's JASS script. However, using this script inappropriately can break your map. Here's a link which can give more facts about inject.​

3.) Insert call PlayMusic(<Audio>).
And finally we'll add call PlayMusic(<String>) script into the inject!
JASS:
//! inject config
/*
      Map's Properties
*/

call PlayMusic("Sound\\Music\\mp3Music\\PH1.mp3")
//! endinject
For this tutorial, I am going to use PH1.mp3. Also make sure that your map's properties is included within the inject or else the map would be unplayable.​

Result
If you go to your map in the Map Selection, you will hear the music you specified.
I hope that this tutorial helps you a lot!​


Author's Note
I got this idea from one of the DoTA map which it'll play a music when selecting it.
If you can't follow the tutorial correctly, I attached the demo map for you to see.​
 

Attachments

Last edited by a moderator:
Back
Top