Plugins in LOVE

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
keharriso
Citizen
Posts: 98
Joined: Fri Nov 16, 2012 9:34 pm

Plugins in LOVE

Post 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!
LÖVE-Nuklear - a lightweight immediate mode GUI for LÖVE games
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 54 guests