TSR_Save by The Northern Frog, customize the Save and Load screen

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
243
First Language
French
Primarily Uses
RMMV
Hello, default engine is looking for 144x144px image (index 0) on a 576 x 288 sprite sheet, anything out of that frame is cut off. If you do need to use a face image of different dimension, it will require some script editing, but I need to know the dimension of the sprite sheet (if you using one) and the dimension of one frame.
 

chiithecat

Veteran
Veteran
Joined
Sep 14, 2019
Messages
59
Reaction score
25
First Language
Korean
Primarily Uses
RMMV
@ShadowDragon
Well I'm not going to make the text appear by a plug-in.
I'm just showing it as an image in the face part.
So.. what I'm asking is whether I can make the slot wider to take most of the areas horizontally except where there is playtime.
I think wide face images are cut when shown, and where I put the text is cut and only the face is showing in the picture I posted.

I drew an image to show you.
캡처3.PNG

캡처4.PNG

@TSR I just saw your reply. I wish the left slot would be around 417*149 pixels.
Is it possible?
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
243
First Language
French
Primarily Uses
RMMV
Hello!
Anything is possible :cutesmile:

What I need to know is do you use sprite sheet for your face images, or you're using separate images?
Default face sheet are 576x288 which provides 8 indexed face images of 144x144. Are your 417x149 images are arranged in a bigger sprite sheet or it is just a single image?
 

chiithecat

Veteran
Veteran
Joined
Sep 14, 2019
Messages
59
Reaction score
25
First Language
Korean
Primarily Uses
RMMV
@TSR Hello! Either is okay, but a single image would be easier to put in. :)
Oh and did you say it's possible to change the playtime font size?
417×149 will fit if I reduce the playtime font size to 24.
If can't, then it should be smaller.
Thanks again for your help! :)
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
243
First Language
French
Primarily Uses
RMMV
Hello @chiithecat
The font size is hard coded to adjust to the file window dimension settings. There's 2 way you can change it:

1) add line break in the general section, if the section contains more than 4 lines, the font size will start to reduce so everyhting fits in. Add 4 or more lines to reduce the font size to your liking, than use the X, Y params to adjust the text position.

Capture d’écran, le 2020-10-30 à 10.56.00.png
If you prefer to edit the script, find the drawLine function and make the following changes:
Code:
Window_SavefileList.prototype.drawLine = function(text, x, y, maxWidth, align) {
    if (TSR.Save.general_dimer) {
      this.drawRect(x - this.pad(), y, maxWidth, this.lineHeight(), 0, 1);
    }
    this._cacheFontSize = this.contents.fontSize;  //store actual font size
    this.contents.fontSize = 12       //set new font size
    this.contents.drawText(text, x, y, maxWidth - this.pad() * 2, this.lineHeight(), align);
    this.contents.fontSize = this._cacheFontSize  //restore previous font size so the change won't affect other sections
    this.resetTextColor();
};
About the face images, since you prefer to use single images, here's the drawFace function:
Code:
Window_SavefileList.prototype.drawPartyFaces = function(info, x, y, quarter, height) {
    if (info.faces) {
        let maxHeight = (TSR.Save.status_gauge)? height * 0.40 : height * 0.9;
        let dh = Math.min(quarter, maxHeight);
        let dw = dh;
        for (let i = 0; i < info.faces.length; i++) {
          let filename = info.faces[i][0];
          let faceIndex = info.faces[i][1];
          let bitmap = ImageManager.loadFace(filename);
          let pw = Window_Base._faceWidth;
          let ph = Window_Base._faceHeight;
          let dx = x + (quarter - dw) / 2;
          let dy = y - dh;
          let sx = faceIndex % 4 * pw;
          let sy = Math.floor(faceIndex / 4) * ph;
          this.contents.blt(bitmap, sx, sy, pw, ph, dx + i * quarter, dy, dw, dh);
        }
    }
};
Set the filename to your face image file name without extension, and change Window_Base._faceWidth/Height to you images dimension (417 width and 149 height, I think...). Since you're not using indexed images, the sx and sy must be equal to 0.

You might have to adjust the x offset of status and general section again, after that, but it should do what you want ;)
 

chiithecat

Veteran
Veteran
Joined
Sep 14, 2019
Messages
59
Reaction score
25
First Language
Korean
Primarily Uses
RMMV
I think I'm getting there!

So I changed the code like this:

