ShadowMario / FNF-PsychEngine

Engine originally used on Mind Games mod
Apache License 2.0
1.12k stars 2.19k forks source link

Media pause key on expermental causes the build to crash #13342

Closed BrosterMedia closed 1 year ago

BrosterMedia commented 1 year ago

Describe your bug here.

Pressing one of the media keys on my keyboard (pause, stop, skip forwards and backwards) causes the game to crash.

tested versions: latest experimental (source code) this doesn't seem to happen on 0.7.1h however

image

Command Prompt/Terminal logs (if existing)

Called from hxcpp::__hxcpp_main
Called from ApplicationMain::main ApplicationMain.hx line 25
Called from ApplicationMain::create ApplicationMain.hx line 130
Called from lime.app.Application::exec lime/app/Application.hx line 150
Called from lime._internal.backend.native.NativeApplication::exec lime/_internal/backend/native/NativeApplication.hx line 146
Called from lime._internal.backend.native.NativeApplication::handleKeyEvent lime/_internal/backend/native/NativeApplication.hx line 263
Called from lime.app._Event_lime_ui_KeyCode_lime_ui_KeyModifier_Void::dispatch lime/_internal/macros/EventMacro.hx line 91
Called from openfl.display.Stage::__onLimeCreateWindow openfl/display/Stage.hx line 1702
Called from openfl.display.Stage::__onLimeKeyDown openfl/display/Stage.hx line 1812
Called from openfl.display.Stage::__onKey openfl/display/Stage.hx line 1517
Called from openfl.display.Stage::__dispatchStack openfl/display/Stage.hx line 1293
Called from openfl.display.DisplayObject::__dispatch openfl/display/DisplayObject.hx line 1399
Called from openfl.events.EventDispatcher::__dispatchEvent openfl/events/EventDispatcher.hx line 402
Called from states.PlayState::onKeyPress states/PlayState.hx line 2548
Called from flixel.input.FlxKeyManager::checkStatus flixel/input/FlxKeyManager.hx line 187
Critical Error: Uncatchable Throw: Invalid key code: 1073742085.

Are you modding a build from source or with Lua?

Source

What is your build target?

Windows

Did you edit anything in this build? If so, mention or summarize your changes.

made healthbar and timebar changes in PlayState.hx, unrelated to what causes the game to crash

BernardoGP4504 commented 1 year ago

That's mainly a issue to the way the engine gets what key you pressed, media keys are only for, well.. media ofc so pretty sure flixel (or Psych Engine itself) doesn't expect those kinds of keys

BrosterMedia commented 1 year ago

Well yeah i understand that, but prior to compiling the experimental branch it worked fine in 0.6.x and older version On top of that i don't have this issue either in the publically released build of 0.7.1h Its kinda frustrating that the game just crashes now whenever i want to quick pause my music that's playing outside of the game

BernardoGP4504 commented 1 year ago

Its kinda frustrating that the game just crashes now whenever i want to quick pause my music that's playing outside of the game

Well, if you really want to fix it just change the source code to support it

BrosterMedia commented 1 year ago

Its kinda frustrating that the game just crashes now whenever i want to quick pause my music that's playing outside of the game

Well, if you really want to fix it just change the source code to support it

the problem is that i have no idea where to start, experimental and 0.7.1h use the same exact code there but on the build release of 0.7.1h it works fine but on self compiled it just breaks

moxie-coder commented 1 year ago

it’s an internal OpenFL issue, not an issue with the engine

BrosterMedia commented 1 year ago

still would like to know why the exact same code does not crash in the 0.7.1h build release but does when i compile it myself

moxie-coder commented 1 year ago

okay wait my mistake, it’s an internal issue with Flixel, and you seem to be running on a debug build which is how that error is showing up, but basically it’s due to you pressing a key that isn’t valid or not handled within Flixel

BrosterMedia commented 1 year ago

wow, that's stupid that it straight up crashes the game just because its a debug build, but i guess as long as it doesn't affect the final build its fine

moxie-coder commented 1 year ago

wow, that's stupid that it straight up crashes the game just because its a debug build, but i guess as long as it doesn't affect the final build its fine

I found this out from here