Skip to content
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

Typed variable of custom class type in autoload produces error in exported binary #89343

Closed
ghmart opened this issue Mar 10, 2024 · 3 comments
Closed

Comments

@ghmart
Copy link

ghmart commented Mar 10, 2024

Tested versions

  • Reproducible in 4.3-dev4.
  • Not reproducible in 4.2.1-stable.

System information

Godot v4.3.dev4 - Debian GNU/Linux 11 (bullseye) 11 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti () - 11th Gen Intel(R) Core(TM) i5-11600K @ 3.90GHz (12 Threads)

Issue description

Typed variable of custom class type in autoload produces error in exported binary:

"ERROR: Another resource is loaded from ... (possible cyclic resource inclusion).
at: set_path (core/io/resource.cpp:75)"

Running from editor is OK.
Omitting type from variable in autoload makes error gone.

Steps to reproduce

  1. Create autoload script "events.gd" (name "events"):
extends Node

signal started

var level: Level
  1. Create main scene with script:
extends Node2D

func _ready():
	events.level = $Level
	events.started.emit()

	print(events.level)
  1. Create "Level" scene with script:
class_name Level extends Node2D

func _ready():
	await events.started
  1. Instantiate "Level" scene as a child of main scene.

  2. Export and run project in terminal.
    print(events.level) outputs null.

Minimal reproduction project (MRP)

auto.zip

@lostminds
Copy link

I ran into a similar issue which I think turned out to be this issue #88796 with the new binary script tokens (enabled by default in exports). Try changing it back to the old default of text script tokens (in export config, far right Scripts tab), and if that fixes it it's probably the same issue.

@ghmart
Copy link
Author

ghmart commented Mar 10, 2024

You are right!
Changing GDScript export mode to text fixes this error.

Thank you!

@AThousandShips
Copy link
Member

Then this should be fixed in the latest version, if you can compile yourself you can test, otherwise you can see in the next development release

Closing as resolved :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants