Is there any way to automatically create a screenshot - not of the game but of the desktop of the pc and save it as an image file?
In my game there is at one point a fourth-wall-break when one of the characters is more or less "trying to break out" from the game. For that reason I need a screenshot of the pc desktop from this time as a jpg/png that is used in the background of the scene.
Is there any way to do that in the game, or is it only possible by running an external script?
Do you use windows?
Hold the windows button, then press PrtScrn (Print Screen)
to do what you want, requires a plugin to make this shot and saved as
parallax and call it to change the background of this parallax.
it might not work if you use tilesets as you wont see it, so what is more
behind this mechanic you want to achieve?
Well, basically my game features aside from the movement in the open world "cutscenes" that are not 100% fluently animated, but more like single frames but with full sound effects and voice acting so it feels like an anime scene.
I simply use for that the "Show Picture" command.
And in one of this scenes I want to give the impression as one of the characters is "trying to reach out" of the game. For that I need an image in the Background (via "Show Picture") that looks like the desktop of the player and place another image (that is already in the game files) above this.
So what I need is
1. That the game takes either a desktop screenshot every time the game starts and just replace the old one or just takes a desktop screenshot once when a command is run before the mentioned scene happens.
2. That it saves this screenshot automatically as an image file (jpg/png/bmp) that can be directly used with the "Show Picture" command.
I don't know if this is possible with a plugin or just a few lines of code that I can use in an event, but I hope so^^
EDIT: And yes, it shall be in a way that the player does not have to active press any button. In fact it shall be in a way that the player don't even recognize this and is a bit confused when this scene happens
That's not really a thing that's possible. You can take a screenshot of the current screen - though I don't think there exists a plugin for that, so you'd need to dedicate a fair amount of effort to coding this.
But as for taking a screenshot of something that's not currently being displayed on the screen, as far as I'm aware, that's not a thing you can do at all.
The closest thing might be grabbing the current wallpaper from %AppData%\Roaming\Microsoft\Windows\Themes and praying that it's in a format you can make use of.
Alternatively (though that really is a fair amount of effort) - make a transparent window, and within it a smaller window that looks like your game's window, so you'd be able to make some "breaking out" animation.
While taking a screenshot of the active window is something that could probably be easily done via a plugin, and taking a full capture of the full screen (assuming the game is in windowed mode) might also be possible, taking a screenshot of the windows desktop behind the game would be nearly impossible for a couple of reasons.
First, they aren't actively being drawn in video memory anywhere, if your game is fullscreen. Windows optimizes resource usage when a fullscreen game is open, and doesn't waste resources drawing anything that isn't in view. Second, even if they were in memory, RPG Maker has no way to dig through the players VRAM to find it. Third, even if you did somehow find a way to do that, most antivirus programs are going to stop that dead in its tracks because that's the sort of thing malware would do.
While it's not going to be quite as funny to the player, your best option is to make something that looks similar to a windows desktop, and pretend it's a computer, and not specifically the players.
Okay, so thats really an immense amount of effort to put in.
So I suppose the best solution would be a "fake launcher" exe-file outside of RPG-Maker that takes a screenshot and saves it - and then starts the real game.
Just thought it would be possible, because when I take a screenshot in Minecraft (Java Version) in Fullscreen via [Prt] it makes a screenshot of the desktop instead of the game. You can only make a screenshot of the game there by using the assigned in-game key bindings.
Yeah, I mean not necessarily only the desktop without anything. What I meant was just not a screenshot from the game, but from everything else.
So I think this might be a solution that it quickly minimizes, takes a screenshot and then reopens. Even if someone notices it in the blink of an eye it would not be that big of a deal. Thanks for the idea.
Minecraft's fullscreen uses "Exclusive Fullscreen" mode, which is a mode in which the application takes control of the entire display and is basically writing directly to the graphics hardware, so your operating system doesn't actually know what's being displayed. Since the Print Screen button is a function of the operating system, and the OS can't actually see what the game is doing (while it's in fullscreen), it will often display whatever was visible before the game went fullscreen.