Page 1 of 1

Plugins in LOVE

Posted: Tue Nov 20, 2012 9:23 pm
by keharriso
Hi. :)

I'm toying with a simple plugin system using ZIP files as plugins.

Here's how it works:
  • Game assets are stored in ZIP files and put in a designated plugin folder.
  • At startup, the game reads the plugin load order from a configuration file.
  • Each plugin in the load order is prepended to the PHYSFS search path.
I spent a while combing through the LOVE API and could not find any way to perform the third step. What I've done is written a tiny C module that wraps the PHYSFS_addToSearchPath function for use in Lua. Unfortunately, this means that I now need to compile and distribute the game separately for each platform it runs on. One of the many great benefits of LOVE is that I don't usually need to deal with these headaches.

The way I've solved the plugin problem is, therefore, not entirely satisfactory. Do any of you lovers out there know of any way it could be implemented more cleanly? Perhaps you've encountered a better system -- or even wrote one yourself!