VXAce Save Screen Preview

Anyone understand how do I make a screenshot preview for the Save Screen? I've found a script that actually does work. I got it from Mikagami script as I remember.

galv-script.png


but, I don't like the screen look, how I want it to look like from Yarnfly-SaveEngine. I slowly tried learn step by step about creating windows, but I still don't understand how it work for creating the bitmap and to arrange the windows more neatly like this below.
CaptureBefore.PNG

This is the modified version of Yarnfly-SaveEngine that I tried

Anyone could help me with this? If you would, could you explain how your script works?
Hello, I wrote an addon to Yanfly's save engine saving the screenshot a few months ago here.

The hard part was to save the bitmap, some scripts like Hime's screenshot could have worked but were recreating the bitmap from the data instead of taking a true screenshot, meaning that additional effects like light effects could not be saved without writing compatibility scripts if I remember.
Thankfully, with Zeus's bitmap export, I could simply do something like:
Ruby:
bm = Graphics.snap_to_bitmap
bm.export("pciture.png")
I take the screenshot and save it into a bitmap whenever Scene_Map is left, and I save the bitmap if you save your game into a .png picture with the same index as the save file.

If you know a bit about scripting and are not satisfied with how it looks, you can simply modify methods draw_save_contents and draw_map_picturein my script if you use it.

Anyone understand how do I make a screenshot preview for the Save Screen? I've found a script that actually does work. I got it from Mikagami script as I remember.
Can you provide a link to the script you've found, I would be curious to see how it works.

Anyone could help me with this? If you would, could you explain how your script works?
Not sure if the script I provided above is satisfying or it's explanation, if you have more questions feel free to ask.
Can you provide a link to the script you've found, I would be curious to see how it works.
Mikagami Alter Thumbnail Save Screen Refference
https://raw.githubusercontent.com/ovate/MikagamiAtelier-rgss3/main/MA_SaveThumbnail.rb

My Modified Yarnfly-SaveEngine
https://pastebin.com/6BCE39XC

These are the script I try to learn of. What I don't understand is how to re-arrange the windows and thumbnail saving. I want to know more about it.
Mikagami Alter Thumbnail Save Screen Refference
https://raw.githubusercontent.com/ovate/MikagamiAtelier-rgss3/main/MA_SaveThumbnail.rb
Okay so the script turns the screenshot's bitmap into an array and saves the array. It makes heavier savefiles than with Zeus's script though.

These are the script I try to learn of. What I don't understand is how to re-arrange the windows and thumbnail saving. I want to know more about it.
By rearanging, what do you want exactly?

If you want to change the size and the position of the windows, check the Window_ classes in yanfly's script.

Window_FileList is the list of all files name
Window_FileStatus is the preview of your file
Window_FileAction is the list of actions to deal with a save (save/load/delete)

You can change their position and size in method intiialize for each window class:
Ruby:
class Window_FileList < Window_Selectable
    def initialize(dx, dy)
        #super(x,y,width,height)
        #where x,y are the position of the window
        #width,height are its size
        super(dx, dy, 128, Graphics.height - dy)
        #...
    end
end

If you want to change what is displayed in the preview, you have to check Window_FileStatus and more precisely its method draw_save_contents as you have already guessed.
Then you can add new methods or modify all sub methods that draw something to change how it looks.

To display the picture, you can take a screenshot with Graphics.snap_to_bitmap and save the result into a bitmap object that you will access later.
Then, if you can access it, you can write something like this:
(here is a simplier code from my own addon to Yanfly's script)
Ruby:
  #dx,dy the position of the picture, dw the width of the window
  def draw_map_picture(dx, dy, dw)
    bitmap = get_screenshot_bitmap #my own way of getting the screenshot
    return unless bitmap #to avoid eventual crashes if the bitmap does not exists
    h = NeoSave::SCREENSHOT_HEIGHT #a constant to define yourself, you can put a number
    #take a rectangle inside the screenshot picture with the first two values being the upper-left corner (it's like you cut the picture to pick what matters)
    #dw the width of the rectangle and h its height
    rect = Rect.new(0,0, dw, h)
    #now draw anything inside the bitmap that is inside the rectangle and put it in position dx,dy
    #255 here is the opacity, put a lower value if you want some transparency
    contents.blt(dx, dy, bitmap, rect, 255)
    bitmap.dispose #get rid of the bitmap to avoid memory issue if get_screenshot_bitmap gives a new one
  end

Saving the bitmap is the tricky part as it can't be done without writing your own way to save it, that's why I recommend you use another script like Zeus's to export the bitmap, otherwise you can write your own way to convert the bitmap into something that can be exported like Mikagami Alter Thumbnail Save Screen where methods bitmap_to_array and array_to_bitmapwere written for instance.
Then if you have a way to export the bitmap, you should modify method make_save_header to store the bitmap inside the hash table.


Everything I describe is basically performed one way or another in my published script or its required scripts so you can check them if you want to see how it has been done.
Thanks for your knowledge. Atleast I learned about method and windows position/size. I appreaciate your work with your NeoSave script. Looks proper and neat, also if I wonder can I use your script for learning or maybe my game in the future with some modification? I'll give you credit for your appreciation that've been help me.

Any recommendation for me to learn more about Ruby Game Script System? Maybe in a form of video, web, or e-book?

Thanks again for helping me.🙂
also if I wonder can I use your script for learning or maybe my game in the future with some modification? I'll give you credit for your appreciation that've been help me.
Of course! Feel free to modify the script as you wish, you can even share you modifications as long as you give credit, I don't mind.

Any recommendation for me to learn more about Ruby Game Script System? Maybe in a form of video, web, or e-book?
I would suggest checking the learning ruby and rgss forums and maybe Trihan's slip into ruby, otherwise I would suggest checking Archeia's script call collection to see how most event commands can be done in ruby.

Original thread: https://forums.rpgmakerweb.com/threads/save-screen-preview.179957/