godot-escoria / escoria-issues

Central Escoria issue tracker
3 stars 0 forks source link

Escoria has a lot of dependencies making it hard to use isolated #216

Closed AnidemDex closed 2 years ago

AnidemDex commented 2 years ago

I tried to use escoria for the first time after reading the documentation, but the documentation and "real world" are very different. I'll probably note here two issues at once since I don't know how to split them:

Just a note

I tried with assetlib files first, and then, clonned the repositories manually when the assetlib versions didn't worked. Asked in the discord server but at the end I decided to open an issue that also may serve as a discussion for this. Thanks to Tootle on discord server for trying to help me.

What I did?

I installed the core, but the editor wasn't able to enable it due to script errors. I thought that was my fault, so I installed the template. The template "worked", but some errors appeared in console. No matter how many times I reloaded the project, I ended with the same log: image

I thought that I did something wrong, so I used the game demo, it "worked" as the template. I gave up so continued using the game demo as my template to follow the step by step page from the documentation. At some point I got bored of not being able to follow the documentation to the letter to fix the bugs first, so I decided to fix the root of the problem before going back to the getting started guide.

I found that the plugin script relies on escoria autoload, wich is Escoria class (but in a scene and with "main" scene added as root). Since it is not added before the activation of the plugin, it is unable to get escoria definition. image

Escoria class uses others scripts registered in the global namespace (like the logger one), but those scripts has a similar problem: they tries to use escoria autoload, but that autoload doesn't exists, breaking everything. image

Expected behavior Just downloading and enabling core should work, right?

Versions

Additional context Why is hard to use it the first time? Shouldn't it be an "install this and this to use it"?

I stopped using it after trying to follow the step by step guide with the game demo. I wanted to do it as is, not trying to solve bugs before trying to follow the step by step tutorial (I mean, I can, I know how, but maybe I'll end touching something that wasn't supposed to be modified)

Workaround

Use the game demo as template cloning it from the repository, not the assetlib version, and figure out how to adapt it to your game

dploeger commented 2 years ago

I'd always recommend using the game template instead of just installing the core because it also brings the required ESC startup files, etc.

Just using the core should basically work, though. At least the singleton should be registered (maybe you need to reload the project after enabling the plugin) and I thought this was fixed some days ago (@StraToN ?).

That being said, the code currently is highly alpha, so we can not guarantee it to work at any time before we actually released at least a beta version. So maybe just bear with us here. 😃

AnidemDex commented 2 years ago

Oh, is on alpha state then. Since is marked with a 4 major release but has no previous ones I thought that was just a fancy name, sorry about that @dploeger .


The register of the autoload is impossible due the thing that I mentioned in the issue: plugin script can't be loaded because it tries to use the autoload wich is not registered at that point

dploeger commented 2 years ago

No worries. Yeah, I thought we did fix that already. :)

AnidemDex commented 2 years ago

Is not fixed yet. I ended splitting it by myself (separate editor and game behaviour in two different parts) based on previous plugins that I've made

StraToN commented 2 years ago

Is not fixed yet. I ended splitting it by myself (separate editor and game behaviour in two different parts) based on previous plugins that I've made

Indeed, fixing this issue will end up with something similar. Thanks for the report and research, I'm on it.