Music looping

Akino_k

New Member
Reaction score
1
Alright, BRUTAL has helped me on getting the song able to play but now i need to know how to loop it.
FOR EXAMPLE: when the song stops playing, i want it to play again.
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
If you know how long the song is, you can make a repeating countdown timer when it starts playing that expires in the length of time it takes to play the song. You could have a new trigger with this event:

Code:
Events
     SongTimer expires

And have the song play again as the action. I hope that helps :)
 

Akino_k

New Member
Reaction score
1
obviously SongTimer is a variable but classified as what? sound type or sound? and how would i set it as a certain song?
 

BRUTAL

I'm working
Reaction score
118
lmao its so easy do this
make a trigger that plays the song, and add an action that turns off a trigger thats intially off
for the off trigger do this
make the event
Time - Every (however long your song is) seconds of game time
and make the action exactly the same as the first trigger but dont put the turn on trigger part
so it will play a song, turn on the second trigger, and the second trigger waits as long asyou put and replays
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
From what the above post says, that would only work once (I think). If you do it the way I do it, it would keep playing throughout the game. SongTimer is a timer variable, because it is a repeating countdown timer that expires every X seconds. You would set it like this:

Code:
Actions
    Countdown Timer - Start SongTimer as a Repeating timer that will expire in X seconds

X is the length of the song that you're playing. SongTimer has nothing to do with sound itself; it's just there to replay the song when it stops. Good luck :D
 

BRUTAL

I'm working
Reaction score
118
my way would work also
how would it not
its a periodic event which means it repeats
 

BRUTAL

I'm working
Reaction score
118
here
i'll copy and paste an actual trigger so you know how give me a sec

Code:
play
    Events
        Time - Elapsed game time is 0.00 seconds
    Conditions
    Actions
        Sound - Play Heroic Victory
        Trigger - Turn on loop play <gen>
Code:
loop play
    Events
        Time - Every 54.00 seconds of game time
    Conditions
    Actions
        Sound - Play Heroic Victory
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
That might not work if the song is played after the beginning of the game, in which case my way would be fine. That's not to say that your's wouldn't work; it's a great trigger, but Akino_k might not play the song at the beginning. Of course, I don't know.
 

BRUTAL

I'm working
Reaction score
118
ok
all he would have to do is change the event in the first trigger then it will work it doesnt ahve to be right when the game starts i just used that for an examply it could be a chat event, a unit entering a region, a unit dying etc.
both our ways work
lol theres not much of a difference
well except that your using a countdown timer
 

Knight7770

Hippopotomonstrosesquiped aliophobia
Reaction score
187
lol it's kind of ironic that we're practically arguing over whose trigger is best and the person who started this thread hasn't said nearly as much as we have. :) They are pretty similar. I wonder which one Akino will choose...
 

Sinan2

New Member
Reaction score
9
NOTE:not tested
Code:
Song
    Events
        Time - Elapsed game time is 0.05 seconds
    Conditions
    Actions
        Set TempInt = 2
        Sound - Play Sound <gen>
        Wait for (Last played sound) to be 0.00 seconds from finished playing
        For each (Integer A) from 1 to TempInt, do (Actions)
            Loop - Actions
                Sound - Play Sound <gen>
                Wait for (Last played sound) to be 0.00 seconds from finished playing
                Set TempInt = (TempInt + 1)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top