MV Saving game screenshots inside pictures folder

I've tried every single plugin I could find and even tried to make my own modification, but nothing worked

Orange Screenshots won't save into the pictures folder and generates names based on the current time.
Orange Mapshots ignores my bitmaps
Cae PicSnapshot just doesn't work
YKNR_SnapshotExporter very similar to Orange Screenshots and hard to use
MakeScreenCapture gives me errors

Are there any other plugins or scripts for that?


Hudell's seems to be the simplest one, but I have to change its path, if (!Utils.isNwjs()) return condition and image's name generator to this:
(can I legally publish his plugin here?)
Spoiler
JavaScript:
var mapName = ($gameMap._mapId).padZero(3);
    if ($.Param.useMapName) {
      mapName = $dataMapInfos[$gameMap._mapId].name + $gameVariables.value(700)
    } else {
      mapName = 'Map' + mapName;
    }
JavaScript:
/*=============================================================================
 * Orange - Screenshot Saver
 * By Hudell - www.hudell.com
 * OrangeScreenshotSaver.js
 * Version: 1.0
 * Free for commercial and non commercial use.
 *=============================================================================*/
 /*:
 * @plugindesc This plugin will automatically save screenshots in a "Screenshots" folder inside the game
 *            
 * @author Hudell
 */
var Imported = Imported || {};


var OrangeScreenshotSaver = OrangeScreenshotSaver || {};


(function($) {
  "use strict";


  $.generateFileName = function(){
    var date = new Date();
    return '' + date.getFullYear() + '_' + (date.getMonth() + 1) + '_' + date.getDate() + '_' + date.getHours() + '_' + date.getMinutes() + '_' + date.getSeconds() + '_' + date.getMilliseconds() + '_' + Math.floor(Math.random() * 5000) + '.png';
  };


  $.saveScreenshot = function(){
    if (!Utils.isNwjs()) return;


    var fs = require('fs');
    var path = './Screenshots';


    try {
      fs.mkdir(path, function(){
        var fileName = path + '/' + $.generateFileName();


        var snap = SceneManager.snap();
        var urlData = snap._canvas.toDataURL();
        var base64Data = urlData.replace(/^data:image\/png;base64,/, "");


        fs.writeFile(fileName, base64Data, 'base64', function(error){
          if (error !== undefined && error !== null) {
            console.error('An error occured while saving the screenshot', error);
          }
        });
      });
    } catch(error) {
      if (error !== undefined && error !== null) {
        console.error('An error occured while saving the screenshot:', error);
      }
    }
  };


  var oldInput_onKeyUp = Input._onKeyUp;
  Input._onKeyUp = function(event) {
    oldInput_onKeyUp.call(this, event);


    if (event.keyCode == 44) {
      $.saveScreenshot();
    }
  };
})(OrangeScreenshotSaver);


Imported["OrangeScreenshotSaver"] = true;
Hudell's seems to be the simplest one, but I have to change its path, if (!Utils.isNwjs()) return condition and image's name generator
So...what's the question? If you make those changes to the Hudell function, does it work? If not, what does it do?

I also find the premise a little odd...why would it matter to you where the player's screenshots go? Do you use them for your gameplay in some way?
Yep, sorry.
So basically I need to take a screenshot and save it inside the pictures folder so I could show it by the "Show Picture" command later. Basically, Orange Screenshots but with different paths and pictures names. It should work both in testing and deployed versions.
*BUMP
Hello again, you tried to change the line 36?
JavaScript:
var path = './Screenshots';

Like that:
JavaScript:
var path = './Pictures';
I've tried every imaginable combination. Nothing worked.
It was my mistake, I'm very used to Rpg Maker 2000.

In fact it would be like this:
JavaScript:
var path = './img/pictures/';
That's how I did it originally inspired by other screenshot-making plugins. Doesn't work. Nothing appears in my folder, unfortunately, don't know why.
The functions in NW.js seem to have been written correctly, what is your operating system, Windows?

try running the command directly:
JavaScript:
$.saveScreenshot()

If it doesn't work, when I get home I'll check what might be happening, but if I can check the console (F12 key), the error might have appeared.
I've tried both
◆Script:$.saveScreenshot()
◆Script:SceneManager.snap()

Get this error:
Code:
YEP_CoreEngine.js:2811 ReferenceError: $ is not defined
    at eval (eval at Game_Interpreter.command355 (YEP_CoreEngine.js:1857), <anonymous>:1:1)
    at Game_Interpreter.command355 (YEP_CoreEngine.js:1857)
    at Game_Interpreter.executeCommand (rpg_objects.js:8930)
    at Game_Interpreter.update (rpg_objects.js:8838)
    at Game_Map.updateInterpreter (rpg_objects.js:6115)
    at Game_Map.update (rpg_objects.js:6022)
    at Scene_Map.updateMain (rpg_scenes.js:608)
    at Scene_Map.updateMain (FilterController.js:1430)
    at Scene_Map.updateMainMultiply (rpg_scenes.js:600)
    at Scene_Map.update (rpg_scenes.js:589)

Honestly, I don't understand how script calls are supposed to work since there are no files names or paths defined.
Sorry, I was sleepy, this part is a command from within the function, it cannot be invoked directly.
Get this error:
Code:
YEP_CoreEngine.js:2811 ReferenceError: $ is not defined

I've tested this command, and it worked.
JavaScript:
OrangeScreenshotSaver.saveScreenshot()
So I think the problem is incompatible with some other plugin.

For now I can't help you anymore.

Good luck
Damn, I haven't thought of compatibility issues since I wouldn't get any errors :0
I managed to fix it. As for the name, here is the script I've figured out:
JavaScript:
$.generateFileName = function(){
    var mapName = ($gameMap._mapId).padZero(3);
    return mapName = $dataMapInfos[$gameMap._mapId].name + $gameVariables.value(700) + '.png';
  };

Thanks man, Solved!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/saving-game-screenshots-inside-pictures-folder.139877/