Comments

Log in with itch.io to leave a comment.

Okay, so, I added it to my project and in the plugin manager. 

Created "oldsaves" folder and put a bunch of .rmmzsave files in it.

I put all three plugin commands in an event, but nothing happens. I disabled all other plugins, nothing happens, why could this be?

Thanks

So nothing at all happens? There is no selection window coming up but there isn't also an error?


That sound like RPG Maker not registering the command at all, is the plugin ON, the plugin file name hasn't been changed?

Exactly, the plugin is ON, i didn't change the name, and I disabled all the other plugins. I'm not using the latest MZ build (I'm on 1.7.0), would that be an issue?

Otherwise no idea. I'll try on a fresh project.

That's weird, version 1.7.0 shouldn't be the problem 😨

Can you send me a pic of the event and a pic of the plugin parameters?

Of course, where do I send it?

(1 edit)

You can send it to my mail ( winterdreamgamecreator@gmail.com ) or on Discord ( winthorp ) πŸ™‚

Very interesting. Does it only read or does it copy the data? I mean, can it check if switch X was on, and just tell me if so, then I can decide what to do with switch X in the new game?

Or does it find switch X is on and then automatically sets it as on in the new game?

Thanks

It copies and read, you instruct the plugin what to search and what to do with the results. Like you said, if old save had switch X on you can decide to turn new game switch Y on.


It can do it with switch, self switch, variables, heroes data and general game system informations

https://github.com/BossRpg/MVMZ-Advanced_ChangeSaveLocation/blob/main/Advanced_C...

It is best to use it with this plug-in, so that you can solve the problem of publishing games on Steam, but I have not tested whether your plug-in supports "%USERPROFILE%/Saved Games/" + $dataSystem.gameTitle + "/save/"

It doesn't as the directory is a string, not an eval, so it won't catch + and $dataSystem


But adding a "pro" option to use the evaluation could be something to add in the ToDo list! ☺️

So, without the +$dataSystem part, it should work? I actually mainly want to know if I can read "My Documents"

(1 edit)

If you mean by using environmental variables like %USERPROFILE%, no, not in v1.0
I'll work on adding the possibility!

Right now the plugin can either read a normal string path (ex: "C:\Mygame\") or he can detect his installation directory and from from there (option autodetect + data/ will result in a string heading toward the data folder of the game)

The following reference code is from a website that is not allowed to be linked by itch. You can directly refer to the code

'use strict';

/*

====================================================================================================================

 RoamingSavePath.js

 License: DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

 Usage: add this lines to your plugins.js:

{"name":"RoamingSavePath","status":true,"description":"Save directory to game save dir instead of www","parameters":{}}

====================================================================================================================

*/

(function () {

if (!StorageManager.isLocalMode() || typeof process === 'undefined' || !process.env || !process.platform) return;

const fs = require('fs');

const path = require('path');

var globalSavePath = null;

const initPlugin = function () {

const defaultDir = process.env.APPDATA ?

"%USERPROFILE%/Saved Games/" + $dataSystem.gameTitle + "/save/" :

(process.platform == "darwin" ? "%HOME%/Library/Preferences/" : "%HOME%/.local/share/");

const params = PluginManager.parameters('RoamingSavePath');

var savePath = ((params['Save Directory'] || defaultDir).trim().replace(/^[/\\\.]+|[/\\\.]+$/g, '') + path.sep).replace(/[/\\]/g, path.sep);

for (var e in process.env) {

savePath = savePath.replace('%' + e + '%', process.env[e]);

}

globalSavePath = savePath;

}

const validateDirTree = function (targetDir) {

if (fs.existsSync(targetDir)) return true;

const parts = targetDir.split(path.sep); 

var currentPath = parts[0]; 

for (var i = 1; i < parts.length; i++) { 

if (!parts[i]) continue;

currentPath +=  path.sep + parts[i]; 

if (!fs.existsSync(currentPath)) { 

try {

fs.mkdirSync(currentPath); 

} catch (e) {

return false;

}

}

}

return true;

}

const oldDMOL = DataManager.onLoad;

DataManager.onLoad = function(object) {

oldDMOL.apply(this, arguments);

if (object === $dataSystem)

initPlugin();

}

StorageManager.localFileDirectoryPath = function() {

return globalSavePath;

};

const oldSTLF = StorageManager.saveToLocalFile;

StorageManager.saveToLocalFile = function() {

//if (!fs.existsSync(globalSavePath))

//fs.mkdirSync(globalSavePath, { recursive: true }); // needs newer nwjs sometimes

if (validateDirTree(globalSavePath))

oldSTLF.apply(this, arguments);

}

})();

I like this. I don't think there's ever been a system made that does this, for any other iteration of RM, not even VX Ace.

Yes, searching for this option leads to a lot of questions and a very few answers, guess this will be a useful one 😁