From 92b84168e1007342997bf0f7ee4619c4ad09e25f Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Mon, 20 May 2024 02:56:57 +0200 Subject: [PATCH 01/23] Add camOther to fix zooms on pause and stickers --- source/funkin/play/PlayState.hx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 43dd485cf..20b9d3661 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -491,9 +491,9 @@ class PlayState extends MusicBeatSubState public var camGame:FlxCamera; /** - * The camera which contains, and controls visibility of, a video cutscene. + * The camera which contains, and controls visibility of, a video cutscene, dialogue, pause menu and sticker transition. */ - public var camCutscene:FlxCamera; + public var camOther:FlxCamera; /** * The combo popups. Includes the real-time combo counter and the rating. @@ -960,7 +960,7 @@ class PlayState extends MusicBeatSubState FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camHUD; + pauseSubState.camera = camOther; openSubState(pauseSubState); // boyfriendPos.put(); // TODO: Why is this here? } @@ -1501,12 +1501,12 @@ class PlayState extends MusicBeatSubState camGame.bgColor = BACKGROUND_COLOR; // Show a pink background behind the stage. camHUD = new FlxCamera(); camHUD.bgColor.alpha = 0; // Show the game scene behind the camera. - camCutscene = new FlxCamera(); - camCutscene.bgColor.alpha = 0; // Show the game scene behind the camera. + camOther = new FlxCamera(); + camOther.bgColor.alpha = 0; // Show the game scene behind the camera. FlxG.cameras.reset(camGame); FlxG.cameras.add(camHUD, false); - FlxG.cameras.add(camCutscene, false); + FlxG.cameras.add(camOther, false); // Configure camera follow point. if (previousCameraFollowPoint != null) @@ -1900,7 +1900,6 @@ class PlayState extends MusicBeatSubState if (!result) return; isInCutscene = false; - camCutscene.visible = false; // TODO: Maybe tween in the camera after any cutscenes. camHUD.visible = true; @@ -1919,7 +1918,7 @@ class PlayState extends MusicBeatSubState if (!currentConversation.alive) currentConversation.revive(); currentConversation.completeCallback = onConversationComplete; - currentConversation.cameras = [camCutscene]; + currentConversation.cameras = [camOther]; currentConversation.zIndex = 1000; add(currentConversation); refresh(); @@ -2751,7 +2750,7 @@ class PlayState extends MusicBeatSubState persistentUpdate = false; FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camCutscene; + pauseSubState.camera = camOther; openSubState(pauseSubState); } } @@ -2767,7 +2766,7 @@ class PlayState extends MusicBeatSubState persistentUpdate = false; FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camCutscene; + pauseSubState.camera = camOther; openSubState(pauseSubState); } } From 0a6f1abd33d8cb474dcd8efe81380e5736538fc8 Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Mon, 20 May 2024 23:52:45 +0200 Subject: [PATCH 02/23] Fix references to camCutscene --- source/funkin/play/cutscene/VideoCutscene.hx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index 01a492a77..2177114aa 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -81,12 +81,11 @@ class VideoCutscene // Trigger the cutscene. Don't play the song in the background. PlayState.instance.isInCutscene = true; PlayState.instance.camHUD.visible = false; - PlayState.instance.camCutscene.visible = true; // Display a black screen to hide the game while the video is playing. blackScreen = new FlxSprite(-200, -200).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK); blackScreen.scrollFactor.set(0, 0); - blackScreen.cameras = [PlayState.instance.camCutscene]; + blackScreen.cameras = [PlayState.instance.camOther]; PlayState.instance.add(blackScreen); VideoCutscene.cutsceneType = cutsceneType; @@ -120,7 +119,7 @@ class VideoCutscene vid.finishCallback = finishVideo.bind(0.5); - vid.cameras = [PlayState.instance.camCutscene]; + vid.cameras = [PlayState.instance.camOther]; PlayState.instance.add(vid); @@ -147,7 +146,7 @@ class VideoCutscene vid.bitmap.onEndReached.add(finishVideo.bind(0.5)); vid.autoPause = false; - vid.cameras = [PlayState.instance.camCutscene]; + vid.cameras = [PlayState.instance.camOther]; PlayState.instance.add(vid); @@ -305,7 +304,6 @@ class VideoCutscene vid = null; #end - PlayState.instance.camCutscene.visible = true; PlayState.instance.camHUD.visible = true; FlxTween.tween(blackScreen, {alpha: 0}, transitionTime, From 47cbd4b62038cbd07079b7c1d6ee88c73d54d724 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 21 May 2024 19:11:10 -0400 Subject: [PATCH 03/23] Update compiling guide with more troubleshooting --- docs/COMPILING.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/docs/COMPILING.md b/docs/COMPILING.md index 07df6367f..b08fc528e 100644 --- a/docs/COMPILING.md +++ b/docs/COMPILING.md @@ -21,4 +21,64 @@ # Troubleshooting -- During the cloning process, you may experience an error along the lines of `error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)` due to poor connectivity. A common fix is to run ` git config --global http.postBuffer 4096M`. +While performing the process of compilation, you may experience one of the following issues: + +## PolymodHandler: extra field coreAssetRedirect + +``` +Installing funkin.vis from https://github.com/FunkinCrew/funkVis branch: 98c9db09f0bbfedfe67a84538a5814aaef80bdea +Error: std@sys_remove_dir +Execution error: command "haxelib --never git funkin.vis https://github.com/FunkinCrew/funkVis 98c9db09f0bbfedfe67a84538a5814aaef80bdea" failed with status: 1 in cwd +``` + +If you receive this error, you are on an outdated version of Polymod. + +To solve, you should try reinstalling Polymod: + +``` +haxelib run hmm reinstall --force polymod +``` + +You can also try deleting your `.haxelib` folder in your Funkin' project, then reinstalling all your Haxelibs to prevent any other errors: + +``` +rm -rf ./.haxelib +haxelib run hmm reinstall --force +``` + +## PolymodHandler: Couldn't find a match for this asset library: (vlc) + +``` +source/funkin/modding/PolymodErrorHandler.hx:84: [ERROR] Your Lime/OpenFL configuration is using custom asset libraries, and you provided frameworkParams in Polymod.init(), but we couldn't find a match for this asset library: (vlc) +source/funkin/modding/PolymodHandler.hx:158: An error occurred! Failed when loading mods! +source/funkin/util/logging/CrashHandler.hx:62: Error while handling crash: Null Object Reference +``` + +This error is specific to Linux targets. If you receive this error, you are on an outdated verison of hxCodec. + +To solve, you should try reinstalling hxCodec: + +``` +haxelib run hmm reinstall --force hxCodec +``` + +You can also try deleting your `.haxelib` folder in your Funkin' project, then reinstalling all your Haxelibs to prevent any other errors: + +``` +rm -rf ./.haxelib +haxelib run hmm reinstall --force +``` + +## Git: stream 0 was not closed cleanly: PROTOCOL_ERROR + +``` +error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) +``` + +If you receive this error while cloning, you may be experiencing issues with your network connection. + +To solve, you should try modifying your git configuration before cloning again: + +``` +git config --global http.postBuffer 4096M +``` From ade4aeb3f7c49115591d69f739b41857886edbbc Mon Sep 17 00:00:00 2001 From: Karim Akra <144803230+KarimAkra@users.noreply.github.com> Date: Sun, 9 Jun 2024 01:24:02 +0300 Subject: [PATCH 04/23] get Float instead of Int in cpp (Float is 64-bit in so it works easier than Int64) --- source/funkin/util/MemoryUtil.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/util/MemoryUtil.hx b/source/funkin/util/MemoryUtil.hx index f5935ed67..18fd41472 100644 --- a/source/funkin/util/MemoryUtil.hx +++ b/source/funkin/util/MemoryUtil.hx @@ -48,11 +48,11 @@ class MemoryUtil * Calculate the total memory usage of the program, in bytes. * @return Int */ - public static function getMemoryUsed():Int + public static function getMemoryUsed():#if cpp Float #else Int #end { #if cpp // There is also Gc.MEM_INFO_RESERVED, MEM_INFO_CURRENT, and MEM_INFO_LARGE. - return cpp.vm.Gc.memInfo(cpp.vm.Gc.MEM_INFO_USAGE); + return cpp.vm.Gc.memInfo64(cpp.vm.Gc.MEM_INFO_USAGE); #else return openfl.system.System.totalMemory; #end From 7904a6a20ff76364f6342578ec7d6849e4b098a0 Mon Sep 17 00:00:00 2001 From: Karim Akra <144803230+KarimAkra@users.noreply.github.com> Date: Sun, 9 Jun 2024 01:25:21 +0300 Subject: [PATCH 05/23] use Math.fround instead of Math.round --- source/funkin/ui/debug/MemoryCounter.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/ui/debug/MemoryCounter.hx b/source/funkin/ui/debug/MemoryCounter.hx index b25b55645..50421f398 100644 --- a/source/funkin/ui/debug/MemoryCounter.hx +++ b/source/funkin/ui/debug/MemoryCounter.hx @@ -36,7 +36,7 @@ class MemoryCounter extends TextField @:noCompletion #if !flash override #end function __enterFrame(deltaTime:Float):Void { - var mem:Float = Math.round(MemoryUtil.getMemoryUsed() / BYTES_PER_MEG / ROUND_TO) * ROUND_TO; + var mem:Float = Math.fround(MemoryUtil.getMemoryUsed() / BYTES_PER_MEG / ROUND_TO) * ROUND_TO; if (mem > memPeak) memPeak = mem; From 4997bc27fd0473b5b6f3996ac7150b0240cb62c0 Mon Sep 17 00:00:00 2001 From: Karim Akra <144803230+KarimAkra@users.noreply.github.com> Date: Sun, 9 Jun 2024 12:47:17 +0300 Subject: [PATCH 06/23] remove the library strip --- source/funkin/audio/FunkinSound.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/funkin/audio/FunkinSound.hx b/source/funkin/audio/FunkinSound.hx index 4f61e70c2..be5cc6931 100644 --- a/source/funkin/audio/FunkinSound.hx +++ b/source/funkin/audio/FunkinSound.hx @@ -491,8 +491,10 @@ class FunkinSound extends FlxSound implements ICloneable var promise:lime.app.Promise> = new lime.app.Promise>(); // split the path and get only after first : - // we are bypassing the openfl/lime asset library fuss + // we are bypassing the openfl/lime asset library fuss on web only + #if web path = Paths.stripLibrary(path); + #end var soundRequest = FlxPartialSound.partialLoadFromFile(path, start, end); From 9618cd2128323889d19246fb519b56494a9d20c7 Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:53:32 +0200 Subject: [PATCH 07/23] Fix chart reset when charting and pressing chart key --- source/funkin/play/PlayState.hx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index b3d0a9f8a..1e22e98af 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2284,7 +2284,7 @@ class PlayState extends MusicBeatSubState health += Constants.HEALTH_HOLD_BONUS_PER_SECOND * elapsed; songScore += Std.int(Constants.SCORE_HOLD_BONUS_PER_SECOND * elapsed); } - + // Make sure the player keeps singing while the note is held by the bot. if (isBotPlayMode && currentStage != null && currentStage.getBoyfriend() != null && currentStage.getBoyfriend().isSinging()) { @@ -2612,10 +2612,18 @@ class PlayState extends MusicBeatSubState { disableKeys = true; persistentUpdate = false; - FlxG.switchState(() -> new ChartEditorState( - { - targetSongId: currentSong.id, - })); + if (isChartingMode) + { + FlxG.sound.music?.pause(); + this.close(); + } + else + { + FlxG.switchState(() -> new ChartEditorState( + { + targetSongId: currentSong.id, + })); + } } #end From fb71f9087d546854d4b44311682d84dcdd44fd32 Mon Sep 17 00:00:00 2001 From: NotHyper-474 Date: Mon, 10 Jun 2024 23:12:28 -0300 Subject: [PATCH 08/23] Fix trace --- source/funkin/ui/transition/LoadingState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/ui/transition/LoadingState.hx b/source/funkin/ui/transition/LoadingState.hx index bc26ad97a..0f2ce1076 100644 --- a/source/funkin/ui/transition/LoadingState.hx +++ b/source/funkin/ui/transition/LoadingState.hx @@ -346,7 +346,7 @@ class LoadingState extends MusicBeatSubState return 'Done precaching ${path}'; }, true); - trace("Queued ${path} for precaching"); + trace('Queued ${path} for precaching'); // FunkinSprite.cacheTexture(path); } From b7eaa238e01ba0003ebd53cf71ecb2930c6c7b76 Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Wed, 12 Jun 2024 00:34:04 +0200 Subject: [PATCH 09/23] Revert camCutscene rename --- source/funkin/play/PlayState.hx | 16 ++++++++-------- source/funkin/play/cutscene/VideoCutscene.hx | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 20b9d3661..b88fef188 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -493,7 +493,7 @@ class PlayState extends MusicBeatSubState /** * The camera which contains, and controls visibility of, a video cutscene, dialogue, pause menu and sticker transition. */ - public var camOther:FlxCamera; + public var camCutscene:FlxCamera; /** * The combo popups. Includes the real-time combo counter and the rating. @@ -960,7 +960,7 @@ class PlayState extends MusicBeatSubState FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camOther; + pauseSubState.camera = camCutscene; openSubState(pauseSubState); // boyfriendPos.put(); // TODO: Why is this here? } @@ -1501,12 +1501,12 @@ class PlayState extends MusicBeatSubState camGame.bgColor = BACKGROUND_COLOR; // Show a pink background behind the stage. camHUD = new FlxCamera(); camHUD.bgColor.alpha = 0; // Show the game scene behind the camera. - camOther = new FlxCamera(); - camOther.bgColor.alpha = 0; // Show the game scene behind the camera. + camCutscene = new FlxCamera(); + camCutscene.bgColor.alpha = 0; // Show the game scene behind the camera. FlxG.cameras.reset(camGame); FlxG.cameras.add(camHUD, false); - FlxG.cameras.add(camOther, false); + FlxG.cameras.add(camCutscene, false); // Configure camera follow point. if (previousCameraFollowPoint != null) @@ -1918,7 +1918,7 @@ class PlayState extends MusicBeatSubState if (!currentConversation.alive) currentConversation.revive(); currentConversation.completeCallback = onConversationComplete; - currentConversation.cameras = [camOther]; + currentConversation.cameras = [camCutscene]; currentConversation.zIndex = 1000; add(currentConversation); refresh(); @@ -2750,7 +2750,7 @@ class PlayState extends MusicBeatSubState persistentUpdate = false; FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camOther; + pauseSubState.camera = camCutscene; openSubState(pauseSubState); } } @@ -2766,7 +2766,7 @@ class PlayState extends MusicBeatSubState persistentUpdate = false; FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; - pauseSubState.camera = camOther; + pauseSubState.camera = camCutscene; openSubState(pauseSubState); } } diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index 2177114aa..7612c3ab6 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -85,7 +85,7 @@ class VideoCutscene // Display a black screen to hide the game while the video is playing. blackScreen = new FlxSprite(-200, -200).makeGraphic(FlxG.width * 2, FlxG.height * 2, FlxColor.BLACK); blackScreen.scrollFactor.set(0, 0); - blackScreen.cameras = [PlayState.instance.camOther]; + blackScreen.cameras = [PlayState.instance.camCutscene]; PlayState.instance.add(blackScreen); VideoCutscene.cutsceneType = cutsceneType; @@ -119,7 +119,7 @@ class VideoCutscene vid.finishCallback = finishVideo.bind(0.5); - vid.cameras = [PlayState.instance.camOther]; + vid.cameras = [PlayState.instance.camCutscene]; PlayState.instance.add(vid); @@ -146,7 +146,7 @@ class VideoCutscene vid.bitmap.onEndReached.add(finishVideo.bind(0.5)); vid.autoPause = false; - vid.cameras = [PlayState.instance.camOther]; + vid.cameras = [PlayState.instance.camCutscene]; PlayState.instance.add(vid); From 250ec840efa17b323f69748271982659ad61cc06 Mon Sep 17 00:00:00 2001 From: MaybeMaru <97055307+MaybeMaru@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:11:00 +0200 Subject: [PATCH 10/23] Add missing constants --- source/funkin/play/notes/Strumline.hx | 2 +- source/funkin/play/notes/SustainTrail.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/notes/Strumline.hx b/source/funkin/play/notes/Strumline.hx index 0e4b6645f..3c114b5e0 100644 --- a/source/funkin/play/notes/Strumline.hx +++ b/source/funkin/play/notes/Strumline.hx @@ -37,7 +37,7 @@ class Strumline extends FlxSpriteGroup static function get_RENDER_DISTANCE_MS():Float { - return FlxG.height / 0.45; + return FlxG.height / Constants.PIXELS_PER_MS; } /** diff --git a/source/funkin/play/notes/SustainTrail.hx b/source/funkin/play/notes/SustainTrail.hx index b358d7f03..f6d43b33f 100644 --- a/source/funkin/play/notes/SustainTrail.hx +++ b/source/funkin/play/notes/SustainTrail.hx @@ -160,7 +160,7 @@ class SustainTrail extends FlxSprite */ public static inline function sustainHeight(susLength:Float, scroll:Float) { - return (susLength * 0.45 * scroll); + return (susLength * Constants.PIXELS_PER_MS * scroll); } function set_sustainLength(s:Float):Float From 73efd963b9e1a98c77fdb6a2a8f57517d08f16d1 Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Thu, 20 Jun 2024 07:24:36 +0200 Subject: [PATCH 11/23] Fix crash after pressing F5 and coming back from stickers --- source/funkin/ui/freeplay/FreeplayState.hx | 2 +- source/funkin/ui/story/StoryMenuState.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 0caaf4591..949aa4bfe 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -214,7 +214,7 @@ class FreeplayState extends MusicBeatSubState prepForNewRank = true; } - if (stickers != null) + if (stickers?.members != null) { stickerSubState = stickers; } diff --git a/source/funkin/ui/story/StoryMenuState.hx b/source/funkin/ui/story/StoryMenuState.hx index 06a83ab4d..7707850ce 100644 --- a/source/funkin/ui/story/StoryMenuState.hx +++ b/source/funkin/ui/story/StoryMenuState.hx @@ -113,7 +113,7 @@ class StoryMenuState extends MusicBeatState { super(); - if (stickers != null) + if (stickers?.members != null) { stickerSubState = stickers; } From 717894300d6041e1a24b10682122d9feffb7d18a Mon Sep 17 00:00:00 2001 From: AppleHair Date: Tue, 9 Jul 2024 19:59:31 +0300 Subject: [PATCH 12/23] [BUGFIX] Fixed `cancelMenu` sound not playing after switching state. --- source/funkin/ui/mainmenu/MainMenuState.hx | 2 +- source/funkin/ui/options/OptionsState.hx | 2 +- source/funkin/ui/story/StoryMenuState.hx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/ui/mainmenu/MainMenuState.hx b/source/funkin/ui/mainmenu/MainMenuState.hx index d09536eea..a2bdd23f8 100644 --- a/source/funkin/ui/mainmenu/MainMenuState.hx +++ b/source/funkin/ui/mainmenu/MainMenuState.hx @@ -409,8 +409,8 @@ class MainMenuState extends MusicBeatState if (controls.BACK && menuItems.enabled && !menuItems.busy) { - FunkinSound.playOnce(Paths.sound('cancelMenu')); FlxG.switchState(() -> new TitleState()); + FunkinSound.playOnce(Paths.sound('cancelMenu')); } } } diff --git a/source/funkin/ui/options/OptionsState.hx b/source/funkin/ui/options/OptionsState.hx index 40308d96b..a2301e6a3 100644 --- a/source/funkin/ui/options/OptionsState.hx +++ b/source/funkin/ui/options/OptionsState.hx @@ -145,8 +145,8 @@ class Page extends FlxGroup { if (canExit && controls.BACK) { - FunkinSound.playOnce(Paths.sound('cancelMenu')); exit(); + FunkinSound.playOnce(Paths.sound('cancelMenu')); } } diff --git a/source/funkin/ui/story/StoryMenuState.hx b/source/funkin/ui/story/StoryMenuState.hx index 06a83ab4d..04d021256 100644 --- a/source/funkin/ui/story/StoryMenuState.hx +++ b/source/funkin/ui/story/StoryMenuState.hx @@ -374,9 +374,9 @@ class StoryMenuState extends MusicBeatState if (controls.BACK && !exitingMenu && !selectedLevel) { - FunkinSound.playOnce(Paths.sound('cancelMenu')); exitingMenu = true; FlxG.switchState(() -> new MainMenuState()); + FunkinSound.playOnce(Paths.sound('cancelMenu')); } } From 481f7ab61a6e206bc3aadfd2754cdc299116c087 Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Wed, 10 Jul 2024 00:23:06 +0200 Subject: [PATCH 13/23] Fix F5 chart not reloading --- source/funkin/play/PlayState.hx | 59 ++----------------- source/funkin/ui/MusicBeatState.hx | 7 +-- source/funkin/ui/MusicBeatSubState.hx | 5 +- .../util/plugins/ReloadAssetsDebugPlugin.hx | 14 ++++- 4 files changed, 17 insertions(+), 68 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index f55cef388..8b6753035 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1335,64 +1335,13 @@ class PlayState extends MusicBeatSubState #end /** - * Removes any references to the current stage, then clears the stage cache, - * then reloads all the stages. - * - * This is useful for when you want to edit a stage without reloading the whole game. - * Reloading works on both the JSON and the HXC, if applicable. - * * Call this by pressing F5 on a debug build. */ - override function debug_refreshModules():Void + override function reloadAssets():Void { - // Prevent further gameplay updates, which will try to reference dead objects. - criticalFailure = true; - - // Remove the current stage. If the stage gets deleted while it's still in use, - // it'll probably crash the game or something. - if (this.currentStage != null) - { - remove(currentStage); - var event:ScriptEvent = new ScriptEvent(DESTROY, false); - ScriptEventDispatcher.callEvent(currentStage, event); - currentStage = null; - } - - if (!overrideMusic) - { - // Stop the instrumental. - if (FlxG.sound.music != null) - { - FlxG.sound.music.destroy(); - FlxG.sound.music = null; - } - - // Stop the vocals. - if (vocals != null && vocals.exists) - { - vocals.destroy(); - vocals = null; - } - } - else - { - // Stop the instrumental. - if (FlxG.sound.music != null) - { - FlxG.sound.music.stop(); - } - - // Stop the vocals. - if (vocals != null && vocals.exists) - { - vocals.stop(); - } - } - - super.debug_refreshModules(); - - var event:ScriptEvent = new ScriptEvent(CREATE, false); - ScriptEventDispatcher.callEvent(currentSong, event); + funkin.modding.PolymodHandler.forceReloadAssets(); + lastParams.targetSong = SongRegistry.instance.fetchEntry(currentSong.id); + LoadingState.loadPlayState(lastParams); } override function stepHit():Bool diff --git a/source/funkin/ui/MusicBeatState.hx b/source/funkin/ui/MusicBeatState.hx index 92169df75..8668b64c1 100644 --- a/source/funkin/ui/MusicBeatState.hx +++ b/source/funkin/ui/MusicBeatState.hx @@ -78,9 +78,6 @@ class MusicBeatState extends FlxTransitionableState implements IEventHandler { // Emergency exit button. if (FlxG.keys.justPressed.F4) FlxG.switchState(() -> new MainMenuState()); - - // This can now be used in EVERY STATE YAY! - if (FlxG.keys.justPressed.F5) debug_refreshModules(); } override function update(elapsed:Float) @@ -114,12 +111,10 @@ class MusicBeatState extends FlxTransitionableState implements IEventHandler ModuleHandler.callEvent(event); } - function debug_refreshModules() + function reloadAssets() { PolymodHandler.forceReloadAssets(); - this.destroy(); - // Create a new instance of the current state, so old data is cleared. FlxG.resetState(); } diff --git a/source/funkin/ui/MusicBeatSubState.hx b/source/funkin/ui/MusicBeatSubState.hx index 9035d12ff..5c40b37bc 100644 --- a/source/funkin/ui/MusicBeatSubState.hx +++ b/source/funkin/ui/MusicBeatSubState.hx @@ -72,9 +72,6 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler // Emergency exit button. if (FlxG.keys.justPressed.F4) FlxG.switchState(() -> new MainMenuState()); - // This can now be used in EVERY STATE YAY! - if (FlxG.keys.justPressed.F5) debug_refreshModules(); - // Display Conductor info in the watch window. FlxG.watch.addQuick("musicTime", FlxG.sound.music?.time ?? 0.0); Conductor.watchQuick(conductorInUse); @@ -82,7 +79,7 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler dispatchEvent(new UpdateScriptEvent(elapsed)); } - function debug_refreshModules() + function reloadAssets() { PolymodHandler.forceReloadAssets(); diff --git a/source/funkin/util/plugins/ReloadAssetsDebugPlugin.hx b/source/funkin/util/plugins/ReloadAssetsDebugPlugin.hx index f69609531..0e1e238ac 100644 --- a/source/funkin/util/plugins/ReloadAssetsDebugPlugin.hx +++ b/source/funkin/util/plugins/ReloadAssetsDebugPlugin.hx @@ -1,6 +1,9 @@ package funkin.util.plugins; +import flixel.FlxG; import flixel.FlxBasic; +import funkin.ui.MusicBeatState; +import funkin.ui.MusicBeatSubState; /** * A plugin which adds functionality to press `F5` to reload all game assets, then reload the current state. @@ -28,10 +31,15 @@ class ReloadAssetsDebugPlugin extends FlxBasic if (FlxG.keys.justPressed.F5) #end { - funkin.modding.PolymodHandler.forceReloadAssets(); + var state:Dynamic = FlxG.state; + if (state is MusicBeatState || state is MusicBeatSubState) state.reloadAssets(); + else + { + funkin.modding.PolymodHandler.forceReloadAssets(); - // Create a new instance of the current state, so old data is cleared. - FlxG.resetState(); + // Create a new instance of the current state, so old data is cleared. + FlxG.resetState(); + } } } From 2fb55ba3edf4e84a46dc6e451922af0a2ca63326 Mon Sep 17 00:00:00 2001 From: gamerbross <55158797+gamerbross@users.noreply.github.com> Date: Thu, 11 Jul 2024 06:59:22 +0200 Subject: [PATCH 14/23] Fix default health icon not used --- source/funkin/play/components/HealthIcon.hx | 29 +++++++-------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/source/funkin/play/components/HealthIcon.hx b/source/funkin/play/components/HealthIcon.hx index 2442b0dc5..682334db3 100644 --- a/source/funkin/play/components/HealthIcon.hx +++ b/source/funkin/play/components/HealthIcon.hx @@ -33,7 +33,7 @@ class HealthIcon extends FunkinSprite * The character this icon is representing. * Setting this variable will automatically update the graphic. */ - public var characterId(default, set):Null; + public var characterId(default, set):String = Constants.DEFAULT_HEALTH_ICON; /** * Whether this health icon should automatically update its state based on the character's health. @@ -116,7 +116,7 @@ class HealthIcon extends FunkinSprite */ static final POSITION_OFFSET:Int = 26; - public function new(char:String = 'bf', playerId:Int = 0) + public function new(char:Null, playerId:Int = 0) { super(0, 0); this.playerId = playerId; @@ -127,7 +127,7 @@ class HealthIcon extends FunkinSprite initTargetSize(); } - function set_characterId(value:Null):Null + function set_characterId(value:Null):String { if (value == characterId) return value; @@ -380,20 +380,9 @@ class HealthIcon extends FunkinSprite } } - function correctCharacterId(charId:Null):String + function iconExists(charId:String):Bool { - if (charId == null) - { - return Constants.DEFAULT_HEALTH_ICON; - } - - if (!Assets.exists(Paths.image('icons/icon-$charId'))) - { - FlxG.log.warn('No icon for character: $charId : using default placeholder face instead!'); - return Constants.DEFAULT_HEALTH_ICON; - } - - return charId; + return Assets.exists(Paths.image('icons/icon-$charId')); } function isNewSpritesheet(charId:String):Bool @@ -403,11 +392,11 @@ class HealthIcon extends FunkinSprite function loadCharacter(charId:Null):Void { - if (charId == null || correctCharacterId(charId) != charId) + if (charId == null || !iconExists(charId)) { - // This will recursively trigger loadCharacter to be called again. - characterId = correctCharacterId(charId); - return; + FlxG.log.warn('No icon for character: $charId : using default placeholder face instead!'); + characterId = Constants.DEFAULT_HEALTH_ICON; + charId = characterId; } isLegacyStyle = !isNewSpritesheet(charId); From f8232911cb114e867448f10c134dc63b202b1e48 Mon Sep 17 00:00:00 2001 From: 7oltan <87986834+7oltan@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:52:51 +0300 Subject: [PATCH 15/23] FIX CHARACTER PATHS ISSUE --- source/funkin/play/character/AnimateAtlasCharacter.hx | 2 +- source/funkin/play/character/MultiSparrowCharacter.hx | 4 ++-- source/funkin/play/character/PackerCharacter.hx | 2 +- source/funkin/play/character/SparrowCharacter.hx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/funkin/play/character/AnimateAtlasCharacter.hx b/source/funkin/play/character/AnimateAtlasCharacter.hx index ed58b92b5..5b126db6c 100644 --- a/source/funkin/play/character/AnimateAtlasCharacter.hx +++ b/source/funkin/play/character/AnimateAtlasCharacter.hx @@ -131,7 +131,7 @@ class AnimateAtlasCharacter extends BaseCharacter { trace('[ATLASCHAR] Loading sprite atlas for ${characterId}.'); - var sprite:FlxAtlasSprite = new FlxAtlasSprite(0, 0, Paths.animateAtlas(_data.assetPath, 'shared')); + var sprite:FlxAtlasSprite = new FlxAtlasSprite(0, 0, Paths.animateAtlas(_data.assetPath)); sprite.onAnimationFinish.removeAll(); sprite.onAnimationFinish.add(this.onAnimationFinished); diff --git a/source/funkin/play/character/MultiSparrowCharacter.hx b/source/funkin/play/character/MultiSparrowCharacter.hx index 48c5afb58..48a0ec632 100644 --- a/source/funkin/play/character/MultiSparrowCharacter.hx +++ b/source/funkin/play/character/MultiSparrowCharacter.hx @@ -60,7 +60,7 @@ class MultiSparrowCharacter extends BaseCharacter } } - var texture:FlxAtlasFrames = Paths.getSparrowAtlas(_data.assetPath, 'shared'); + var texture:FlxAtlasFrames = Paths.getSparrowAtlas(_data.assetPath); if (texture == null) { @@ -74,7 +74,7 @@ class MultiSparrowCharacter extends BaseCharacter for (asset in assetList) { - var subTexture:FlxAtlasFrames = Paths.getSparrowAtlas(asset, 'shared'); + var subTexture:FlxAtlasFrames = Paths.getSparrowAtlas(asset); // If we don't do this, the unused textures will be removed as soon as they're loaded. if (subTexture == null) diff --git a/source/funkin/play/character/PackerCharacter.hx b/source/funkin/play/character/PackerCharacter.hx index 2bfac800a..b7dda424f 100644 --- a/source/funkin/play/character/PackerCharacter.hx +++ b/source/funkin/play/character/PackerCharacter.hx @@ -30,7 +30,7 @@ class PackerCharacter extends BaseCharacter { trace('[PACKERCHAR] Loading spritesheet ${_data.assetPath} for ${characterId}'); - var tex:FlxFramesCollection = Paths.getPackerAtlas(_data.assetPath, 'shared'); + var tex:FlxFramesCollection = Paths.getPackerAtlas(_data.assetPath); if (tex == null) { trace('Could not load Packer sprite: ${_data.assetPath}'); diff --git a/source/funkin/play/character/SparrowCharacter.hx b/source/funkin/play/character/SparrowCharacter.hx index a36aed84d..90a695ec3 100644 --- a/source/funkin/play/character/SparrowCharacter.hx +++ b/source/funkin/play/character/SparrowCharacter.hx @@ -33,7 +33,7 @@ class SparrowCharacter extends BaseCharacter { trace('[SPARROWCHAR] Loading spritesheet ${_data.assetPath} for ${characterId}'); - var tex:FlxFramesCollection = Paths.getSparrowAtlas(_data.assetPath, 'shared'); + var tex:FlxFramesCollection = Paths.getSparrowAtlas(_data.assetPath); if (tex == null) { trace('Could not load Sparrow sprite: ${_data.assetPath}'); From 5e1d25e791a14f6b301730043607e14b53f36e8d Mon Sep 17 00:00:00 2001 From: AppleHair <95587502+AppleHair@users.noreply.github.com> Date: Tue, 16 Jul 2024 21:17:53 +0300 Subject: [PATCH 16/23] [BUGFIX] Prevented infinite recursion on freeplay when a song doesn't have the `normal` difficulty Any attempt to create a song without the `normal` difficulty will result in a silent crash when opening freeplay. After some debugging, I discovered that the issue is caused by infinite recursion, which gets triggered at the start of `FreeplaySongData`'s `updateValues`. --- source/funkin/ui/freeplay/FreeplayState.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 0caaf4591..9873f3be6 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -2077,7 +2077,11 @@ class FreeplaySongData function updateValues(variations:Array):Void { this.songDifficulties = song.listDifficulties(null, variations, false, false); - if (!this.songDifficulties.contains(currentDifficulty)) currentDifficulty = Constants.DEFAULT_DIFFICULTY; + if (!this.songDifficulties.contains(currentDifficulty) && currentDifficulty != Constants.DEFAULT_DIFFICULTY) + { + currentDifficulty = Constants.DEFAULT_DIFFICULTY; + return; + } var songDifficulty:SongDifficulty = song.getDifficulty(currentDifficulty, null, variations); if (songDifficulty == null) return; From a93cd05aeb6c30c241c6c8f8211abb953bb65532 Mon Sep 17 00:00:00 2001 From: AppleHair <95587502+AppleHair@users.noreply.github.com> Date: Tue, 16 Jul 2024 22:36:11 +0300 Subject: [PATCH 17/23] Added a comment --- source/funkin/ui/freeplay/FreeplayState.hx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 9873f3be6..51fda0677 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -2080,6 +2080,8 @@ class FreeplaySongData if (!this.songDifficulties.contains(currentDifficulty) && currentDifficulty != Constants.DEFAULT_DIFFICULTY) { currentDifficulty = Constants.DEFAULT_DIFFICULTY; + // This method gets called again by the setter-method, + // so there's no need to continue. return; } From 691da783fc41fc648b760833d4439c4368ef29a3 Mon Sep 17 00:00:00 2001 From: AppleHair <95587502+AppleHair@users.noreply.github.com> Date: Wed, 17 Jul 2024 10:20:48 +0300 Subject: [PATCH 18/23] Updated to extend #2712 --- source/funkin/ui/freeplay/FreeplayState.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 51fda0677..a22652586 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -2077,11 +2077,11 @@ class FreeplaySongData function updateValues(variations:Array):Void { this.songDifficulties = song.listDifficulties(null, variations, false, false); - if (!this.songDifficulties.contains(currentDifficulty) && currentDifficulty != Constants.DEFAULT_DIFFICULTY) + if (!this.songDifficulties.contains(currentDifficulty)) { currentDifficulty = Constants.DEFAULT_DIFFICULTY; - // This method gets called again by the setter-method, - // so there's no need to continue. + // This method gets called again by the setter-method + // or the difficulty didn't change, so there's no need to continue. return; } From 4d81aa0fe696a1878d3678209e20c985e1631425 Mon Sep 17 00:00:00 2001 From: AppleHair <95587502+AppleHair@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:00:07 +0300 Subject: [PATCH 19/23] [BUGFIX] Ensure the variation used for the next song is valid. When playing in story mode, `PlayState` assumes all the songs use the same variation, which is usually true, but not guaranteed. This PR makes `PlayState` use the `getFirstValidVariation` method to find the valid variation instead of using the `currentVariation` variable, which might not be valid. --- source/funkin/play/PlayState.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index f55cef388..9b1cc2ed9 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2963,7 +2963,7 @@ class PlayState extends MusicBeatSubState { targetSong: targetSong, targetDifficulty: PlayStatePlaylist.campaignDifficulty, - targetVariation: currentVariation, + targetVariation: targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty), cameraFollowPoint: cameraFollowPoint.getPosition(), }); }); @@ -2975,7 +2975,7 @@ class PlayState extends MusicBeatSubState { targetSong: targetSong, targetDifficulty: PlayStatePlaylist.campaignDifficulty, - targetVariation: currentVariation, + targetVariation: targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty), cameraFollowPoint: cameraFollowPoint.getPosition(), }); } From c8caeb42ded0be5292680db20c5cb99b2a37bf46 Mon Sep 17 00:00:00 2001 From: AppleHair <95587502+AppleHair@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:34:26 +0300 Subject: [PATCH 20/23] A fix requested by Eric --- source/funkin/play/PlayState.hx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 9b1cc2ed9..20b8d784b 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2959,11 +2959,16 @@ class PlayState extends MusicBeatSubState FunkinSound.playOnce(Paths.sound('Lights_Shut_off'), function() { // no camFollow so it centers on horror tree var targetSong:Song = SongRegistry.instance.fetchEntry(targetSongId); + var targetVariation:String = currentVariation; + if (!targetSong.hasDifficulty(PlayStatePlaylist.campaignDifficulty, currentVariation)) + { + targetVariation = targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty) ?? Constants.DEFAULT_VARIATION; + } LoadingState.loadPlayState( { targetSong: targetSong, targetDifficulty: PlayStatePlaylist.campaignDifficulty, - targetVariation: targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty), + targetVariation: targetVariation, cameraFollowPoint: cameraFollowPoint.getPosition(), }); }); @@ -2971,11 +2976,16 @@ class PlayState extends MusicBeatSubState else { var targetSong:Song = SongRegistry.instance.fetchEntry(targetSongId); + var targetVariation:String = currentVariation; + if (!targetSong.hasDifficulty(PlayStatePlaylist.campaignDifficulty, currentVariation)) + { + targetVariation = targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty) ?? Constants.DEFAULT_VARIATION; + } LoadingState.loadPlayState( { targetSong: targetSong, targetDifficulty: PlayStatePlaylist.campaignDifficulty, - targetVariation: targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty), + targetVariation: targetVariation, cameraFollowPoint: cameraFollowPoint.getPosition(), }); } From 8778ab1d0ec46556338e60fe0eb84c6d26064d7f Mon Sep 17 00:00:00 2001 From: Burgerballs <107233412+Burgerballs@users.noreply.github.com> Date: Tue, 23 Jul 2024 18:09:39 +0100 Subject: [PATCH 21/23] Update PlayState.hx --- source/funkin/play/PlayState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index f55cef388..f82fd791e 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2033,7 +2033,7 @@ class PlayState extends MusicBeatSubState vocals.pause(); - FlxG.sound.music.play(FlxG.sound.music.time); + FlxG.sound.music.play(Conductor.instance.songPosition + Conductor.instance.instrumentalOffset); vocals.time = FlxG.sound.music.time; vocals.play(false, FlxG.sound.music.time); From 964f6878c3fb8d13f4faf6723d299997edceaccf Mon Sep 17 00:00:00 2001 From: Burgerballs <107233412+Burgerballs@users.noreply.github.com> Date: Tue, 23 Jul 2024 19:02:09 +0100 Subject: [PATCH 22/23] Update PlayState.hx --- source/funkin/play/PlayState.hx | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index f82fd791e..07e4f0b1d 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1404,17 +1404,6 @@ class PlayState extends MusicBeatSubState if (isGamePaused) return false; - if (!startingSong - && FlxG.sound.music != null - && (Math.abs(FlxG.sound.music.time - (Conductor.instance.songPosition + Conductor.instance.instrumentalOffset)) > 200 - || Math.abs(vocals.checkSyncError(Conductor.instance.songPosition + Conductor.instance.instrumentalOffset)) > 200)) - { - trace("VOCALS NEED RESYNC"); - if (vocals != null) trace(vocals.checkSyncError(Conductor.instance.songPosition + Conductor.instance.instrumentalOffset)); - trace(FlxG.sound.music.time - (Conductor.instance.songPosition + Conductor.instance.instrumentalOffset)); - resyncVocals(); - } - if (iconP1 != null) iconP1.onStepHit(Std.int(Conductor.instance.currentStep)); if (iconP2 != null) iconP2.onStepHit(Std.int(Conductor.instance.currentStep)); @@ -1436,6 +1425,17 @@ class PlayState extends MusicBeatSubState // activeNotes.sort(SortUtil.byStrumtime, FlxSort.DESCENDING); } + if (!startingSong + && FlxG.sound.music != null + && (Math.abs(FlxG.sound.music.time - (Conductor.instance.songPosition + Conductor.instance.instrumentalOffset)) > 100 + || Math.abs(vocals.checkSyncError(Conductor.instance.songPosition + Conductor.instance.instrumentalOffset)) > 100)) + { + trace("VOCALS NEED RESYNC"); + if (vocals != null) trace(vocals.checkSyncError(Conductor.instance.songPosition + Conductor.instance.instrumentalOffset)); + trace(FlxG.sound.music.time - (Conductor.instance.songPosition + Conductor.instance.instrumentalOffset)); + resyncVocals(); + } + // Only bop camera if zoom level is below 135% if (Preferences.zoomCamera && FlxG.camera.zoom < (1.35 * FlxCamera.defaultZoom) @@ -2030,13 +2030,15 @@ class PlayState extends MusicBeatSubState // Skip this if the music is paused (GameOver, Pause menu, start-of-song offset, etc.) if (!FlxG.sound.music.playing) return; - + var timeToPlayAt:Float = Conductor.instance.songPosition - Conductor.instance.instrumentalOffset; + FlxG.sound.music.pause(); vocals.pause(); - FlxG.sound.music.play(Conductor.instance.songPosition + Conductor.instance.instrumentalOffset); + FlxG.sound.music.time = timeToPlayAt; + FlxG.sound.music.play(false, timeToPlayAt); - vocals.time = FlxG.sound.music.time; - vocals.play(false, FlxG.sound.music.time); + vocals.time = timeToPlayAt; + vocals.play(false, timeToPlayAt); } /** From f8d0ddef3456b31f729d9110f106b0594baaaf4a Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 16 Sep 2024 18:17:07 -0400 Subject: [PATCH 23/23] Update troubleshooting guide --- docs/troubleshooting.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 3b93bab64..54ba396c4 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -1,4 +1,4 @@ -# Troubleshooting Common Issues +# Troubleshooting Common Compilation Issues - Weird macro error with a very tall call stack: Restart Visual Studio Code - NOTE: This is caused by Polymod somewhere, and seems to only occur when there is another compile error somewhere in the program. There is a bounty up for it. @@ -13,3 +13,11 @@ - `LINK : fatal error LNK1201: error writing to program database ''; check for insufficient disk space, invalid path, or insufficient privilege` - This error occurs if the PDB file located in your `export` folder is in use or exceeds 4 GB. Try deleting the `export` folder and building again from scratch. + +- `error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)` + - This error can happen during cloning as a result of poor network connectivity. A common fix is to run ` git config --global http.postBuffer 4096M` in your terminal. + +- Repository is missing an `assets` folder, or `assets` folder is empty. + - You did not clone the repository correctly! Copy the path to your `funkin` folder and run `cd the\path\you\copied`. Then follow the compilation guide starting from **Step 4**. + +- Other compilation issues may be caused by installing bad library versions. Try deleting the `.haxelib` folder and following the guide starting from **Step 5**.