Module to retrieve Saved Games directory on Windows

grant

Member
CX Code Contributor
3rd Party Module Dev
Joined
Nov 19, 2019
Messages
70
This module has a function called getSavedGamesPath() that returns the "Saved Games" folder that is typically located inside the users home directory on Windows. The Saved Games folder was added in Windows Vista and is supposed to be where game save files are placed. The user can move the directory and it my be named different in different languages. My Windows XP computer recently broke, and I haven't fixed it yet, so I haven't done anything to make sure it doesn't crash on Windows XP and older. I haven't even tested Cerberus X on Windows XP either. I love old computers, so I'll probably try to fix it again.

The function will return Null if the directory isn't found.

Demo: The included demo.cxs demonstrates the function and saves a file inside the directory.

Install: extract the zip file inside the modules_ext folder inside your Cerberus X installation folder.

License: zlib/libpng (see included license.txt)
 

Attachments

  • SavedGamesDir-module-V1.0-for-Cerberus-X-for-Windows.zip
    2.1 KB · Views: 2

SLotman

Active member
3rd Party Module Dev
Joined
Jul 3, 2017
Messages
173
You can just do
Code:
GetEnv("USERPROFILE") + "\Saved Games\"
and it will work.

The "Saved Games" part works as an alias. Try on Windows Explorer and type on the URL %USERPROFILE%\Saved Games\ and you'll see ;)
(Here it shows c:\users\SLotman\Saved Games which is immediately converted to c:\usuarios\SLotman\Jogos Salvos <--- pt-br)

PS: I don't think that is actually used by any game. My folder is completely empty :p

What I see being used is %USERPROFILE%\AppData\LocalLow\COMPANY_NAME\GAME_NAME or
%USERPROFILE%\Documents\COMPANY_NAME\GAME_NAME

But that will work only for current user. If you want to have a highscore table for all users in the same machine, then you have to use another folder:

%ALLUSERSPROFILE%\COMPANY_NAME\GAME_NAME
(This one is what I used on Mahjong Max, that was distributed by several publishers... and it STILL works)
 
Last edited:
Top Bottom