firebelley / godot-export

Automatically exports your Godot games.
MIT License
486 stars 59 forks source link

Godot 4 separate importing option #109

Closed Malcolmnixon closed 1 year ago

Malcolmnixon commented 1 year ago

Godot 4 supports circular dependencies in gdscript code; however it does this by generating a global_script_class_cache.cfg file to perform resolution; however the first time the project is opened it's trying to both generate the cache and load the scripts. The result is the first time the project is opened it will erroneously report script errors and fail to process tool and plugin scripts correctly.

The workaround is just to close the project and re-open it. Given the simplicity of the workaround it doesn't seem like the script developers have a strong incentive to fix this any time soon - so for the foreseeable future Godot 4 will need to run twice for a project to correctly be opened.

Would it be possible to add an option to the godot-export action to run godot twice - once with a "--quit" argument just to import the assets and generate the script resolution cache, and then the second execution is used to perform the exports.

firebelley commented 1 year ago

Hello, is this PR going to fix the issue? https://github.com/godotengine/godot/pull/75798

I can fix this problem here, but if it'll be fixed soon then I think it'll be appropriate to wait on that.

Malcolmnixon commented 1 year ago

Thanks, I checked out https://github.com/godotengine/godot/pull/75798 and it does improve the export, but it still didn't work 100% for me - there may be more actions required than just the update of the script classes.

firebelley commented 1 year ago

Please try the latest version v5.1.0, I re-added the open/close functionality required to address this issue.