ballistica icon indicating copy to clipboard operation
ballistica copied to clipboard

Workspaces: Does not detect plugins inside folders

Open JoseANG3L opened this issue 2 years ago • 4 comments

I was testing the new Workspaces feature, when creating a folder and putting the plugin inside, when starting BombSquad it says that the mods have been loaded, but none of the mods work, try to remove it from the folder and it works.

It can be fixed? Thanks a lot. error

JoseANG3L avatar Jun 24 '22 17:06 JoseANG3L

This is expected behavior (and should be the same as the standard mods folder). Python adds the workspace root to its path, so it will pick up any modules directly under it, but it won't recurse into subdirectories looking for modules. If you'd like to organize things into directories you'll need to create a package. To do that you'll just need to add an empty __init__.py under mods. Then code should be able to do import mods.dontwork.

Also be aware that for the ba_meta scanner to look for things you're exporting within a package, you'll need to have # ba_meta require api 7 at the top level of the package (so in mods/__init__.py)

Hope this helps. Let me know if I can expand on anything.

efroemling avatar Jun 24 '22 19:06 efroemling

Perfect, so it's like BombSquad's mods folder, thanks.

One question, will the mods folder one day accept compressed files like RAR or ZIP?

JoseANG3L avatar Jun 24 '22 22:06 JoseANG3L

It's not something I've looked into but I'd be supportive if someone wants to experiment. I believe python natively supports loading stuff from zip files; you just need to add the .zip file path to python's paths. So we could perhaps have the engine do so for every .zip it comes across in the standard mod dirs. I'm not sure if this functionality is enabled in our custom python builds for Android/etc. but it wouldn't be hard to find out. The other piece of the puzzle (and probably the harder part) would be getting the ba_meta system to look inside the .zip files to see what stuff (plugins, etc) is available there.

efroemling avatar Jun 24 '22 22:06 efroemling

It would be a nice feature to organize the files and reduce their size.

In my case, the zip file would be a good idea for mods containing new audio, models, textures, but I think it would conflict with Asset Packages.

JoseANG3L avatar Jun 24 '22 23:06 JoseANG3L