hey all
I have run into a bit of an issue with writing a plugin for my game where I can't access the
$dataSystem.gameTitle in the plugin
when I do I get
I Have confirmed that using params work but when I try to use
instead of
, I get an error, what is going on here?
and how do I fix it?
I have run into a bit of an issue with writing a plugin for my game where I can't access the
$dataSystem.gameTitle in the plugin
when I do I get
Code:
Cannot read property 'gameTitle' of null
JavaScript:
soul.EX.params = PluginManager.parameters(soul.EX.pluginName);
//var gametitle = soul.EX.params["gameTitle"];
var gametitle = $dataSystem.gameTitle;
const fs = require("fs");
const util = require("util");
const os = require("os");
const home = os.homedir();
const gamefolder = home + "/games/" + gametitle;
if (fs.existsSync(gamefolder)) {
console.log("Directory exists!");
} else {
console.log("Directory not found.");
fs.mkdir(gamefolder, { recursive: true }, err => {
if (err) throw err;
if (err) console.log(err);
});
console.log("Directory Created");
}
StorageManager.fileDirectoryPath = function() {
const path = require("path");
const base = gamefolder;
return path.join(base, "save/");
};
StorageManager.filePath = function(saveName) {
const dir = this.fileDirectoryPath();
return dir + saveName + ".rmmzsave";
};
I Have confirmed that using params work but when I try to use
JavaScript:
var gametitle = $dataSystem.gameTitle;
JavaScript:
var gametitle = soul.EX.params["gameTitle"];
and how do I fix it?