HungryProton / scatter

Godot engine addon to randomly fill an area with props or other scenes
MIT License
2.08k stars 94 forks source link

Parser Error: Could not find type "ProtonScatterBaseShape" in the current scope. #173

Open BalJoseph opened 10 months ago

BalJoseph commented 10 months ago

When I try to run my project I (inconsistently) encounter this error.

I have not been able to recreate this error consistently, when I do encounter the error and I restart the project the error does not reappear again for quite some time.

I would appreciate any information on what could be causing this error and how I should go about resolving it.

Thanks

Eole211 commented 10 months ago

I sometimes get the same error, can't recreate it consistently either.
I'm using the .NET version of Godot 4.2, with ProtonScatter 4.0

Eole211 commented 9 months ago

It seems to be more of a godot problem than a protonscatter problem : https://duckduckgo.com/?t=h_&q=godot+Parser+Error%3A+Could+not+find+type+in+the+current+scope.&ia=web

The error does not happen when running the project from godot CLI or when running/debugging with vs code and the godot .net tools extension, so that's what I'm doing now to stay sane @BalJoseph

PS : if you use C#, you'll need to build the .net project with dotnet build before launching it with the CLI, otherwise you won't see your changes

Eole211 commented 8 months ago

Well in fact it still happens when launching from vs code or CLI, but in vs code it just ignores the error and keep running the game without protonscatter...

This bug is really weird.. It seems ProtonScatterBaseShape is not loaded when it should be. If you add this line : const ProtonScatterBaseShape := preload('./shapes/base_shape.gd') at the beginning of scatter_shape.gd, the error doesn't happen here, but it can still happen later, when parsing path_shape.gd : Parser Error: Could not find base class "ProtonScatterBaseShape".

Like I said earlier : It seems to be more of a godot bug than a ProtonScatter bug. The hard part is reproducing it : it's happening regularly in my huge game project, but in the scatter demo scene or in other smaller projects it never does.