lequietriot / Old-School-RuneScape-Cache-Tools

The ultimate suite of Old School RuneScape Cache editing tools. Also supports most RS2, RSHD, & RS3 caches.
15 stars 5 forks source link

Music Player: Playing music from cache doesn't work? #3

Open CypherNL opened 2 years ago

CypherNL commented 2 years ago

Program version: v.0.3.1-beta (jar version) OS: Windows 10 Education 21H2 Java version:

java version "1.8.0_333"
Java(TM) SE Runtime Environment (build 1.8.0_333-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode)

When not loading a custom MIDI file, i expect that the music player is loading a track from cache. Especially when you enable "Shuffle Music".

Instead, you get this error message:

Exception in thread "Thread-2" java.lang.NullPointerException
        at java.util.Objects.requireNonNull(Unknown Source)
        at osrs.MusicTrack.readTrackFromString(MusicTrack.java:453)
        at application.GUI.lambda$initSoundEngine$29(GUI.java:576)
        at java.lang.Thread.run(Unknown Source)

Selecting Index 6 or any file under the archives doesn't work either. Switching the index in the music player to 11 only plays a track similar to the cutscene after you completed the starter quest of 'Receipe for Disaster'. It doesn't shuffle to any other track after playing that track, it will only loop to that track.

This issue is perceived on any cache (Old School RuneScape and RSHD).

The only workaround for playing RuneScape tracks after each other or playing in shuffle mode is loading the custom MIDI files and load an another one. But it's not how it should work i think.

lequietriot commented 2 years ago

Thanks, I will implement some sort of indicator for the music player operations, probably similar to the one in the cache explorer. The error isn't much of a bug, as it occurs when the track name is not valid. In any case, the solution for now is to press "Stop" then press "Play" again after changing the "Current Loaded Song" field.