Need Help With Triggers for Music Control

Zaraf

New Member
Reaction score
22
I tried doing this awhile back in GUI, but it was quite problematic. Maybe someone who knows vJASS and knows how to control music correctly can provide some help with how to accomplish what I want to do.

Here is what I'm trying to do:


So now a player starts the game, and there is background music playing. The player plays the game and reaches the first boss level. What is suppose to happen now is the background music fades to silence (over 1 second), and then a warning thing appears which has an alarm sound (imported), and then the boss music (power of the horde song) starts.

After the boss battle is finished, the boss music fades to silence (over 1 second), and the victory theme starts (which is like 5 seconds long and not imported), and then the background music comes back and the game is played again as normal until the next boss battle where this whole process is repeated.

Quite simple in concept, but execution of this has proved to be much more difficult.

Anyone have some insight please? Thanks and +rep for any help :)
 

Zaraf

New Member
Reaction score
22
Yes, but then when I start the music again, will it pick up where it left off? How will that work exactly?

Also, for the boss music, is it possible to play it as a music instead of as a "sound"?
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Ya. Use Stop Music before start a new music... For your question 1, I think it can be solved.. Go to search for the functions.
 

Zaraf

New Member
Reaction score
22
I really don't think this is all just THIS simple...I had a lot of trouble with the whole music aspect last year, and had to use all of the songs as sounds instead. Quite annoying.
 

simonake

New Member
Reaction score
72
If you wanted to import custom musics, you need to read a tutorial. I beleive there's one on this site, but...

Oh. To display sound to a particular player you would need a trigger like this, (Jass) I can<t guarantee it will work. But it should.

JASS:

function Trig_D__clencheur_sans_titre_001_Actions takes nothing returns nothing

 local real soundV = 0.00 //Fade in and out
local integer start = 1
local integer end = 100

if GetLocalPlayer() == GetOwningPlayer(GetTriggerUnit()) then
//Fading The sound IN
 loop
  exitwhen start == end
  set start = start + 1
  
  set soundV = soundV + 1.00
  call SetMusicVolumeBJ( soundV )
  call TriggerSleepAction( 0.01 )
 endloop
 set start = 1
 set end = 100
//Fading The sound OUT
 loop 
  exitwhen start == end
  set start = start + 1 

 set soundV = soundV - 1.00
 call SetMusicVolumeBJ( soundV )
 call TriggerSleepAction( 0.01 )
 endloop
endif

endfunction

//===========================================================================
function InitTrig_D__clencheur_sans_titre_001 takes nothing returns nothing
    set gg_trg_D__clencheur_sans_titre_001 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_D__clencheur_sans_titre_001, function Trig_D__clencheur_sans_titre_001_Actions )
endfunction


You must customize it but i hope it helps you.

Could be done in Gui, with custom scripts
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top