Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

the example differs from my actual material so far. i have been placing “constants”, the statusLine bypass string, lookup tables related to the “constants”, etc in globals. i’ve packed all persistence data into prog/**. it’s a whitelist kind of situation.

a flat filter could be complemented with a whitelist/blacklist toggle, that should cover me and probably anyone who comes after me.

i’ll also note i’m willing to take a swing at implementing the features i request if given source access. they seem to be piling up rather quickly, it’s only fair i contribute back.

Okay, here’s what I’ve got so far:

  • dontSave() excludes named identifiers from being saved. You can call it with a single string or a table, and you can call it multiple times to add more identifiers to the list.
  • onlySave() does the opposite, excluding everything but the listed identifiers (and has the same signature/usage pattern as dontSave) (also the do-not-save list takes priority if there’s overlap for some reason)

Currently I’d prefer not to make the save filtering more complex than this (for UX/documentation/support reasons, the actual code isn’t a problem) but: I’ve also added a mechanism for extending the engine with an _init.lua file that gets run at startup and has access to all the stuff inside Folia, so if you or anyone else wants to adjust how things work in the core you’ll be free to do that without having to make a custom build or w/e.

i hold onto the potential future where i reimplement the interpreter, so i’d personally stay clear of _init. it would erode the API boundaries and make reimpl harder, and trying to hack folia from inside it would probably be a lot of headbutting walls