http://www.dubealex.com/asylum/index.php?showtopic=11253
문자 치환(환자법이었던가? 가장 기초적인 암호화 방법인데)을 이용해서 대사창에 다른 언어를 표시하는 스크립트입니다. (FF10/10-2의 알베드어 생각하면 됨) 근데 알파벳만 될 겁니다.(한글에 적용시키고 싶다면.... 알아서 연구해 보시길)
문자 치환(환자법이었던가? 가장 기초적인 암호화 방법인데)을 이용해서 대사창에 다른 언어를 표시하는 스크립트입니다. (FF10/10-2의 알베드어 생각하면 됨) 근데 알파벳만 될 겁니다.(한글에 적용시키고 싶다면.... 알아서 연구해 보시길)
[일반 시스템] Multiple Languages v2 by SephirothSpawn (SDK호환) |
글쓴이 : Y.W. Ahn 날짜 : 06-09-01 08:05 조회 : 157 |
문자 치환(환자법이었던가? 가장 기초적인 암호화 방법인데)을 이용해서 대사창에 다른 언어를 표시하는 스크립트입니다. (FF10/10-2의 알베드어 생각하면 됨) 근데 알파벳만 될 겁니다.(한글에 적용시키고 싶다면.... 알아서 연구해 보시길) #============================================================================== # ** Multiple Languages #------------------------------------------------------------------------------ # SephirothSpawn # Version 2 # 2006-08-27 #------------------------------------------------------------------------------ # * Descript-xion : # # ~ This script-x was designed to let you simulate multiple languages through # letter transfers. It allows you to transfer one letter to another, until # you learn the letter (One Letter = Another Letter). You can set up # multiple languages and control color of known and unknown letters for # each language. #------------------------------------------------------------------------------ # * Instructions : # # ~ Place Script-x Below the SDK and Above Main # # ~ Turning on Different Language (Use Before the Text/Message Command): # $game_languages.language_id = language_id # # ~ Turning off multiple langauges (Use After the Text/Message Command): # $game_languages.language_id = nil # # ~ To Learn a letter, use: # $game_languages.learn_letter(language_id, 'letter') # # NOTE: Due to the complexity of message systems, you cannot use special # commands such as the show gold window when displaying an alternate language. #------------------------------------------------------------------------------ # * Setting Up A Language # # ~ Setting Color for Known and Unknown letters # Known_Letter_Color = {language_id => text_color, ...} # Unknown_Letter_Color = {language_id => text_color, ...} # # ~ Setting Up Language Table # Languages = {language_id => # # ~ # to something else. The keys are what the letter is, and the values are # how the letters will appear until translated. # # Example: # {'a' => 'j', 'b' => 'k', 'c' => 'l', 'd' => 'm', 'e' => 'n'} # # CbaEBac -> LkjNKjl #------------------------------------------------------------------------------ # * Thanks To Makeamidget For helping me with previous versions #============================================================================== #------------------------------------------------------------------------------ # * SDK Log Script-x #------------------------------------------------------------------------------ SDK.log('Multiple Languages', 'SephirothSpawn', 2, '2006-08-28') #------------------------------------------------------------------------------ # * Begin SDK Enable Test #------------------------------------------------------------------------------ if SDK.state('Multiple Languages') #============================================================================== # ** Game_Languages #============================================================================== class Game_Languages #-------------------------------------------------------------------------- # * Letter Colors # # ~ language_id => text_colors # # The Text Colors are the colors you would use when you use c[n]. # By Default, these are the colors: # # 0 : White 1 : Dark Blue # 2 : Red 3 : Green # 4 : Light Blue 5 : Purple # 6 : Yellow 7 : Gray #-------------------------------------------------------------------------- Known_Letter_Color = { 1 => 0 } Unknown_Letter_Color = { 1 => 6 } #-------------------------------------------------------------------------- # * Languages # # ~ language_id => {a => 'f', 'b' => 'c', ...} # # * Template For Letters # = {'a' => '', 'b' => '', 'c' => '', 'd' => '', 'e' => '', # 'f' => '', 'g' => '', 'h' => '', 'i' => '', 'j' => '', # 'k' => '', 'l' => '', 'm' => '', 'n' => '', 'o' => '', # 'p' => '', 'q' => '', 'r' => '', 's' => '', 't' => '', # 'u' => '', 'v' => '', 'w' => '', 'x' => '', 'y' => '', # 'z' => ''} #-------------------------------------------------------------------------- Languages = { 1 => {'a' => 'y', 'b' => 'p', 'c' => 'l', 'd' => 't', 'e' => 'a', 'f' => 'v', 'g' => 'k', 'h' => 'r', 'i' => 'e', 'j' => 'z', 'k' => 'g', 'l' => 'm', 'm' => 's', 'n' => 'h', 'o' => 'u', 'p' => 'b', 'q' => 'x', 'r' => 'n', 's' => 'c', 't' => 'd', 'u' => 'i', 'v' => 'v', 'w' => 'f', 'x' => 'q', 'y' => 'o', 'z' => 'w' } } #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_accessor :language_id #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize @language_id = nil @known_letters = {} end #-------------------------------------------------------------------------- # * Learn Letter #-------------------------------------------------------------------------- def learn_letter(language_id, letter) unless @known_letters.has_key?(language_id) @known_letters[language_id] = [] end unless @known_letters[language_id].include?(letter.downcase) @known_letters[language_id] << letter.downcase end end #-------------------------------------------------------------------------- # * Change To Language #-------------------------------------------------------------------------- def change_to_language return_text = '' text = $game_temp.message_text last_color = 0 begin while ((c = text.slice!(/./m)) != nil) if @known_letters.has_key?(@language_id) if @known_letters[@language_id].include?(c.downcase) next_color = Known_Letter_Color[@language_id] unless next_color == last_color last_color = next_color return_text += 'c' + "[#{next_color}]" end return_text += c next end end if Languages[@language_id].include?(c.downcase) if c.upcase == c c = Languages[@language_id][c.downcase].upcase else c = Languages[@language_id][c] end end next_color = Unknown_Letter_Color[@language_id] unless next_color == last_color last_color = next_color return_text += 'c' + "[#{next_color}]" end return_text += c end end $game_temp.message_text = return_text end end #============================================================================== # ** Window_Message #============================================================================== class Window_Message #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias seph_gmlngs_wdmsg_refresh refresh #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh # If Alternate Languages Isn't Nil unless $game_languages.language_id.nil? $game_languages.change_to_language end # Original Method Refresh seph_gmlngs_wdmsg_refresh end end #============================================================================== # ** Scene_Title #============================================================================== class Scene_Title #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias seph_gmlngs_scnttl_cng command_new_game #-------------------------------------------------------------------------- # * Command : New Game #-------------------------------------------------------------------------- def command_new_game # Original Command New Game seph_gmlngs_scnttl_cng # Creates Game Languages Game Data $game_languages = Game_Languages.new end end #============================================================================== # ** Scene_Save #============================================================================== class Scene_Save #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias seph_gmlngs_scnsave_wd write_data #-------------------------------------------------------------------------- # * Command : New Game #-------------------------------------------------------------------------- def write_data(file) # Original Write Data seph_gmlngs_scnsave_wd(file) # Saves Game Languages Data Marshal.dump($game_languages, file) end end #============================================================================== # ** Scene_Load #============================================================================== class Scene_Load #-------------------------------------------------------------------------- # * Alias Listings #-------------------------------------------------------------------------- alias seph_gmlngs_scnload_rd read_data #-------------------------------------------------------------------------- # * Command : New Game #-------------------------------------------------------------------------- def read_data(file) # Original Write Data seph_gmlngs_scnload_rd(file) # Saves Game Languages Data $game_languages = Marshal.load(file) end end #-------------------------------------------------------------------------- # * End SDK Enable Test #-------------------------------------------------------------------------- end 다른 언어를 표시하고 싶을 때(메세지 표시하기 전에 넣을 것): $game_languages.language_id = language_id 다른 언어 표시 off(메세지 표시 후에 넣을 것) $game_languages.language_id = nil 다른 언어를 배울 때(FF10/10-2에서 알베드어 사전 입수해서 하듯이): $game_languages.learn_letter(language_id, '문자') 원래의 알파벳과 치환할 문자는 스크립트 내의 Languages = {....} 에서 정의할 수 있습니다. **이 스크립트로 다른 언어를 표시할 때는 돈 액수창 표시와 같은 몇몇 문자표시 명령을 사용할 수 없습니다. |