• 🏆 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!

[General] Play music in the lobby +rep

Status
Not open for further replies.
Level 7
Joined
Sep 16, 2016
Messages
185
Hello Hiveworkshop,



I want to get started on how to make so that whenever a player joins a lobby with my map, it plays music.

I took some visit around the Hive, and from what I'm aware it has something to do with Init, but I found no tutorial which shows how to do it with Jass alone.

If anyone has some time spare, please help me out. ;D

Will give +rep to whoever helps me, thanks!
 
Level 21
Joined
Dec 4, 2007
Messages
1,478
Is that even possible?
You are able to play music during the loading screen, but lobby - i wonder how that could work.
 
There is a config function that runs in lobby. JassHelper lets you inject code to this function.

JASS:
//! inject config
    call PlayMusic("Sound\\Music\\mp3Music\\PH1.mp3")
//! endinject

Lastly I worked with it, it broke my config, so I had to define the whole body from config functon in the inject again. For this open your map with mpq editor (I use Ladik's) open the .j file and copy the body from the config function inside your inject.
 
Level 7
Joined
Sep 16, 2016
Messages
185
Have been on vacation, but will give this a try.

Reporting back with results

edit2: I need help using Jasshelper
 
Last edited:
Level 19
Joined
Jul 2, 2011
Messages
2,162
I've seen it done before
I have no idea how but it was impressive up until the point when the game started and we realised it was crap

first impressions count though so might as well follow their trend hey?
 
Level 10
Joined
Sep 16, 2016
Messages
269
  1. Use MPQ Editor to open your map (non-protected), read file war3map.j with notepad

  2. Find function named "config" (Ctrl F)

  3. Add 1 line above the "endfunction" part: call PlayMusic( "Sound\\Music\\mp3Music\\PH1.mp3" )

  4. Save, exit and test
IIRC, this wont work if you open it again (maybe... just maybe...)
 
Level 7
Joined
Sep 16, 2016
Messages
185
Seems to work! Just one question, is it possible to have more than just one "call PlayMusic..." function? So different songs plays?
 
Status
Not open for further replies.
Top