Take Screenshot For Background

Eilwyn

Veteran
Veteran
Joined
Mar 13, 2012
Messages
185
Reaction score
35
First Language
English
Primarily Uses
RMMV
Hi All,

For my game, I'm making a custom menu made with events. To accomplish this, when the player presses the ESC button, the game will gather their MAPID and coordinates then transfer them to another map but without a fade effect... this map will be the menu.

I want it to appear as if the player is not actually changing maps. To achieve this, I'm in need of a plugin.

The plugin I'm requesting will do the following:

1. When the player presses the ESC button, the game will take a screenshot of what the player currently sees and will take it before the transfer.

2. When the player transfers to the other map, the Parallax Background displays the screenshot.

3. The screenshot image should still go into the Parallax folder and the name of the background should have an [!] before it so it doesn't move or shift as the character moves my cursor... IE: "!MenuBG.png"

I made a few mock images to display what I want:





1. This is what the player should see before pressing ESC
2. This is the map that the player transfers to after pressing ESC (The White background is a parallax bg)
3. This is what the player should see after transferring to the other map. (Keep in mind again that this background should always match what the character sees before pressing ESC)

Thanks in advance for help.
 

Attachments

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
Which devices is your game intended for?
It's a very important question, because on android/iOS it might not be possible.
 

Eilwyn

Veteran
Veteran
Joined
Mar 13, 2012
Messages
185
Reaction score
35
First Language
English
Primarily Uses
RMMV
Just for the computer. I'm developing on Windows if that also matters.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
Here's the plugin:

https://github.com/Poryg1/RPG-maker-MV-small-plugins

It's called POR_SnapPlugin.js
Instructions on how to use it are rather simple:
Screenshot_2.png
The loop is necessary, because it runs asynchronously, and the wait is necessary, because without it it takes much longer to finish the snap.
Just instead of the done text you'll have your transfer command.
Once I have more time, I'll figure out how to create encrypted files and send the update, because without that it would crash the game in case you encrypt it.
 
Last edited:

Eilwyn

Veteran
Veteran
Joined
Mar 13, 2012
Messages
185
Reaction score
35
First Language
English
Primarily Uses
RMMV
Here's the plugin:

https://github.com/Poryg1/RPG-maker-MV-small-plugins

It's called POR_SnapPlugin.js
Instructions on how to use it are rather simple:
View attachment 106677
The loop is necessary, because it runs asynchronously, and the wait is necessary, because without it it takes much longer to finish the snap.
Just instead of the done text you'll have your transfer command.
Once I have more time, I'll figure out how to create encrypted files and send the update, because without that it would crash the game in case you encrypt it.
Hi,

Thanks! I was asleep when you send the reply and just got up, I'm testing it right now and I'll let you know how it works out for me as soon as I test it.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
It should work with no issues, since it doesn't conflict any plugins. I've tested it on both Canvas and WebGL mode, version 1.6.1, PIXI 4.5.4.
 

Eilwyn

Veteran
Veteran
Joined
Mar 13, 2012
Messages
185
Reaction score
35
First Language
English
Primarily Uses
RMMV
It's working fine. I had a bit of a hiccup, but that turned out to be user error on my part. (I accidentally capitalized it and wrote POR_Snap instead of POR_snap).

There is some lag though, but I wouldn't be surprised if that was more to do with my end than the plugin.

Thank you! Much appreciated!
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
Some lag is always to be expected, because snapshots are resource heavy. However, I'll try my best to optimize it and perform some more studies, because coincidentally I've been trying to solve the issue of how to take snapshots using MV for a long time. I've found how to make it a synchronous operation for WebGL, which would greatly simplify eventing, because we'd get rid of that horrendous for loop, but still need to figure it out for Canvas mode. If I figure it out, I'll post an update to this thread.

EDIT: Updated. The website now contains a version that is fully synchronous and as such gets rid of the ugly for loop. The only thing you need now is the plugin command. Hopefully it is faster.
I would still recommend you to back up the async version just in case it's actually slower.
 
Last edited:

Eilwyn

Veteran
Veteran
Joined
Mar 13, 2012
Messages
185
Reaction score
35
First Language
English
Primarily Uses
RMMV
Hi,

I finally got around to being able to test the updated version of the plugin and there is a problem.

The plugin only takes the screenshot the first time I enter the menu, but if I exit the menu, walk my character a bit then enter the menu again, it displays the screenshot from earlier, before I moved my character.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
Interesting. It works on my end with no issues.
How do you have your transition to menu programmed? (the part with the snapshot command and a bit of code above it if you have, preferably screenshot).
 

Eilwyn

Veteran
Veteran
Joined
Mar 13, 2012
Messages
185
Reaction score
35
First Language
English
Primarily Uses
RMMV

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
I see nothing wrong with the event.
If you perform two transitions and check the project directory afterwards, is the parallax updated?
 

Eilwyn

Veteran
Veteran
Joined
Mar 13, 2012
Messages
185
Reaction score
35
First Language
English
Primarily Uses
RMMV
Yes, it appears it does update in the directory.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
I found the culprit.
The cache will always load up the same image regardless of how many times it changes.
The reason why is simple. By default the browser keeps it in its own cache and eventually discards it after a while if enough files get loaded (their cache is several hundreds of MB though nowadays, so it would take a while). And MV doesn't force the image to be loaded from the hard drive.
So I've edited the plugin. It now forces the image to be reloaded everytime it's saved, just to overwrite the entry inside browser cache if there's any. You don't need to worry about the game being slowed down, it runs asynchronously, so it won't slow down your game, and if the player wants to reenter the menu, it's already in the browser cache and MV will pull it out of there.
The updated version can be found on github once again.
 
Last edited:

Eilwyn

Veteran
Veteran
Joined
Mar 13, 2012
Messages
185
Reaction score
35
First Language
English
Primarily Uses
RMMV
It works properly now, thank you! ..and sorry again that some of my replies took a while.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
People have their own lifes and answer only when they can, it's natural that you can't answer 24/7. So no need to apoogize for that. It took me some time to construct the solution as well. :D
 

Flottos

Villager
Member
Joined
Aug 5, 2019
Messages
21
Reaction score
6
First Language
English
Primarily Uses
RMMV
People have their own lifes and answer only when they can, it's natural that you can't answer 24/7. So no need to apoogize for that. It took me some time to construct the solution as well. :D
Hi Poryg, quick question about this plugin. I've been getting an error that says it cannot find the file since it is try to find or rewrite the file to the nwjs-win folder for some reason:
1590327733225.png
The location for the !MenuBG.png file should be in D:\Projects\RPG Maker Projects\RPGMV\GAMENAME\img\parallaxes\!MenuBG.png. How do I tell the plugin to not go to "nwjs-win" folder?
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
What version of rpg maker do you have? @Flottos
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,640
First Language
Czech
Primarily Uses
RMMV
Can you press f8 and take the screenshot of the console logs?

EDIT: Nevermind, I think I know why is that. Version 1.5.1 has an old version of nwjs, it works differently than the new one.
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,456
Members
137,821
Latest member
Capterson
Top