-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with Godot 4.3 #196
Comments
Just a guess, can't test right now: entity has |
Indeed that does work, both on the ProjectManager and on exported builds (without a corrupted data.pandora). if ScriptType != null:
if Engine.is_editor_hint() and ScriptType.has_source_code():
return ScriptType.new()
else:
if ScriptType.can_instantiate():
return ScriptType.new() Not the best code for sure, but the workflow is that. |
@shomykohai that code looks good. We should go with that. |
Perfect, I'll make a PR for it. |
Fixes various issue that came from Godot 4.3 changes in GDScript and loading: bitbrain#196 bitbrain#187
Why not make the type handlers tools though? If |
The function that gets called is a static function, that the editor uses to fetch the icons of each types. Not knowing how fully Pandora works (I didn't look up the editor part that much) I can't say it for sure though. Edit: just wondering, why does can_instantiate return false, assuming the script to be valid, when it does not have the |
Seems to also check for tool: I guess code that isn't marked as tool is not meant to run in editor which would include the initializer and constructor. Not sure what the intended behavior is with instantiating non tools from tool scripts. This question might better be asked in the contributors chat. Back to pandora: I'd guess the editor has to use the non static |
Godot version: 4.3-beta3
Describe the bug
Refer to godotengine/godot#94150 for further details
TL;DR:
The type handler code uses
Script.has_source_code
to test if a script is valid.This is
false
for scripts with binary tokenization.Script.can_instantiate
should be used.The MRP from the orginal issue does work with this change, but fails when copying the newest version of pandora in there and making the change.
I found that when running the game, data.pandora gets saved in a corrupted way:
{"type": "undefined", "value": "<CompressedTexture#84384>"} where it should be {"type": "resource", "value": "res://godot.png"}. As stated this does not happen with the pandora version from the MRP, I don't know which version that is though.
To Reproduce
has_source_code
withcan_instantiate
to see that it fixes the issuehas_source_code
withcan_instantiate
to see that it does not work anymoredata.pandora
to see that it get's corrupted when running the gameExpected behavior
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: