|
Post by juicybooty on Feb 24, 2015 18:56:09 GMT
Hello,
I have four songs in each scene
two dialog (starting and loop) - plays only when dialog is on screen
two scene music (starting and loop) - plays when dialog is not on screen (Each scene has different two songs)
I have them in different playlists. I want the scene music to pause and then dialog music to start. Then when dialog is done I want scene music to continue where it left off. I searched in documentation but it seems you can only resume where you left off if all of the songs are in the same playlist. Is there a way to do this for multiple playlists? Thank you so much!
Warm Regards, Jesse
|
|
|
Post by DarkTonic Dev on Feb 24, 2015 23:45:52 GMT
No, unless you write some code yourself, there's no way to do it with multiple Playlists. That's because the first song played in a Playlist (when you change Playlists) must always start from the beginning to avoid some obscure bugs. I haven't heard a reason why you need to use multiple Playlists though. It seems you could put that all in one and have your problems vanish.
-Brian
|
|
|
Post by juicybooty on Feb 24, 2015 23:55:21 GMT
Hello Brian,
Thank you for your reply. The reason I would like it to use playlists is because I don't know how to use a single playlist to do this.
I have the four songs
Scene Music First Pass
Scene Music Loop
Dialog Music First Pass
Dialog Music Loop
I want the scene music to pick up where it left off after the dialog music comes in and goes, but I don't know how to tell if I am on the first pass or on the loop. Additionally it will be more programming because I will be calling specific names of the clips instead of playlists. I can call the playlist anything and call it in programming each time. But now that I am dealing with clips I will have to check which songs are available for each level to ensure I call the correct ones. I would appreciate any guidance. Thank you!
Warm Regards, Jesse
|
|
|
Post by DarkTonic Dev on Feb 25, 2015 0:15:26 GMT
It seems you still will have that problem using 2 Playlists - i.e. when you transition back to "Scene music" (non-dialog), you won't know whether to go to first pass or loop. Right?
If you're writing code anyway, I suggest you put it all in one Playlist, then when you want it to switch to a new song, read the name of the current song and store it for later, then change song by name.
You can also grab the name of a song in a certain position (if you'll always have 4 songs) like this:
var newSongName = PlaylistController.Instances[0].CurrentPlaylist.MusicSettings[3].songName;
|
|
|
Post by juicybooty on Feb 28, 2015 21:05:27 GMT
Hello Brian!
Thank you for your reply! Your idea is brilliant.
How do I determine what song is currently playing? I looked in the documentation but I am struggling to find it. Thank you!
Warm Regards, Jesse
|
|
|
Post by DarkTonic Dev on Feb 28, 2015 22:46:54 GMT
Do you mean the number of the song or the song name? The song number may not be available currently but I could add it. Let me know and I'll get your the info.
|
|
|
Post by juicybooty on Mar 1, 2015 0:13:18 GMT
Hello Brian,
Thank you for the quick reply.
Whichever you think is best or whatever is available currently (number or string is okay).
I just need to know what the current song is playing and how to change the clip back to it.
MasterAudio.TriggerPlaylistClip("Dialogue Music First Pass"); is how I should change to the dialog song and how I should change back MasterAudio.TriggerPlaylistClip(lastplayedsong);
I really appreciate your help. Thank you!
Warm Regards, Jesse
|
|
|
Post by DarkTonic Dev on Mar 1, 2015 4:19:07 GMT
No problem. If you have only one Playlist Controller, this is the code to get the current song name.
var clip = PlaylistController.Instances[0].CurrentPlaylistClip; if (clip != null) { var songName = clip.name; // save this variable for later when you want to play it again.
}
|
|
|
Post by juicybooty on Mar 2, 2015 1:51:19 GMT
Hello Brian!
It worked :]
Thank you so much for all of your help!
|
|
|
Post by DarkTonic Dev on Mar 2, 2015 3:54:23 GMT
Cool, no problem
|
|