-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
class_name issue when using (compressed) binary tokens in pck #88796
Comments
That seems to be the case because i am getting:
Which i did not notice at the time of filing the issue |
I can't reproduce the bug described in the first post. Please provide MRP. Also could you please check if #88853 fixes your issue. |
#88853 does not seem to resolve the issue. I'm working on creating an MRP today. Having trouble reproducing it other then in my project. Still believe it to be a bug since it works correctly with my project with Text Export |
I am seeing this issue too... but also with a large-ish project. Similar results and workarounds as the OP. [on master, a586e86] In my case, I have two .gd files mentioned as possible cyclic resources. I'm pretty sure they do depend on each other, indirectly at least, since one is an autoload file with some globals and the other is a core game level script whose callees also use that autoload. This MRP shows the "cyclic resource" error in the exported project BUT does not crash. Let me know if you want more. |
This is an MRP which actually shows the bug and the bad results. The last error ( It's got no functionality whatsoever other than the kind of dynamic scene and script loading that triggers the issue for me. When run under the editor, you should see nothing but a grey window. Normal output is:
When running the exported project, you'll see:
|
The only error im getting is
And then any cast to EnemyCharacter (defined in class_name of EnemyController) fails only when exported as binary tokens. Text is working perfect. I'm going to see if it has anything to do with the global script ive added recently. Because i do not recall that issue prior to that Not sure of a good way to figure out the issue as its working great with text export. Any ideas on troubleshooting this? |
AFAIK the binary script export is a new feature recently added (and made default) on master. It's not present (or exposed?) in 4.3dev3. (I see raw text in the functioning exported binaries built with that engine/template). When the error is reported, it means problems will occur later on, presumably when creating Nodes using the mentioned types. I was able to successfully export projects as of a week or so ago and also only saw it break recently without any structural changes in the area of code that now reports the cyclic dependencies. So, given all that, IMHO, there's nothing else you need to do. My MRP demonstrates the bug, I think. |
@eswartz I fixed the issue with your MRP in #89005. Please test if this fixes the bug in your project. @wpbirney Please try testing with #89005. There is a chance that there is another kind of regression going on, not related to script paths (though I'm guessing that's the reason). If the bug is still reproducible, then we need a MRP. If you can't create it from scratch, then you can try another approach. Make a copy of your project and iteratively remove parts that you think are not related to the bug. Continue until the project is small enough to debug. If the bug disappears at some point, go back to the previous step and try to remove something else. |
@dalexeev Yes, that PR (or master, since it was merged a minute before I saw this) works properly in my actual game. Thanks! |
Tested versions
System information
Godot v4.3.dev (2e7fc81) - Void #1 SMP PREEMPT_DYNAMIC Wed Feb 7 19:24:35 UTC 2024 - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 XTX (RADV NAVI31) () - AMD Ryzen 9 5950X 16-Core Processor (32 Threads)
Issue description
I have a scene with a script like so
When running from the editor OR when the pck is exported with gdscript in text format not binary tokesn my
Bullet
class with the following works fineb is not null and it executes correctly.
However when i export using binary tokens this fails and returns null even though body.get_script() returns EnemyCharacter.
I cannot seem to narrow the issue down as I am using this same style of cast and it is working in other situations. I have item pickups working the same way without issue with either binary tokens or plain text. The only difference i see is the ones that are working have Node3D parents. While the one that is not working with binary tokens
EnemyCharacter
has aCharacterBody3D
parent andBullet
has aRigidBody3D
parent.I believe it to be a bug simply because it works correctly with gdscript exported as Text or when run in the editor.
Steps to reproduce
Haven't been able to make a simple reproducible without including all of my games scripts.
Bullets
func _on_body_entered(body):
cast body to EnemyCharacter and check if nullMinimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: