gdquest-demos / godot-make-pro-2d-games

A-RPG demo made with Godot, MIT-licensed, from our Godot course
MIT License
995 stars 108 forks source link

Coins and CoinsCollector: cyclic reference error in Godot 3.1 #69

Closed anissen closed 6 years ago

anissen commented 6 years ago

When trying to run the game on the very latest from-source Godot I get the following error message:

Parser Error: Could not fully preload the script, possible cyclic reference or compilation error.

Coins.gd includes CoinsCollector.gd and vice versa.

I expect that the project is made with/for Godot 3.0.x and that this issue is caused by an addition to the source since then.

NathanLovato commented 6 years ago

Yup, because in 3.1 you can register a class as a type for type checking, but in 3.0 you have to preload the script. In 3.0 no problem, it runs.

anissen commented 6 years ago

Okay, thanks for the explanation. By the way, I tried resolving the cyclic dependency (by commenting out one of the references) and ran into a bunch of other 3.1-issues.

Should I close the issue (because this repository is 3.0.x-only for now) or keep it open?

NathanLovato commented 6 years ago

It's fine for this one. If there's a backwards-compatible way to fix all issues for 3.1, people are welcome to contribute. I just won't do this work now, got enough on my plate already