RPG Maker Saving Locations!

Mod note: Continuation of this thread.

Greetings (I hope this is not considered necroposting, if so, please tell me for opening a new thread):

I've tried the suggestion of BalticoX of using: StorageManager.localFileDirectoryPath but I recieve the following responce:
Code:
function () {
var path = require ('path');
var base = path.dirname (process.mainmodule.filename)
return path.join(base, 'save/')
}

Any ideas?
Thanks for letting me get into the discussion.
Regards,
Javo what is your issue?
I suggested obtaining the save location by doing this in the debug console

console.log(StorageManager.localFileDirectoryPath)

That will give you the save location of the files. But I am not sure what your issue is. If is something different than Symbol_, then please open new thread.
Greetings BalticoX:

I believe we are in the same frequency here. I tried your code (now including the "console.log", which was my omission), and now I receive a message. Unfortunately it is (textually): undefined.

Any thoughts about this?
Sorry my bad, try it like this, with a parenthesis at the end

console.log(StorageManager.localFileDirectoryPath())
Hello again 🙂

Now I receive: ReferenceError: require is not defined.

Any thoughts?
I created a new project, playtest it, click F8 to open developer console.
Type in these commands, those are the values I see.

console.log(StorageManager.localFileDirectoryPath())
C:\Users\andre\Documents\Games\Seven Gaijin\save\
undefined


console.log(StorageManager.localFileExists())
true
undefined

If you don't see those values in a new project your base code may have changes from original version.

1593574273692.png
I've donde the test; so, even in a new project I keep receiving the same error message: ReferenceError: require is not defined.

If you don't see those values in a new project your base code may have changes from original version.

So, what do you mean by this? that my RPG Maker is corrupted and I need to reinstall or.... ?
👋 When playing via the editor (test-play) or a local deployment (e.g. Windows/Mac/Linux) the resultant app, a customised browser, is run client-side and can access the local file system without problems. Local deployments are Node-based, which means they have the require method built-in. However...
I've donde the test; so, even in a new project I keep receiving the same error message: ReferenceError: require is not defined.
You are playing the game via your browser. Web-based deployments work differently and use an alternative save location: the browser's local storage. This is because a browser typically cannot access the local file system for security reasons. Technical details can be found here~
Spoiler: Relevant snippet (rpg_managers.js)
JavaScript:
StorageManager.saveToWebStorage = function(savefileId, json) {
    var key = this.webStorageKey(savefileId);
    var data = LZString.compressToBase64(json);
    localStorage.setItem(key, data);
};

@Javo Yes, that's considered necroposting. I've moved all relevant posts to a new thread to maintain overview of your issue.

@slimmmeiske2 thanks for the info and work: I'll do my best for not stimulating this.

You are playing the game via your browser. Web-based deployments work differently and use an alternative save location: the browser's local storage. This is because a browser typically cannot access the local file system for security reasons.

@caethyril You are totally right; I've deployed my game to Windows and saved, and how I've found a savepath at: D:\My Documents\Output\ProjectName\www\save .

My concern would be that the console.log(StorageManager.localFileDirectoryPath()) command still gives the message: undefined... don't know what's going on; your help gave a good answer, thou.

Thanks to all for your gentle effort and help 🙂

p.s.: will keep this at hand 😉 , thanks...
Code:
JavaScript:
StorageManager.saveToWebStorage = function(savefileId, json) {
    var key = this.webStorageKey(savefileId);
    var data = LZString.compressToBase64(json);
    localStorage.setItem(key, data);
};
My concern would be that the console.log(StorageManager.localFileDirectoryPath()) command still gives the message: undefined... don't know what's going on
Well, if it's saving to the correct location then either that method is producing the correct output or you're using a plugin or something to change the default game save behaviour. 😅

For the undefined thing...I'm guessing you're seeing something like this in the console:
Code:
console.log(StorageManager.localFileDirectoryPath());
"D:\My Documents\Output\ProjectName\www\save"
undefined
In this case, the undefined bit is simply the return value of console.log. If you're doing this all in the console anyway and just want to test a method's return value, you don't need the console.log part, e.g.
Code:
StorageManager.localFileDirectoryPath();
"D:\My Documents\Output\ProjectName\www\save"
Hello again caethyril 🙂

either that method is producing the correct output or you're using a plugin or something to change the default game save behaviour.

I'm not using any plugin at all (besides the one's default at RMMV). I did the test at a new project, and the result is the same... so, if we go for "the method is producing the correct output", and it is undefined, I guess that your web browser's technical suggestion:
This is because a browser typically cannot access the local file system for security reasons.

..would be the final explanation, isn't it? It still leaves in obscurity which is the storage location the browser uses (Firefox in my case, as the other ones I tried, they just refuse to save... now we know the reasons)...

Btw...
For the undefined thing...I'm guessing you're seeing something like this in the console:

Code:
console.log(StorageManager.localFileDirectoryPath());
"D:\My Documents\Output\ProjectName\www\save"
undefined

I only get that result in a deployed game.
It still leaves in obscurity which is the storage location the browser use
It saves to what is called "browser local storage", which is similar to a "cookie" but has room for much larger amounts of data. The physical location of the save on disk would depend on the browser - wherever your browser saves website local storage, basically. In the case of Firefox, that would be somewhere in the user profile folder.

Original thread: https://forums.rpgmakerweb.com/threads/rpg-maker-saving-locations.123494/