RM2k3 Screenshot patch

In Discord the idea came up to have a patch that could create screenshots using an event command and save them as 8-bit PNG so it could then be displayed as picture and manipulated. This way, custom screen transitions and other effects could be made.

With the help of ManDeJan who was able to whip up a library to do the conversion to 8-bit for me, I created the RM2k3 Screenshot Patch! (For RM2k3 v1.10+.)

How to install:
  • Copy scrot.dll into the game directory.
  • Patch RPG_RT.exe with rm2k3_screenshot_patch.ips using Lunar IPS (create a backup first!). You may have to change the file type selection from "Most common ROM files" to "All files". (Alternatively, you can just copy the RPG_RT.exe from the demo project if you don't have any other modifications already made to your RPG_RT.exe file.)
How to use:
  • In event code, add a comment starting with "!SS", followed by the filename for the screenshot picture (without .png at the end!), for example "!SS screenshot" to create "Picture\screenshot.png". When this comment is "executed", the screenshot will be created (overwriting any existing one with the same name).
  • You can then use regular "Show Picture" commands to show the screenshot in the game.

Notes:
  • To be able to select the screenshot in the picture list before it is created for the first time, you can just import some other picture using the same name, it will later be overwritten with the screenshot.
  • RM2k3 v1.12+ has an optimization which will not reload a picture from the disk if a "Show Picture" command is used with the same filename as the already-displayed picture with the same ID. That means that you would need to erase the picture first before showing it again if you are trying to update the display of a screenshot which has changed in the meantime.
Here is an example (from the included demo) how it looks after I created a screenshot and then showed it in the upper-right corner and then did the same two more times:
1621608931057.png


Download (patch & demo): https://cherryshare.at/f/VtUNYI/rm2k3_screenshot_patch.7z
A cool concept for a near-20-year-old engine, but I gotta be the one to ask:
doesn't this break the terms of service or something?
Patching executables typically breaches EULAs since it modifies the original functionality and all that, and though I don't personally care, I figured i'd at least ask in case it was an oversight.
Not in this case: https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-2003-patch-eula.42021/

When I worked on the Steam release Archeia and I also pushed for a way to make patches covered under some agreement because they had already become part of the ecosystem... And luckily we were successful and got this patch EULA.

(fun fact: I'd even say patching is part of RM2k3's DNA now because we didn't have the source anymore and all the changes I did for the official versions are in fact patches of the Japenese version 1.09a )
I remembered that "EXE" that combined with IKP generated an image "TEMPLATE.PNG" in the game folder.
But to be able to move to Panorama or Pictures folder I had to create a script with AHK, because I was creating a custom menu with map.
Which forced me to wait a few frames before teleporting the player to the map.

With this patch I was able to make the teleport instant:
Code:
!SS ..\Panorama\mainmenu_bg
Haha, right, you found a great hack. Wasn't intended but it sure works

(but it would also work to just show the picture at layer 0 on the new map.)
Sorry, I didn't quite understand what layer 0 would be.
Does it work like that?
Layer 0 -> Panorama Layer 1 -> Floor map Layer 2 -> Objects map Layer 3 -> Map Events

The intention is precisely to use the menu map as a background.
It's a bit more granular than that, you can see the possible layers in the dropdown or in the help file:

1621883651058.png


I meant to show it like this:

1621883735842.png


Then it wouldn't need the path hack. But of course the path hack works too.

Unrelated fact of note: I just realized I was inconsistent in the capitalization when I (re)designed this dialog box... the other options use title case, but the "Replace last X chars with value of variable" option does not... Oh well. It's just, I'm perfectionist enough that from this day on I'll always notice this. On the other hand, the list of imperfections in RM2k3 is already long enough, one more thing won't matter.
It was a lack of attention on my part, I had forgotten that it is possible to change the Picture layer.
I spent years without creating anything with Rm2k3.
This feature is new in the English version, probably that's why you didn't consider it. (You can check out the changelog to see what else has changed: http://tinyurl.com/rm2003cl )
That's a really cool thing, though I think there is some room for improvement in the concept. It could work way more efficient if the "!SS" note-command throws the resulting image and palette into picture #n's AuroraSheet instead of saving a blob of permanent data to harddisk each time.

※ I know, that means you'd have to use the show-picture-command on a dummy beforehand to change settings that are not available in move-picture and one screenshot can't be used multiple times, but I think that's a fair trade-off in favor of data storage health.

~炬燵あ
That is a cool idea! It could actually be done just by modifying or replacing the scrot.dll file. (I also thought about allowing variable replacements inside the filename, but this is even better.)

However we do need to allow for the same screenshot to be used multiple times, because then it can be sliced with the spritesheet function to "split" it and other stuff. We should just allow specifying multiple picture IDs, maybe like "!SS filename" or "!SS #123" or "!SS #123,456" or "!SS #100-199"...

This is the source code from ManDeJan, maybe you want to have a go at adding that function? (I assume you know how to find the pointers and such.) https://cherryshare.at/f/84Er4j/scrot.cpp (It seems lodepng's encode function can also be called with an std::vector reference so it won't write to a file but to memory...)

Original thread: https://forums.rpgmakerweb.com/threads/rm2k3-screenshot-patch.136713/