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

Detect when an music end.

Status
Not open for further replies.
Level 15
Joined
Oct 29, 2012
Messages
1,474
Hello guys, have a question here, is possible to detect when a song end?

It is possible by launching a countdown timer once the music starts (That's if you play the music manually). The music list of Warcraft (If you don't play any) is totally random. (Afaik)
But notice that you can always clear music list :
Clear Music List
  • Sound - Clear the music list
And you can always use your own list and play music according to your own selection.

You should, by the way, stop the default music list entirely by this :
Stopping default music
  • Music stopper
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Sound - Stop music After fading
      • Sound - Stop the currently playing music theme
      • Sound - Clear the music list
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
You can create a custom music list using this:
call SetMapMusicRandomBJ( "Sound\\Music\\mp3Music\\PursuitTheme.mp3;ImportedMusic\\IntensityTheme.mp3")

Different songs is seperated by ;
This example shows a limited amount of ingame music and also your own custom imported music as long its mp3 format.

_________

As for detecting when a music ends is kinda hardcoded afaik and I don't know its possible with jass or triggers to detect exactly when it ends.

But maybe you can can use the GetLastPlayedMusic function running with periodic timer quite often to check approximately WHEN last played music ends and begins playing a new one. I haven't tried this but it should return a different string when it changes music by itself. This is the only method I can figure out is the closest. (I haven't tested this myself yet, so I don't know if this works.)
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
You can create a custom music list using this:
call SetMapMusicRandomBJ( "Sound\\Music\\mp3Music\\PursuitTheme.mp3;ImportedMusic\\IntensityTheme.mp3")

Different songs is seperated by ;
This example shows a limited amount of ingame music and also your own custom imported music as long its mp3 format.

_________

As for detecting when a music ends is kinda hardcoded afaik and I don't know its possible with jass or triggers to detect exactly when it ends.

But maybe you can can use the GetLastPlayedMusic function running with periodic timer quite often to check approximately WHEN last played music ends and begins playing a new one. I haven't tried this but it should return a different string when it changes music by itself. This is the only method I can figure out is the closest. (I haven't tested this myself yet, so I don't know if this works.)

That won't detect the last played music by default.

Look :
bP7SK.jpg
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
Level 31
Joined
Aug 6, 2015
Messages
639
You can create a custom music list using this:
call SetMapMusicRandomBJ( "Sound\\Music\\mp3Music\\PursuitTheme.mp3;ImportedMusic\\IntensityTheme.mp3")

Different songs is seperated by ;
This example shows a limited amount of ingame music and also your own custom imported music as long its mp3 format.

_________

As for detecting when a music ends is kinda hardcoded afaik and I don't know its possible with jass or triggers to detect exactly when it ends.

But maybe you can can use the GetLastPlayedMusic function running with periodic timer quite often to check approximately WHEN last played music ends and begins playing a new one. I haven't tried this but it should return a different string when it changes music by itself. This is the only method I can figure out is the closest. (I haven't tested this myself yet, so I don't know if this works.)
That Solved my problem :) Thanks
 
Status
Not open for further replies.
Top