• 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.

Music Problem 2

Status
Not open for further replies.
Hi Guys i have a problem with my Musics.

To start i have the following trigger:

JASS:
function Trig_Music_Actions takes nothing returns nothing
    call PlayMusicBJ( gg_snd_PH1 )
    call TriggerSleepAction( GetSoundFileDurationBJ(gg_snd_PH1) )
    call PlayMusicBJ( gg_snd_War2IntroMusic )
    call TriggerSleepAction( GetSoundFileDurationBJ(gg_snd_War2IntroMusic) )
    call PlayMusicBJ( gg_snd_HumanX1 )
    call TriggerSleepAction( GetSoundFileDurationBJ(gg_snd_HumanX1) )
endfunction

//===========================================================================
function InitTrig_Music takes nothing returns nothing
    set gg_trg_Music = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Music, function Trig_Music_Actions )
endfunction

This trigger plays 3 musics. When song 1 ends, the trigger plays song 2 and when song 2 ends, it plays song 3.

This trigger works fine, however i don't know how to do the following:
<> In another trigger i have, i want to pause the current song, play another theme during 30 seconds, and them resume the song i paused.

Can this be done ? please help.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
I'll tell ya what
You can start recording a variable that determines the position of sound
When you stop the sound stop the increasement of variable too

This function allows you to start a music from a further position of music
type the value you recorded instead of <Starting Position> to resume your music
JASS:
call PlayMusicExBJ( GetLastPlayedMusic(), <Starting Position>, 0 )
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Hmm you didnt read it cerfully I gues I mean
A variable starts to increase everysecond when music starts to play

a trigger that increases value every second and its not enabled
then put another action to enable it

You can use a global variable for this
Using lots of variables and triggers isnt good but
How will they do it ist map locked ^^
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Create variable in variables (a shaped button :p:p:p like you dont know)
then Time Periodic 1 second
set blabla = blabla + 1 (something like asimethric allows you to calculate things)
:/
 
Status
Not open for further replies.
Top