Forum rules - please read before posting.

Play music list?

edited December 2015 in Technical Q&A
I'm sure this is a simpe thing, but I can't find it in the manual or the forum.

How do I play music files of 5+ songs one by one automatically  across the levels?
So when one song is finished the other starts and so on.

Just simply create an asset action list with Sound: Play actions 1 after another and it would play across the scenes? But there is no wait till finished option there.

Cheers.

Comments

  • Ok I think this has not been implemented into AC.

    I had to work around it by creating an asset file that fires in every scene and checks my global variable Music countdowns ticks. This means I'd have to set exact number of seconds(integers) for each song.
  • edited December 2015
    But having 2 problems with it :
     
     First is that when I save the game it saves my music countdown ticks. But not the the mark/state/point of the song. Thus when I load it later on after playing the game, the song continues to play and doesnt rewind back, since it didn't save the exact moment of the sonf from which to play. I don't think it's possible to save exact moment of the song anyway.
     But the cowntdown ticks did get saved and this means that the song will be finished but there are still more ticks. So in addition you would have to wait whatever ticks left, before it moves to another song.

    This is very similar issue as with the animations that are still been played when you activate an animation then save the game while it is still being played and try to load it, you'd still see that animation being played.
    Just like with the animations and music.
    This means  an option to have a clean reload  of the saved game is a must have.


    Second, I get this error from time to time when I save the  game change scene and load the save. Although I have my  game objects with Audio Source and Sound scripts  the same Constant ID's in each level. E.g. Music01 in level 01 has the same ID as Music01 in level 02.
    image

    image
    imageimage

    I can only assume that somehow Sound:Play removes/delets a song after it was played.


    How to add wait till finished to Sound: play action? This could have solved playing songs one after another.
  • edited December 2015
    I think I solved the first problem by adding Remember Sound to my Music Objects prefabs.

    I don't get it, you only need your music, sounds prefabs only at the first start level placed in the scene?
    And nowhere else in other levels? This seems the only way to get rid off that second problem with save/load crash. But the asset actionlist can't find the next song after.
    Plus again if you want to test your game starting it from a different level you won't have music and sounds.

    However the second problem-bug seems to only happen when you save and load the same save from the same scene.
    Perhaps agian there is a link here with clean reload of the saved game?
  • edited December 2015
    Ok, I think I solved the second problem with save load crash too.

    I removed all music objects prefabs or any other song objects that I want to play, from all scenes.
    Then I added Object:Add or remove actions which add all my prefab music objects right to the start of my asset music actionlist which is fired at the statrt or onLoad.

    So when the game is fired or loaded they are added to the scene and not just already exist there.
    Thus escaping that issue that when you load your save somehow it cannot find those music prefabs that already exits there, but now it finds the ones I create.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.