Main Menu
  • Welcome to The RPG Maker Resource Kit.

[Resolved] Save Menu with Names

Started by Zethzune, December 10, 2009, 02:53:07 AM

0 Members and 1 Guest are viewing this topic.

Zethzune

The default save/load menu is useless since the only way you can tell files apart is the date the save was made. My current project allows the players to set their characters own names, so I'd like to replace "File 1" etc. with the character's name - I can't figure out how to get the characters name.

In Window_SaveFile I have:
if @file_exist
# Draw character names
player_names = CharacterName1 + " & " + CharacterName2 #how the hell do I get the name out of a save?
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 600, 32, player_names)
My strength is that of ten men, for I am wired to the eyeballs on espresso!

Falcon

for i in 0...@characters.size
player_names += @characters.name + " "
end

Try it.

shaz


player_names += @characters[i].name + " "


Falcon's line didn't come out properly because the page interpreted it as "change to italics"
Always remember you're unique.
Just like everybody else.

Zethzune

#3
That's what the Code tags are for but thanks :)

Quote from: RMXPScript 'Window_SaveFile' line 49: NoMethodError occured.
undefined method `name' for ["player", 0]:Array

I've tried a few different things by trying to mimic the way it gets a characters name elsewhere in the code with no luck. The closest I've managed so far is to get an error message with the "name" of the character - which was actually the graphic's name for that character. :l
My strength is that of ten men, for I am wired to the eyeballs on espresso!

shaz

Ah, okay, I see what you're trying to do.  @characters has the graphics name.  The following code should work, but it won't give you what you're after.


for i in 0...@characters.size
player_names += @characters[i][0] + " "
end


For what you want, you'd have to load $game_party, then iterate through $game_party.actors to get their names.

However, $game_party is way down in the list, and you might find it slow to bring up the loading screen if it has to show for several save files. 
Always remember you're unique.
Just like everybody else.