derkork / godot-statecharts

A state charts extension for Godot 4
MIT License
734 stars 35 forks source link

Exported game showing state-chart script errors with AMD #74

Closed bazsupport closed 6 months ago

bazsupport commented 7 months ago

When I exported the game and he tried it, the game would not start and gave this error: ApplicationFrameHost_qEIPr77CdC

After following the instructions, the game did start, but the following errors were showing:

`C:\Users\Rashid>mira.exe --rendering-driver opengl3

C:\Users\Rashid>Godot Engine v4.2.1.stable.official.b09f793f5 - https://godotengine.org/ OpenGL API 3.3.0 Core Profile Context 23.Q3.230719 - Compatibility - Using Device: ATI Technologies Inc. - AMD Radeon RX 6800

SCRIPT ERROR: Parse Error: Could not find type "EditorDebuggerSession" in the current scope. at: GDScript::reload (res://addons/godot_state_charts/utilities/editor_debugger/editor_debugger_message.gd:91) SCRIPT ERROR: Compile Error: at: GDScript::reload (res://addons/godot_state_charts/utilities/editor_debugger/editor_debugger_remote.gd:-1) SCRIPT ERROR: Compile Error: at: GDScript::reload (res://addons/godot_state_charts/state_chart.gd:-1) SCRIPT ERROR: Compile Error: at: GDScript::reload (res://player/scripts/player.gd:-1) ERROR: Failed to load script "res://player/scripts/player.gd" with error "Compilation failed". at: load (modules/gdscript/gdscript.cpp:2788)`

Update: This version of AMD graphics drivers seems to work and user was able to run the game: 23.12.1 - December 5th, 2023

derkork commented 7 months ago

The error messages regarding state charts should probably be fixed (even if they have no impact on being able to run the game). The game startup failure was very likely caused by the graphics card driver and not the addon.

bazsupport commented 7 months ago

Sounds good! Thanks again for this asset, super useful

Devworks8 commented 7 months ago

I'm also receiving this compile error when running my exported game. I'm using version 0.12.0

Screenshot 2024-01-26 160637

I found a solution. The issue is caused by the static function settings_updated on line 92 in the editor_debugger_message.gd file. The session argument is implicitly declared as type EditorDebuggerSession. This type is only globally available within the editor. Once you export, the type doesn't exist. By simply removing the implicit declaration the script compilation errors vanish and the state machine works as expected.

Replace: static func settings_updated(session:EditorDebuggerSession, chart:NodePath, ignore_events:bool, ignore_transitions:bool) -> void:

With: static func settings_updated(session, chart:NodePath, ignore_events:bool, ignore_transitions:bool) -> void: