Yanfly Save Engine question

Status
Not open for further replies.

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Find this method in the script:

#-------------------------------------------------------------------------- # draw_save_location #-------------------------------------------------------------------------- def draw_save_location(dx, dy, dw) return if @header[:map].nil? reset_font_settings change_color(system_color) draw_text(dx, dy, dw, line_height, YEA::SAVE::LOCATION) change_color(normal_color) cx = text_size(YEA::SAVE::LOCATION).width return if $data_mapinfos[@header[:map].map_id].nil? text = @header[:map].display_name text = $data_mapinfos[@header[:map].map_id].name if text == "" draw_text(dx+cx, dy, dw-cx, line_height, text) endChange this line:
Code:
    text = $data_mapinfos[@header[:map].map_id].name if text == ""
to this:
Code:
    text = @header[:map].display_name if text == ""
I have not tested this. If it doesn't work, try this instead:

Code:
    text = @header[:map].map.display_name if text == ""
If THAT doesn't work, I'll look at it more closely.
 

flyingswine

Villager
Member
Joined
Dec 8, 2013
Messages
12
Reaction score
0
First Language
U.S. English
Primarily Uses
Find this method in the script:

#-------------------------------------------------------------------------- # draw_save_location #-------------------------------------------------------------------------- def draw_save_location(dx, dy, dw) return if @header[:map].nil? reset_font_settings change_color(system_color) draw_text(dx, dy, dw, line_height, YEA::SAVE::LOCATION) change_color(normal_color) cx = text_size(YEA::SAVE::LOCATION).width return if $data_mapinfos[@header[:map].map_id].nil? text = @header[:map].display_name text = $data_mapinfos[@header[:map].map_id].name if text == "" draw_text(dx+cx, dy, dw-cx, line_height, text) endChange this line:
Code:
    text = $data_mapinfos[@header[:map].map_id].name if text == ""
to this:
Code:
    text = @header[:map].display_name if text == ""
I have not tested this. If it doesn't work, try this instead:
Code:
    text = @header[:map].map.display_name if text == ""
If THAT doesn't work, I'll look at it more closely.
Awesome, thanks!

I modified some scripts so that the display name would recognize variables. Is there a way to make this recognize variables too? A name of one of the maps is \N[001]'s house, and that's exactly how it's showing up on the save file.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
ugh! I just looked more closely, and realized you didn't really need to change ANYTHING. If the display name exists, it will use it. Otherwise it will use the map name.

So the method as it was should already give you the results you're asking for. If it's displaying the map name, it means the display name was not set on the map at the time the save file was made (even if you've gone back into the editor and given it a display name afterwards).

To add the extra you've requested, add this line before the final draw_text line:

text = convert_escape_characters(text)So your final method SHOULD look like this:

Code:
  #--------------------------------------------------------------------------  # draw_save_location  #--------------------------------------------------------------------------  def draw_save_location(dx, dy, dw)    return if @header[:map].nil?    reset_font_settings    change_color(system_color)    draw_text(dx, dy, dw, line_height, YEA::SAVE::LOCATION)    change_color(normal_color)    cx = text_size(YEA::SAVE::LOCATION).width    return if $data_mapinfos[@header[:map].map_id].nil?    text = @header[:map].display_name    text = $data_mapinfos[@header[:map].map_id].name if text == ""    text = convert_escape_characters(text)    draw_text(dx+cx, dy, dw-cx, line_height, text)  end
 
Last edited by a moderator:

flyingswine

Villager
Member
Joined
Dec 8, 2013
Messages
12
Reaction score
0
First Language
U.S. English
Primarily Uses
TRY changing this line:

draw_text(dx+cx, dy, dw-cx, line_height, text)to this:
Code:
draw_text_ex(dx+cx, dy, text)
in the same method - the line below the one you just changed, in fact.
Works like a charm. Thanks!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Can you see my comment above? I edited my post, because I led you astray both times. The final method in that previous post is what you SHOULD have.
 

Taishiro13

Villager
Member
Joined
Jul 11, 2018
Messages
5
Reaction score
0
First Language
Filipino
Primarily Uses
RMVXA
I tried installing the script to my game but it wouldn't let me save.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,829
Reaction score
5,221
First Language
Dutch
Primarily Uses
RMXP

@Taishiro13 , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.



Please make your own thread, as your question has little to do with this thread.

Closing this.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,975
Members
137,563
Latest member
cexojow
Top