no probs 🙂
Prohibiting same character name
RGSS3 Script RequestsHello again, there is a slight problem I have regarding the script, it doesn't recognize the casing of letters. I put "PETER" and saved, but I entered again "Peter"
it is accepted.
it is accepted.
easy peasy 🙂 Just convert everything to lower case when saving and when comparing. It does not change the name of the actor while it's doing it.
module DataManager class << self alias shaz_unique_names_load_normal_database load_normal_database alias shaz_unique_names_save_game_without_rescue save_game_without_rescue end def self.load_normal_database shaz_unique_names_load_normal_database begin $data_names = load_data("PC_Names.rvdata2") rescue $data_names = [] end end def self.save_game_without_rescue(index) save_name return shaz_unique_names_save_game_without_rescue(index) end def self.save_name $data_names.push($game_actors[1].name.downcase) File.open("PC_Names.rvdata2", "wb") do |file| Marshal.dump($data_names, file) end endendclass Game_Interpreter def actor_name_used? $data_names.include?($game_actors[1].name.downcase) endendThe names already saved are in the case you entered them, so you might want to clobber the file and start over.
module DataManager class << self alias shaz_unique_names_load_normal_database load_normal_database alias shaz_unique_names_save_game_without_rescue save_game_without_rescue end def self.load_normal_database shaz_unique_names_load_normal_database begin $data_names = load_data("PC_Names.rvdata2") rescue $data_names = [] end end def self.save_game_without_rescue(index) save_name return shaz_unique_names_save_game_without_rescue(index) end def self.save_name $data_names.push($game_actors[1].name.downcase) File.open("PC_Names.rvdata2", "wb") do |file| Marshal.dump($data_names, file) end endendclass Game_Interpreter def actor_name_used? $data_names.include?($game_actors[1].name.downcase) endendThe names already saved are in the case you entered them, so you might want to clobber the file and start over.
Thank you sir, it works like a charm again 😀
Original thread: https://forums.rpgmakerweb.com/threads/prohibiting-same-character-name.31932/