Problem with SumRdmDde's "File Reader/Writer" system

Joined
Dec 31, 2015
Messages
82
Reaction score
26
First Language
English
Primarily Uses
RMMV
I'm trying to use SRD's File Reading/Writing system, and it works just fine in playtesting, but when I test the deployed version, the game isn't able to create the file.

Here's the code that I'm using in my game to create the file.

Code:
//Write Text File
var path = window.location.pathname.replace(/(\/www|)\/[^\/]*$/, '/data/key/');
if (path.match(/^\/([A-Z]\:)/)) {
    path = path.slice(1);
}
path = decodeURIComponent(path) + "MysticKey.wlgp";
var fs = require('fs');
fs.writeFile(path, "long_text_string_here", function(err) {
    if(err) {
        return console.log(err);
    }
});

This script is supposed to create a file in the "/data/key" folder of the game, and write some text into it.
However, while I have this running perfectly in playtesting, it doesn't work during a deployed game: no file gets created, and even if the file already exists, nothing gets written inside it.
Any suggestions? Any fixes I need to do with the code?

If you want me to provide a demo, feel free to ask, and I'll upload it when I'm able to.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,232
Reaction score
7,616
First Language
German
Primarily Uses
RMMV
1) where do you deploy to (PC or something else)?
2) have you encrypted the deployed game?
 
Joined
Dec 31, 2015
Messages
82
Reaction score
26
First Language
English
Primarily Uses
RMMV
1) where do you deploy to (PC or something else)?
2) have you encrypted the deployed game?
I'm deploying to Windows.
The game doesn't create the file in both encrypted and non-encrypted deployment.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,232
Reaction score
7,616
First Language
German
Primarily Uses
RMMV
where is the folder with the game stored when you try that? It might be a folder restriction instead of a plugin problem
 
Joined
Dec 31, 2015
Messages
82
Reaction score
26
First Language
English
Primarily Uses
RMMV
Well, I tried it in a few different folders, on the C and D disk drive, on Desktop, Documents, and other folders.
Doesn't work anywhere.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I'm really tempting to pre order cyberpunk 2077... should I do it or not :/ I really want to play the game but don't want to take a big hit to my saving because of it
So I need to come up with quite a few action sequences.
Was stressing about this plugin earlier, but pretty happy with how its looking now! Purple makes it pop more too!! :)
A friend requested me to do a pfp for his twitch channel, so far he approved one of my sketches, so going to digital now. The style he's looking for is quite different from my usual, hopefully I can get it right... :kaoback:

Forum statistics

Threads
105,484
Messages
1,014,065
Members
137,130
Latest member
LitoBooni
Top