Forum rules - please read before posting.

Different storages of Music

Hello Chris and everybody.
I was wondering:
is there an option to change the Music Storage of AC or to have multiple storages for each part of my game?
As you might remember, I had a random looping set of tracks for the demo of ENCODYA:.
What I'd like, now that I'm developing the full game, is to have a set of tracks to randomize for each part of my game. ENCODYA will have 5 parts and for each part there'll be 6-7 music tracks looping.
What I'd like is that, as soon as I end Part 1 and enter into Part 2, the randomized music tracks are brand new.
So, as stated at the beginning, is it possible through action to change the tracks stored into the Music Storage, or, even, better, have 5 different Music Storage(s), one assigned to play for each part?
Thanks a lot!


  • Why not just put them all in the same storage, and change the way they're randomly picked?

    You can modify the music storage data, but only through custom script / Action. They are accessed with:


    This is a List of the MusicStorage class, which you can modify as necessary. Bear in mind that changes will survive game restarts - so you'll need to set it back to it's original state at the start of your game to re-initialise it.

  • "Why not just put them all in the same storage, and change the way they're randomly picked?"

    What do you mean? How can I achieve that?

    Thanks for your help!

  • Presumably you're using some script or ActionList to randomly pick a track from inside your Music Storage window.

    I'm saying that you could just add all the tracks you would ever want to play in the game, and change the random-picking process to only select from the tracks you want to at that given moment.

  • Oh the thing is: I'm using the "Shuffle Music" in the ActionList...
    I guess we worked on that some months ago.
    Following this:
    Plus a script OnStopMusic to shuffle again.

    I'll dig into that custom action...

  • Maybe the solution would be to set an ID range for the Shuffle Music Action?
    Like having some slots to fill in the "Shuffle Music" action itself, with ID range from [...] to [...]. Can you help me with that? Implementing the existing custom action? (that I copied from the wiki). Thanks!

  • Updated the wiki.

  • Awesome! Thanks a lot! Will test now.

  • Hi everyone,
    I'm trying to improve the shuffle music, but, maybe, I make something wrong. I'm using the shuffle music action of the wiki ( In the music storage I put 3 clip (clip 14-15-16), so, in min track index I put 14 and in max track index 16, but when I test it I can hear only the clip number 14, like if it doesn't take the range but only the min track index. I only change these parameters and checked "Loop?" (if I don't check I can hear the track 14 only one time).

    Have I to do something else?

    Thank you very much.

  • Sorry - do you have 3 clips, or 16 clips, in the Music Storage Window?

    The Action will cap the maximum to the number of clips in the window - so that entering e.g. 100 won't cause an error.

    What if you try a minimum of 0? Can all tracks get played randomly then, or is it still just track 0?

    Which track is played is set by the "trackID" integer in the AssignValues function - a Debug.Log statement in there may reveal more.

  • Hi Chris, I have 16 clips. I thought I can play a range of the tracks in Music Storage Window.
    I made this test: I tried to put a min track to 0 and max tack to 100 without loop. In this case it plays only a music one time. Then I checked loop: this time it makes loop only for the first music it plays.
    But there's not shuffle music: only one track. I noted that is random only at the start: I play a scene where I put this action on cutscene on start and every time it chooses a random track, but not play more than one track randomly.

    I thought, with this action, to can play a range of tracks randomly, but it seems to play only a track chosen casually.

  • edited March 30

    I'm still not clear on what you're expecting when loop is checked. If you loop a track, it's not going to play any others because it's now playing indefinitely.

    To have tracks play in a random sequence, you need to queue them.

    Please be clear - what is the difference between what you want, and what is happening?

  • Hi Chris,
    I'd like to play in loop a custom range of tracks. So If I choose a range (Ex. clip from 14 to 16) I'd like to can loop randomly these three tracks.

  • Once a track is looping, it won't be able to play another track until you command it with another such Action.

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.
Do NOT follow this link or you will be banned from the site!