Code:
Window_SavefileList.prototype.drawPartyFaces = function(info, x, y, quarter, height) {
    if (info.faces) {
        let maxHeight = (TSR.Save.status_gauge)? height * 0.40 : height * 0.9;
        let dh = Math.min(quarter, maxHeight);
        let dw = dh;
        for (let i = 0; i < info.faces.length; i++) {
          let filename = info.faces[i][0];
          let faceIndex = info.faces[i][1];
          let bitmap = ImageManager.loadFace(filename);
          let pw = 193;
          let ph = 111;
          let dx = x + (quarter - dw) / 2;
          let dy = y - dh;
          let sx = 0;
          let sy = 0;
          this.contents.blt(bitmap, sx, sy, pw, ph, dx + i * quarter, dy, dw, dh);
        }
    }
};
(I put different numbers for Window_Base._faceWidth/Height for that I'm testing with another image.)

And I don't understand this part: "Set the filename to your face image file name without extension."
Should I change the 7th line " let filename = info.faces[0];" to something else?
I saved my face file with names like 'me_save1', 'me_save2', ... so I tried putting 'info.me_save[0]', info.me_save', 'me_save', ... but they didn't work.
Can you be a little more specific? (Sorry that you're probably already being specific..)
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
243
First Language
French
Primarily Uses
RMMV
Hello, I meant replacing the value assign to filename by your image file name:
Code:
Window_SavefileList.prototype.drawPartyFaces = function(info, x, y, quarter, height) {
    if (info.faces) {
        let maxHeight = (TSR.Save.status_gauge)? height * 0.40 : height * 0.9;
        let dh = Math.min(quarter, maxHeight);
        let dw = dh;
        for (let i = 0; i < info.faces.length; i++) {
          let filename = 'me_save1';
          let bitmap = ImageManager.loadFace(filename);
          let pw = 193;
          let ph = 111;
          let dx = x + (quarter - dw) / 2;
          let dy = y - dh;
          let sx = 0;
          let sy = 0;
          this.contents.blt(bitmap, sx, sy, pw, ph, dx + i * quarter, dy, dw, dh);
        }
    }
};
 

chiithecat

Veteran
Veteran
Joined
Sep 14, 2019
Messages
59
Reaction score
25
First Language
Korean
Primarily Uses
RMMV
@TSR Hello again!
If I set the filename to 'me_save1', then is it possible for me to change the image through gameplay??
As I mentioned, I'm planning to change the face image from 'me_save1' to 'me_save2', 'me_save3', ...
I was going to change the face image to another according to the progress every time the player saves.
So instead of putting the file name directly in the plug-in, can I make the plug-in to show the current actor face that is not 144×144?
 
Last edited:

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
243
First Language
French
Primarily Uses
RMMV
Ok then, arrange all your face/text images in a single sprite sheet (any number of rows, but 4 images by row).
Example: if you're using 12 images of 193x111px, arrange them on a 772x333px sheet.

Then you set the drawFace function back to the original script, but with your images dimension:
Code:
Window_SavefileList.prototype.drawPartyFaces = function(info, x, y, quarter, height) {
    if (info.faces) {
        let maxHeight = (TSR.Save.status_gauge)? height * 0.40 : height * 0.9;
        let dh = Math.min(quarter, maxHeight);
        let dw = dh;
        for (let i = 0; i < info.faces.length; i++) {
          let filename = info.faces[i][0];
          let faceIndex = info.faces[i][1];
          let bitmap = ImageManager.loadFace(filename);
          let pw = 193;
          let ph = 111;
          let dx = x + (quarter - dw) / 2;
          let dy = y - dh;
          let sx = faceIndex % 4 * pw;
          let sy = Math.floor(faceIndex / 4) * ph;
          this.contents.blt(bitmap, sx, sy, pw, ph, dx + i * quarter, dy, dw, dh);
        }
    }
};
Set the first image (index 0) in your actor database, and use the following scriptcall to change the index ingame:
Code:
$gameActors.actor(1).setFaceImage(filename, index);
filename = your sprite sheet file name
index = the index on the sprite sheet
 

chiithecat

Veteran
Veteran
Joined
Sep 14, 2019
Messages
59
Reaction score
25
First Language
Korean
Primarily Uses
RMMV
I made the face image in 772×222 px sheet (they're for test so I just made them distinguishable),
set the first image of the face file in my actor database,
changed the plug-in code into yours,
and wrote a scriptcall to change the index ingame right before saving.

So if this should work, newly saved files should have the face with black scribbles, right? (index=1)
and I got this...

캡처5.PNG

The face images are fixed to index=0.
I tried this again changing the index number to 1 in the ingame scriptcall.
WHAT AM I DOING WRONG :(

I'm starting to get really sorry for all your time and effort,,
Should I be using another way?
 

Attachments

Last edited:

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
243
First Language
French
Primarily Uses
RMMV
Hello again, file name should be writed between quotes. According to the database screen shot you provided above, you should write it like:
Code:
$gameActors.actor(1).setFaceImage('me_save', 1)
 

chiithecat

Veteran
Veteran
Joined
Sep 14, 2019
Messages
59
Reaction score
25
First Language
Korean
Primarily Uses
RMMV
Hello! Sorry for that.. it was one of the basics...
Now I got the scribbled face!
But the size isn't adjusted..
It seems like whatever face I try to show, the plugin makes it smaller to squeeze in.
One last help for this? :)
 

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
243
First Language
French
Primarily Uses
RMMV
The plugin is meant to adjust automatically the file window content to the slot dimension.

Try to play with the variables dx, dy, dw and dh in the drawPartyFaces function. They are respectively the x position, y position, width and height of the frame in which the face images will be printed. You might need a couples trials and errors to get it right.
Start by replacing the width and height values by your image dimension (dw = 193 and dh = 111), then keep playing with the values until it looks the way you want.
Good luck! :cutesmile: :rock-right:
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,882
Reaction score
1,020
First Language
Dutch
Primarily Uses
RMMV
@chiithecat as a reminder, the facesets (4 x 2) are readed from index 0 so you have a visible face like:

0, 1, 2, 3
4, 5, 6, 7

which has 8 faces, even if you use 1 face on index 0, you need 0 instead of 1.

but I still dont know why you use text on the face image, instead doing this seperatly.
if you really want text on it, place the text directly on the slot background, not on the face.

if you can see my savescene image, Name, SaveDate (mentioned before) are on those,
the rest are text drawn by the plugin itself (just matching colors).

that way, it will fit better than text on face image.

if you want the save scene with some text visible (that doesn't change), make a screenshot
how YOU want it look as final result, TSR or me can fix that faster that keep giving you instructions :)

this way, it will be fasterr fix and solution for you ^^ (but you can study the params) and or
code to learn from (which I also do and still do).
 

chiithecat

Veteran
Veteran
Joined
Sep 14, 2019
Messages
59
Reaction score
25
First Language
Korean
Primarily Uses
RMMV
I did it!!!!!!!!!!! Thanks a lot!!!! :D
Last last question.. can I use this scene as a load scene too?
I guess it was possible from the start because there was the command window with both 'save' and 'load'..?
But every time, even when I had the command window, I couldn't get the right scene from the title screen.
Now the save scene looks fantastic, but the load scene is a mess with all the images and texts in wrong places.
 
Last edited:

TSR

The Northern Frog
Veteran
Joined
Nov 14, 2019
Messages
279
Reaction score
243
First Language
French
Primarily Uses
RMMV
lol, of course it can be used as 'load' scene. The plugin works fine both ways, it is basically the same scene and run the same windows script. I don't even know how one scene could be messed up and not the other one... :unsure:
 

chiithecat

Veteran
Veteran
Joined
Sep 14, 2019
Messages
59
Reaction score
25
First Language
Korean
Primarily Uses
RMMV
Me either.. But anyways it was such a great help!
The save scene is just as I wanted.
Apart from that, I learned a lot from you and had so much fun looking into this plug-in.
Thank you so much! :D
I'll send you the game when it's done.
 

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

Latest Threads

Latest Profile Posts

My dynamic weather system grows... now with cloud cover influenced by wind speed! (4x playback) (Not final cloud image/map)
Wrote a plugin today that allows you to assign BGM, Battlebacks, and even Battle Entry SE's on a per-troop basis. Introducing a random encounter with a high-pitched Chicken Squeal is worth it all by itself.
Stream will be live shortly with some game development! Feel free to drop by!
Asphodelethe wrote on skybluehair's profile.
Hi! I loe your desert NPCs for adding some variety. I've used them in a free game (The Snow Elf on Itch.io) and I'd love to use them in the new game I'm working on, which I hope to release commercially. I'd love your permission if I could have it!


So I figured out how to put words and pictures in the screen transition. It even wipes away from both the top and bottom. The possibilities are endless! :LZSexcite: I'm going to devise secret messages now for them because I'm a terrible wonderful person like that. :kaopride:

Forum statistics

Threads
105,763
Messages
1,016,242
Members
137,450
Latest member
patriciabrown
Top