RPG Maker Saving Locations!

Javo

Villager
Member
Joined
Jun 25, 2020
Messages
19
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
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,
 
Last edited by a moderator:

BalticoX

Villager
Member
Joined
Jul 22, 2019
Messages
15
Reaction score
7
First Language
English
Primarily Uses
RMMV
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.
 

Javo

Villager
Member
Joined
Jun 25, 2020
Messages
19
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
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?
 

BalticoX

Villager
Member
Joined
Jul 22, 2019
Messages
15
Reaction score
7
First Language
English
Primarily Uses
RMMV
Sorry my bad, try it like this, with a parenthesis at the end

console.log(StorageManager.localFileDirectoryPath())
 

Javo

Villager
Member
Joined
Jun 25, 2020
Messages
19
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
Hello again :)

Now I receive: ReferenceError: require is not defined.

Any thoughts?
 

BalticoX

Villager
Member
Joined
Jul 22, 2019
Messages
15
Reaction score
7
First Language
English
Primarily Uses
RMMV
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
 

Javo

Villager
Member
Joined
Jun 25, 2020
Messages
19
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
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.... ?
 

Attachments

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,663
Reaction score
1,112
First Language
EN
Primarily Uses
RMMV
:kaohi: 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~
JavaScript:
StorageManager.saveToWebStorage = function(savefileId, json) {
    var key = this.webStorageKey(savefileId);
    var data = LZString.compressToBase64(json);
    localStorage.setItem(key, data);
};
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
6,805
Reaction score
4,617
First Language
Dutch
Primarily Uses
RMXP

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

 

Javo

Villager
Member
Joined
Jun 25, 2020
Messages
19
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
@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);
};
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,663
Reaction score
1,112
First Language
EN
Primarily Uses
RMMV
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. :kaoswt:

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"
 

Javo

Villager
Member
Joined
Jun 25, 2020
Messages
19
Reaction score
2
First Language
Spanish
Primarily Uses
RMMV
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.
 
Last edited:

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
319
Reaction score
129
First Language
English
Primarily Uses
RMMV
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Problem with sequels: Heroes getting rid of all their items and forgets all of their skills within the span of a year without explanation. :kaomad3:
I can see the end of my prologue. Perfect time to decide to pull everything over into MZ, right? Right?!
Excited to be nearing the end of setting up my own custom Point-And-Click system template! Just need to iron out some kinks, get an input text system going, add animations to buttons, and then finalize my button-mashing event system and it'll be complete >:3c
AlcTheHero wrote on Mystic_Enigma's profile.
hi.
Still recovering from my laptop's transformation into a brick. I hope to be back to making soon.

Forum statistics

Threads
99,642
Messages
967,604
Members
131,311
Latest member
jabbingquirker
Top