Restart background music.

  • #1, by ke4Friday, 18. September 2015, 11:55 9 years ago
    Hi, can i somehow restart background music? Let it play from the beggining?
    Thanks

    Key Killer

    810 Posts


  • #2, by afrlmeFriday, 18. September 2015, 13:13 9 years ago
    Why would you want to do that? You could try using the set background music action part to set it to empty, then setting it again to the music you want.

    Not tested, so let me know if it works.

    Imperator

    7278 Posts

  • #3, by ke4Friday, 18. September 2015, 14:02 9 years ago
    I have this sequence in the game it's a couple of scenes where is playing the same music. It needs to be going through and if the player fails, then the sequence starts from the beggining.

    It works when i set it to nothing and then must be a short pause and then if i set again it starts from the beggining.

    But because it's changing into this scene first there can be always heard a few ms before the restart. Doesn't work if i set it to nothing in different scene for some reason, in that case it continues normaly.

    Key Killer

    810 Posts

  • #4, by afrlmeFriday, 18. September 2015, 15:38 9 years ago
    You can define the background music for any scene using action parts or Lua script I believe. A little while ago in another thread I provided a solution / idea for how to have it continue the music from the previous scene into the next scene without it pausing / restarting. The reason they wanted this is because they had it play a random background music from a small list of background musics just to add dynamic score that only played after a random amount of time with a pause in between each score where nothing was played at all.

    Imperator

    7278 Posts

  • #5, by ke4Friday, 18. September 2015, 16:15 9 years ago
    Er.. i'm not sure if i follow you here...

    I have "round 1, round 2, round 3" etc for every round a new scene, all scenes has the same background music. ( set in properties tab ) there are some time limitled puzzles and on fail it goes to the round 1 restarted again, all i need is to restart the music too.

    What do you mean? How to continue music or sound?

    Key Killer

    810 Posts

  • #6, by afrlmeFriday, 18. September 2015, 18:28 9 years ago
    I didn't follow your reply too well either, I guess! grin

    oh dear.

    I didn't understand the: "But because it's changing into this scene first there can be always heard a few ms before the restart." part.

    Imperator

    7278 Posts

  • #7, by ke4Friday, 18. September 2015, 18:43 9 years ago
    Sorry mate, I'm having a bit of an off day today grin

    Immagine that there is string of scenes, you are in some of the scenes and then you won't do the task in time so it will puts you back to the first scene.
    And there is playing the music and even the first action part in the "at beggining of scene" is removing the background music, the music still plays for a few miliseconds before it's ended.

    Key Killer

    810 Posts

  • #8, by afrlmeFriday, 18. September 2015, 19:24 9 years ago
    Ah use an if query or something inside of the action part that resets back to the first scene to determine if it should remove the music from the scene before restarting. If the background music is stopped before swapping back to the initial scene then it should start the music from the beginning automatically I think.

    Imperator

    7278 Posts

  • #9, by ke4Friday, 18. September 2015, 19:50 9 years ago
    No it still continue the music ( or sometimes it doesn't play at all )
    Eh what the hell it doesn't have to play from beggining, it's just a extra feature.

    Key Killer

    810 Posts

  • #10, by afrlmeFriday, 18. September 2015, 20:01 9 years ago
    Nothing in the log?

    Imperator

    7278 Posts

  • #11, by ke4Friday, 18. September 2015, 20:06 9 years ago
    No.
    The thing is that it's a couple of scenes with same bg music which includes dozens of movies and before&after each video it changes volume of the bg music + the restarting thing. No wonder it's so messy.
    Sure i can't make a classic adventure game.

    Key Killer

    810 Posts