• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Play Music during Map Selection/Hosting map

Level 14
Joined
Nov 30, 2013
Messages
926
"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

  • tut1.png
    tut1.png
    69.9 KB · Views: 422
  • Custom Music.w3x
    16.2 KB · Views: 134
Last edited by a moderator:
Top