Skip to main content

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

RPG Maker Cook Tool Deluxe

The one stop shop for deploying RPG Maker MV/MZ games · By AceOfAces

AdvSaveHandler: Small tweak for better Linux compatibility

A topic by Crit Chance Studios created Aug 19, 2024 Views: 74
Viewing posts 1 to 1
(1 edit) (+1)

Hello!

I am using the AdvSaveHandler plugin in conjunction with the CLI cook tool for my game Foxblade Fable, which I distribute via Itch.IO.

I primarily work on Linux, and I noticed that on Linux when launching a game from a Flatpak version of Itch.IO, rather than putting the save folder in the user's home directory Flatpak will instead redirect those paths to a temp directory (at least by default - you can manually grant home directory permissions to the Itch.IO app, but frankly I would prefer my game run out of the box without nasty surprises like losing save data)

To improve this, I ended up tweaking AdvSaveHandler myself to support the XDG base directory specification - it's an extremely simple change: instead of just using the home directory, it will instead use $XDG_DATA_HOME, or fall back to $HOME/.local/share otherwise (which the spec defines as an appropriate default for $XDG_DATA_HOME).  The change looks like this:

if (process.platform == "linux") {
    home = process.env.XDG_DATA_HOME || path.join(systeminternals.homedir(), ".local", "share");
}

Now when launching on Linux, it will either put its folder in ~/.local/share, or it will put it wherever $XDG_DATA_HOME is defined (when running under Flatpak Itch.IO for example, the save game folder is put in ~/.var/app/io.itch.itch/data)