Hello, I was hoping if someone can help me with something. I'm trying to make it so that when the player starts a new game, a Name Input Processing event runs that lets players rename a blank Actor slate. This blank actor's new name then becomes their unique username throughout the whole game and their save file.
I'm using the
Chaos Project Save Layout and I'm trying to modify it so that it will also display the username in the existing files. So far I've tried two variations of the modification, each with their own problems.
1.
UserName = true # Enable user names
if CPSL::UserName
y = CPSL::UserName ? 0 : 14
user = $game_actors[9]
draw_user_name(user, 256, y, 82, 1)
end
def draw_user_name(user, x, y, width=120, align=0)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, width, 32, user.name, align)
end
The problem with the first is that it will only display the username you created for all the save files, even the ones that are supposed to have a different username for it. The second problem is that the game crashes when I try to call the load scene. It says that NoMethodError occurred for the lines 'user= $game_actors[9]' and that there's an 'undefined method '[]' for nil:NilClass'.
2
UserName = true # Enable user names
if CPSL::UserName
y = CPSL::UserName ? 0 : 14
$actor_names = load_data('Data/Actors.rxdata')
user = $actors_names[9]
draw_user_name(user, 256, y, 82, 1)
end
def draw_user_name(user, x, y, width=120, align=0)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, width, 32, user.name, align)
end
The problem with the second is that while there are no crashes when you try to save/load the file, the username doesn't change at all from what I've originally typed in the Game Database.
Can someone please help me with this, or suggest a better method for what I'm trying to do? Thank you.