Catarax wrote:However, when I use $PlayTrack$, at the end of the track, another one is picked from the broken random soundtrack list.
This is not the function "skiptrack"/"SkipMusicTrack" used at that moment, i have no control.
So my questions are :
- When PlayTrack is used, does the next track is defined already before the new track launched?
- Is there a name to the function probably used when a track ends?
From my understanding, when randomize music tracks is set, the game builds a list of the tracks in a random order.
The list is rebuilt each time the end of the list is reached.
A suggestion, you could create 2 (or more if needing helper functions) scripts one for Play_Track and one for Skip_Track
Your play track function can be called without parameters and generates a random or in order index to the next track to play based on whether random is set or not. So you'll need to keep track of the current index set in the event in order is set you just add 1 to it or set to zero if max tracks. Your skip track can do the same thing.
Since the games PlayTrack can take a parameter of index of the track to play, this should work. However, you'll need to replace all instances of PlayTrack with Play_Track and all instances of SkipTrack with Skip_Track.