Page 1 of 1

[P] Playing Next Part of Sequence Errors When Load Data Music ID Is Absent

Posted: Tue Aug 02, 2022 7:26 pm
by Trybien
User Agent String: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0
Link: http://aaonline.fr/player.php?trial_id=143265
What happened?: Transitioning to next part in a series prevents game to start due to music id in load data not being found.
What did you expect to happen?: Case starts when clicking play button
Can you reproduce the problem?: Yes. In part 1 create a music track and set it to play in the Storyboard. Transition to part 2, transferring data does not matter, but make sure the same music id does not exist.
What did you do before the problem showed up?: Loaded the game after transitioning from a previous part

Re: [P] Playing Next Part of Sequence Errors When Load Data Music ID Is Absent

Posted: Thu Dec 01, 2022 4:37 pm
by TimeAxis
I took a look at fixing this, and had a couple theories on possible fixes, but I can only create individual trials on my machine, not trial sequences, unless I install the entirety of AAO including the forum (something that doesn't have a nice step-by-step guide on how to do, so I'd be a bit lost), so for all practical purposes, I wouldn't be able to test it even if I were to fix it. Instead, I'll just share what I've found to hopefully save someone else some time if they give this a shot:

In player_actions.js in the function runFrameActionAfter, around line 471, there's a part where save data is prepared for jumping to the next part. Maybe setting currentMusicID to MUSIC_STOP there could fix this.

I had a few other more far-fetched ideas, but that one seems the most likely to me. If I were able to test it, I'd do the fix myself, but I can't.
Spoiler : If the above doesn't work :
Another place to look is in player_save.js in the loadSaveData function, on line 74, there's a line:

Code: Select all

playMusic(save.current_music_id);
This seems to trigger on all save loads, and for some reason the "if current_music_id != music_id" in the PlayMusic function on line 84 of player_sound.js doesn't seem to catch when you manually set current_music_id to either -1 or MUSIC_STOP through editing the URL, even though both values are shown as -1 through my browser's debugger. Maybe set current_music_id to null and change the above line to only call playMusic if it's not null, although that may be a bit hacky. Or maybe changing that if from a != to a !== might help? Anyway, I'm sure people more familiar with the code would have a better idea of this stuff.

Re: [P] Playing Next Part of Sequence Errors When Load Data Music ID Is Absent

Posted: Sat Dec 03, 2022 5:15 pm
by Mosy
I noticed tons of bugs related to next sequence as well.

TimeAxis, At this point you're keeping the forums more up to date about the code than even the mods XD
I always enjoy reading your findings in the code, they are super interesting!
If only this site got more stability updates to the code more frequently... :/