RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Resolved] Save Menu with Names

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 90
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:
Code: [Select]
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)
« Last Edit: December 31, 2009, 04:24:20 AM by Zethzune »
My strength is that of ten men, for I am wired to the eyeballs on espresso!

******
Revolution is not a bed of roses.
Rep:
Level 91
Project of the Month winner for July 2009
for i in 0...@characters.size
player_names += @characters.name + " "
end

Try it.

*
Rep:
Level 87
Code: [Select]
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.

**
Rep: +0/-0Level 90
That's what the Code tags are for but thanks :)

Quote from: RMXP
Script '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
« Last Edit: December 10, 2009, 05:53:37 PM by Zethzune »
My strength is that of ten men, for I am wired to the eyeballs on espresso!

*
Rep:
Level 87
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.

Code: [Select]
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.