[SOLVED]Screenshot plugin that includes the mapID & mapName in its output.

Hi, I would like to request a plugin that can take in-game screenshots. Specifically, I want the file name of the PNGs/JPGs to include the current map where the player is at.

I will be using this mostly as a reporting system for testers/people who find typos in our game (currently in development). They simply need to take screenshots of whichever dialogues that contain typos (or visual evidence of a glitch of bug), then send me the files so I can apply fixes.

I am currently using Triacontane's MakeScreenCapture.js plugin(Japanese plugin). It performs the basic functions that I need for a simple in game screenshots. However, it does not include a way to show player map location in the output filename when outputting a PNG or JPEG file.

It would really be helpful to be able find which map those dialoges with typos (or bugs) happen. so if anyone could modify that plugin to have it include mapID with name in the filename, much appreciated.

Make Screen Capture by トリアコンタン
Here you go. If you encounter any issues just message me.

Code:
//=============================================================================
// MSC Map Name
// MRP_MSCMapName.js
// By Magnus0808 || Magnus Rubin Peterson
//=============================================================================
/*:
 * @plugindesc Extension to MakeScreenCapture.
 * @author Magnus0808
 *
 * @help Put this after MakeScreenCapture. This plugin ignores the filename
 * parameter of MakeScreenCapture and instead uses the ID and name of the current Map.
*/

(function(){
    var paramFileFormat = PluginManager.parameters('MakeScreenCapture')['FileFormat'];
    var paramTimeStamp = (String(PluginManager.parameters('MakeScreenCapture')['TimeStamp']) == 'true');
    var paramNumberDigit = Number(PluginManager.parameters('MakeScreenCapture')['NumberDigit']);
    
    SceneManager.takeCapture = function(format) {
        if (!format) {
            format = paramFileFormat;
        }
        this.makeCapture();
        this.saveCapture($dataMapInfos[$gameMap.mapId()].name + "_ID" + $gameMap.mapId(), format);
    };
    
    StorageManager.getLocalImgFileName = function(fileName) {
        if (paramTimeStamp) {
            var date = new Date();
            return fileName + '_' + date.getFullYear() + (date.getMonth() + 1).padZero(2) + date.getDate().padZero(2) +
                '_' + date.getHours().padZero(2) + date.getMinutes().padZero(2) + date.getSeconds().padZero(2);
        } else {
            var number = SceneManager.captureNumber;
            if (number >= Math.pow(10, paramNumberDigit)) number = 0;
            SceneManager.captureNumber = number + 1;
            return fileName + "_" + (number > 0 ? number.padZero(paramNumberDigit) : '');
        }
    };
})();
Yay it works! thanks again dude!
Just one slight aesthetic improvement that I would like to request,
Regarding the output filename, is it possible to add an underscore between the map id and the number digit? it kind of hard to tell the order of the file without spaces. Other than that, it works perfectly.

Edit: this happens when taking multiple screenshots in the same map.

here are some screenshots, I hope they might help.

ex.
Test Map_ID3----> (this is OK)
Test Map_ID301 ----> Test Map_ID3_01
Test Map_ID302 ----> Test Map_ID3_02

★Downtown Area 2★_ID100----> (this is OK)
★Downtown Area 2★_ID10001----> ★Downtown Area 2★_ID100_01
★Downtown Area 2★_ID10002----> ★Downtown Area 2★_ID100_01
★Downtown Area 2★_ID10003----> ★Downtown Area 2★_ID100_01
★Downtown Area 2★_ID10004----> ★Downtown Area 2★_ID100_01

Edit: sorry for my bad english btw.
Edit: Wait i've figured it out.

I modified LINE 21 in your code to this, I hope you don't mind:
this.saveCapture($dataMapInfos[$gameMap.mapId()].name + "_ID" + $gameMap.mapId() + "_", format);

now it adds an _ to the output filename.

Thanks again!

Edit: marking this topic as SOLVED.
When I tested it originally I had timestamp on, so I did not encounter the issue. I have made a fix for it now.
The fix you made yourself obviously works, however if you decided to use timestamps instead you would have double "_".
Anyway I updated my original reply if you want the other fix. 🙂
Ahh, I see it makes sense since I didn't have timestamp enabled when I tried it. And yes it was double underscore lol. Now using your updated js, all is well.

And thanks again! now it'll be less of a hassle when I need to correct typos and bugs when finding out which maps they are.

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.

Opened at OP's request.

here is an update to this plugin requested by me:
-At gamestart, no longer crashes on pressing screenshot button at title screen.
-makes a Scene_(name) if taking screenshots of the item, status, option, main menu, etc.

All credit goes to Magnus0808.
here is another update to this plugin requested by me:
-This plugin now enables Triacontane's MakeScreenCapture plugin to save screenshots with deployed games.
previously, Triacontane's plugin can only take screenshots during playtest but now MRP_MSCMapName.js can now enable it to take screenshots with deployed games.

So if you want to allow users to take screenshots of your deployed games (in my case for playtesting, bug, and typo reports related purpose.) you need to put this plugin below Triacontane's.

All credit goes to Magnus0808.

Edit: also, this is unofficial but I tried to google translate Triacontane's plugin in english.
Update: can now include screenshots of the black screen fatal error, still including the map ID of where it occurred.

All credit goes to Magnus0808.
Does the MakeScreenCapture plugin not print the entire map?
Does the MakeScreenCapture plugin not print the entire map?

It's just a classic screenshot of the current game screen, not the entire map. The save function directly in the editor is used for the map.

darklugia1997, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


If you have an issue, please start a new thread.

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/solved-screenshot-plugin-that-includes-the-mapid-mapname-in-its-output.105882/