Music Per Chapter

  • #1, z PykeWednesday, 22. May 2013, 14:54 hodinky 12 years ago
    Hey guys,

    I have divided my game up into Chapters, and have a musical selection specifically created for each Chapter.

    I want the music to continue from scene to scene - but change for each chapter (with each chapter made up of a different amount of scenes.

    Any advice on how I could set this up?

    Bažant

    59 Posts


  • #2, z afrlmeWednesday, 22. May 2013, 16:06 hodinky 12 years ago
    hmm...
    at the beginning of the new chapter or during the chapter screen or whatever you have set up add a change background music action part for the required first scene that will determine the background music & again for the scene that had the previous music linked to it but leave the audio file blank.

    it creates an error in the log mind as it's looking for a file that doesn't exist but it shouldn't matter.

    I could ask David if he could add a checkbox option to the change background music - if it's not too much hassle - to safely remove background music from a scene.

    --

    alternatively you could copy/paste the scenes that will be used for each chapter?

    Imperátor

    7285 Posts

  • #3, z PykeWednesday, 22. May 2013, 17:06 hodinky 12 years ago
    I haven't checked this, but does the save game also save the state that the music is in?

    Bažant

    59 Posts

  • #4, z afrlmeWednesday, 22. May 2013, 18:08 hodinky 12 years ago
    hmm not sure. (according to data structure it stores it - I think)

    another alternative would be to use the openAL commands in the next release of VS (whenever that is) as you can manually control sounds including the playback time. which means between scenes you would store the current playback time in a variable & then start the sound from stored time in the next scene - for me this would be a much neater solution as you can combine if else queries with values & conditions so that you could technically even resume from the current playtime saved into a value after loading a save point.

    Imperátor

    7285 Posts

  • #5, z PykeWednesday, 22. May 2013, 18:39 hodinky 12 years ago
    The reason I ask is because I could always just use the 'use music from previous scene' option..but if the music states aren't saved, then it would use the music from the menu...unless Im missing something?

    Bažant

    59 Posts

  • #6, z afrlmeWednesday, 22. May 2013, 19:04 hodinky 12 years ago
    I've not actually tested what happens when you load a save game of a scene which is using continue music from previous scene could you save your game on one & load & tell me what happens please?

    *edit: just tested on the demo game - I removed music from save/load screen so there would be no previous music & err when I loaded from a scene with the continue music from previous scene it hadno background music.

    On the the other hand you can assign the same music file to each scene & if the file is the same as on the previous scene it just continues playing.

    Imperátor

    7285 Posts

  • #7, z PykeWednesday, 22. May 2013, 19:08 hodinky 12 years ago
    That could be an option, but wouldn't that restart the music at the beginning of each scene?
    My idea is that each chapter would have one 'mega' music file, where I can fluidly blend each song into each other, and it would just continue playing throughout the chapter. I can get it working if the player never exits the game...but I dont see that happening!

    Bažant

    59 Posts

  • #8, z afrlmeWednesday, 22. May 2013, 19:28 hodinky 12 years ago
    no if the background music file is the same as the one currently playing it ignores the file & continues playing without restarting.

    I prefer the Lua script method as I can manually control what's being played & from what point, plus the volume, balance & other stuff...
    you could for instance before changing to a menu pause the current bg sound & play a new one for the menu & then resume the bg sound when the player returns to the scene.

    Imperátor

    7285 Posts