What's new

[Tool] RPGMaker VX Ace Patcher - Gaijinizer Patchmaker


OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Actually the only reason I add bits of code is in the vain hope someone gets inspired and try to understand/mod the script.
I hope I'm not confusing you because of it.

Currently the log file presentation will be as such:
Code:
#Added content (Japanese + Context)
> BEGIN STRING
Japanese
> CONTEXT: Context< UNTRANSLATED

> END STRING

#Suggested translation (Context_added, Context_old, English)
> CONTEXT: Context_added (new)
> CONTEXT: Context_old (reference)
English

#Unmatched context  (Context) List with every new context that could not get associated to a similar context
Context

#Filtered context (Context) List with every context newly removed because of a context filter
Context

#Removed translation (Context, English) List with every translation removed because every associated context was removed
> CONTEXT: Context
English

This is what it gave when I tried it myself (after I changed the scripts file):
Code:
Time:2019-03-09 14:13:43 +0100, Script Version:0.1.2
#=====update_translation_log=======
#Change auto_update_mode to 0 to automatically add suggested translation, current:0
#Change translation_update_mode to 0 automatically add suggested translation, current:WIP

#Added content:

> BEGIN STRING
'淫魔の遊戯.txt'
> CONTEXT: Scripts/Simple_Variable_Updater/57:14 < UNTRANSLATED

> END STRING


#Removed translation:

> CONTEXT: Scripts/Vocab/11:21
"Buy"
> CONTEXT: Scripts/Vocab/12:21
"Sell"
> CONTEXT: Scripts/Vocab/13:21
"Cancel"
> CONTEXT: Scripts/Vocab/14:21
"Possession"
> CONTEXT: Scripts/Vocab/17:21
"Current Exp"
> CONTEXT: Scripts/Vocab/18:21
"To Next %s"
> CONTEXT: Scripts/Vocab/21:21
"Save to which file?"
> CONTEXT: Scripts/Vocab/22:21
"Load which file?"
> CONTEXT: Scripts/Vocab/23:21
"File"
> CONTEXT: Scripts/Vocab/26:21
"%s's Party"
> CONTEXT: Scripts/Vocab/29:21
"%s emerged!"
> CONTEXT: Scripts/Vocab/30:21
"%s got the upper hand!"
> CONTEXT: Scripts/Vocab/31:21
"%s was surprised!"
> CONTEXT: Scripts/Vocab/32:21
"%s has started to escape!"
> CONTEXT: Scripts/Vocab/33:21
"However, it was unable to escape!"
> CONTEXT: Scripts/Vocab/36:21
"%s was victorious!"
> CONTEXT: Scripts/Vocab/37:21
"%s was defeated."
> CONTEXT: Scripts/Vocab/38:21
"%s EXP received!"
> CONTEXT: Scripts/Vocab/39:21
"Money %s\\G I got!"
> CONTEXT: Scripts/Vocab/40:21
"%s found!"
> CONTEXT: Scripts/Vocab/41:21
"%s is now %s %s!"
> CONTEXT: Scripts/Vocab/42:21
"%s learned!"
> CONTEXT: Scripts/Vocab/45:21
"%s uses %s!"
> CONTEXT: Scripts/Vocab/48:21
"An excellent hit!!"
> CONTEXT: Scripts/Vocab/49:21
"A painful blow!!"
> CONTEXT: Scripts/Vocab/52:21
"%s took %s damage!"
> CONTEXT: Scripts/Vocab/53:21
> CONTEXT: Scripts/Vocab/62:21
"%s recovered %s %s!"
> CONTEXT: Scripts/Vocab/54:21
> CONTEXT: Scripts/Vocab/63:21
"%s gained %s %s!"
> CONTEXT: Scripts/Vocab/55:21
> CONTEXT: Scripts/Vocab/64:21
"%sof%sBut %s decreased!"
> CONTEXT: Scripts/Vocab/56:21
"%s was drained of %s %s!"
> CONTEXT: Scripts/Vocab/57:21
"%s took no damage!"
> CONTEXT: Scripts/Vocab/58:21
"Miss! %s took no damage!"
> CONTEXT: Scripts/Vocab/61:21
"%sInto %s Damaged!"
> CONTEXT: Scripts/Vocab/65:21
"Drained %s %s from %s!"
> CONTEXT: Scripts/Vocab/66:21
"%sI can not give damage to you!"
> CONTEXT: Scripts/Vocab/67:21
"Missed! %s took no damage!"
> CONTEXT: Scripts/Vocab/70:21
"%s evaded the attack!"
> CONTEXT: Scripts/Vocab/71:21
"%sI canceled magic!"
> CONTEXT: Scripts/Vocab/72:21
"%s reflected the magic!"
> CONTEXT: Scripts/Vocab/73:21
"%s counterattacked!"
> CONTEXT: Scripts/Vocab/74:21
"%s protected %s!"
> CONTEXT: Scripts/Vocab/77:21
"%s's %s went up!"
> CONTEXT: Scripts/Vocab/78:21
"%s's %s went down!"
> CONTEXT: Scripts/Vocab/79:21
"%s's %s returned to normal."
> CONTEXT: Scripts/Vocab/82:21
"There was no effect on %s!"
> CONTEXT: Scripts/Vocab/85:21
"Player's starting position is not set."
> CONTEXT: Scripts/Vocab/86:21
"Common event calls exceeded the limit."
> CONTEXT: Scripts/セーブ拡張/38:19
"セーブ画面拡張"
> CONTEXT: Scripts/装備拡張/27:4
"称号"
> CONTEXT: Scripts/装備拡張/28:4
"装飾品"
> CONTEXT: Scripts/装備拡張/29:4
> CONTEXT: Scripts/装備拡張/30:4
> CONTEXT: Scripts/装備拡張/31:4
"スキル"
> CONTEXT: Scripts/装備拡張/46:21
"部位番号:"
> CONTEXT: Scripts/装備拡張/57:10
"アクター"
> CONTEXT: Scripts/装備拡張/130:19
"装備スロット拡張"
> CONTEXT: Scripts/装備拡張/198:37
> CONTEXT: Scripts/装備拡張/235:37
"職業"
> CONTEXT: Scripts/アイテム入手アイコン/65:24
"Get demon cash!"
> CONTEXT: Scripts/アイテム入手アイコン/66:24
"demon cash disappeared…"
> CONTEXT: Scripts/アイテム入手アイコン/67:24
> CONTEXT: Scripts/アイテム入手アイコン/105:8
"Item acquisition!"
> CONTEXT: Scripts/アイテム入手アイコン/68:24
"Item loss…"
> CONTEXT: Scripts/アイテム入手アイコン/69:24
> CONTEXT: Scripts/アイテム入手アイコン/75:24
"obtain!"
> CONTEXT: Scripts/アイテム入手アイコン/70:24
> CONTEXT: Scripts/アイテム入手アイコン/76:24
"Disappearance…"
> CONTEXT: Scripts/アイテム入手アイコン/71:24
"Get armor!"
> CONTEXT: Scripts/アイテム入手アイコン/72:24
"Protective gear disappearance…"
> CONTEXT: Scripts/アイテム入手アイコン/73:24
"Learning!"
> CONTEXT: Scripts/アイテム入手アイコン/74:24
"Oblivion…"
> CONTEXT: Scripts/アイテム入手アイコン/116:8
"Test comment"
> CONTEXT: Scripts/アイテム入手アイコン/118:8
"Mini information"
> CONTEXT: Scripts/アイテム入手アイコン/133:12
" / Learning skills!"
> CONTEXT: Scripts/アイテム入手アイコン/290:16
"typeThe value is wrong><;"
> CONTEXT: Scripts/アイテム入手アイコン/584:22
"Entire party"
> CONTEXT: Scripts/├_ピクチャの操作 タローさん/30:18
"MS ゴシック"
> CONTEXT: Scripts/画像保存/180:14
"GDI+ の初期化に失敗しました。"
> CONTEXT: Scripts/画像保存/227:12
"保存に失敗しました。"
> CONTEXT: System/game_title/
> CONTEXT: Game_-_CopieINI/Game/Title
> CONTEXT: GameINI/Title
Sex Demon's game

I could add in the suggested translation the original Japanese text but that would be a pain (you can do it yourself if you ctrl+F the context in Notepad ++).
 
Last edited:

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
I'm currently on travel and can't access my lewd vault. But as soon as I'm home I gonna try out this new update function. Theres a certain game that would be ideal for that...
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Here's the mod, put it in Gaijinizer/Scripts/
Also add that code at the end of Gaijinizer/Eval/Gaijinizer.rb
Ruby:
  @auto_update_mode = 1

  def self.write_string_tled(text, tl)
    s = ""
    tl.each do |tl_text, c|
      s_tl = ""
      if tl_text == text || tl_text == "" #tl_text never is "" if from tl_data
        c.each do |index_array|
          context = context_from_a(index_array)
          next if !context_ok?(context)
          s_tl << "#{@rmgmt_c}#{context}#{@untled_tag}\n"
        end
        s_tl << "#{custom_text(text)}\n" unless s_tl == ""
      else
        c.each do |index_array|
          context = context_from_a(index_array)
          next if !context_ok?(context)
          s_tl << "#{@rmgmt_c}#{context}\n"
        end
        s_tl << "#{custom_text(tl_text)}\n" unless s_tl == ""
      end
      s << s_tl unless s_tl == ""
    end
    return "#{@rmgmt_bs}\n#{custom_text(text)}\n#{s}#{@rmgmt_es}\n" unless s == ""
    return nil
  end
 

Attachments

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
Ok I tried it out with a partial translated version of RJ224571 Lizbels's Atelier - Alchemist of the Holy Kingdom - The First Story. Does your script ignore english words / strings? The patcher seems to only spill out untranslated Japanese strings in the created patch files.
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
It shouldn't but it appears to do so.
This might be an issue with either the new version or Gaijinizer/Eval/Gaijinizer.rb.
I'm using both on SHRIFT and facing the same issue so when I find and solve the bug I'll inform you.
Keep your files you'll be able to reuse them anyway.
20198
Above translated, bellow not.
The text bellow is actually used by Gaijinizer/Eval/Gaijinizer.rb which custom translate comments.
This should be a similar problem to yours.

Edit: nether mind this actually impacts (some?) normal dialogue random stuff as well. Maybe a string encoding issue?

Edit 2: (One) Problem identified? I though I solved it earlier but it came back somehow. I might have broken it when adding the modification log file and juggling with different script versions.
Did all problematic texts contained a new line when they were in Japanese?
One line in Japanese (fine).

BEGIN STRING
………無事に気力を回復できたようですね。
CONTEXT: Troops/19/pages/1/90/Dialogue/other1/
......... It looks like you were able to recover
your \\C[23]Vitality\\C[0] without issue.#Ron
END STRING
Multiple lines (not fine).

BEGIN STRING
\\C[23]気力\\C[0]は、行動する際には必ず必要です。

\\C[2]この残量がないと、危険に対応することができません\\C[0]。
CONTEXT: Troops/19/pages/1/92/Dialogue/other1/
\\C[23]Vitality\\C[0] is necessary to take actions.
\\C[2]You cannot respond to danger unless you have
a good amount stored\\C[0].#Ron
END STRING

Edit3: It looks like I should have been using base64 encoding when marshaling hashes with strings containing escape characters.

Edit4: Well figured it out...
20316
Edit5: So there another issue using .lines instead of .split(/\n/, -1)...
20335
 
Last edited:

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
Most of the stuff are one liners. Like item names, weapons, UI entries, etc.

Btw, I found this wonderful script extractor

Ruby:
=begin
================================================================================
Easy Script Importer-Exporter                                       Version 4.0
by KK20                                                             Jul 18 2018
--------------------------------------------------------------------------------

[ Introduction ]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  Ever wanted to export your RPG Maker scripts to .rb files, make changes to
  them in another text editor, and then import them back into your project?
  Look no further, fellow scripters. ESIE is easy to use!
 
[ Instructions ]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  Place this script at the top of your script list to ensure it runs first.
  Make any changes to the configuration variables below if desired.
  Run your game and a message box will prompt success and close the game.
 
  If exporting, you can find the folder containing a bunch of .rb files in your
  project folder. A new file called "!script_order.csv" will tell this script
  in what order to import your script files back into RPG Maker. As such, you
  can create new .rb files and include its filename into "!script_order.csv"
  without ever having to open RPG Maker!
 
  If importing, please close your project (DO NOT SAVE IT) and re-open it.
 
  ** As of Version 4.0, subfolders are now possible!
 
  - Script names that start with the character defined in FOLDER_INDICATOR will
    be subfolders within your exported scripts folder.
  - You can specify the depth of subfolders by increasing the number
    FOLDER_INDICATOR characters.
  - Any scripts below the subfolder will be placed within it.
  - A script name that only consists of FOLDER_INDICATOR characters indicates
    "closing" that subfolder; scripts below will now be placed in the previous
    (i.e. its parent's) subfolder.
  - You may reuse a folder name multiple times. You can have subfolders named
    after script authors and keep their scripts grouped together without
    disrupting your script order (and potentially crashing your project).
 
  Here's an example assuming FOLDER_INDICATOR is set to '@' :
 
  Project Script List       Project Directory
 
                            Scripts_Export_Folder/
  EarlyScript               ├ EarlyScript.rb
  @Base Scripts             ├ Base Scripts/
  @@Game Classes            │ ├ Game Classes/
  Game_Temp                 │ │ ├ Game_Temp.rb
  Game_System               │ │ └ Game_System.rb
  @@Sprite Classes          │ └ Sprite Classes/
  Sprite_Character          │   └ Sprite_Character
  @Custom Scripts           ├ Custom Scripts/
  MyScript                  │ └ MyScript.rb
  @                         │
  Main                      └ Main.rb
 
[ Compatibility ]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  This script already has methods to ensure it will run properly on any RPG
  Maker version. This script does not rely on nor makes changes to any existing
  scripts, so it is 100% compatible with anything.
 
[ Credits ]+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  KK20 - made this script
  GubiD - referenced his VXA Script Import/Export
  FiXato and HIRATA Yasuyuki - referenced VX/VXA Script Exporter
  ForeverZer0 - suggesting and using Win32API to read .ini file

================================================================================
=end

#******************************************************************************
# B E G I N   C O N F I G U R A T I O N
#******************************************************************************
#------------------------------------------------------------------------------
# Set the script's mode. Will export the scripts, import the scripts, or do
# absolutely nothing.
#       ACCEPTED VALUES:
#       0 = Disable (pretends like this script doesn't even exist)
#       1 = Export
#       2 = Import
#       3 = Playtest (import scripts from folder to playtest game; does not
#                     replace or create a 'Scripts.r_data' file)
#------------------------------------------------------------------------------
IMPORT_EXPORT_MODE = 1
#------------------------------------------------------------------------------
# Folder name where scripts are imported from and exported to
#------------------------------------------------------------------------------
FOLDER_NAME = "Scripts"
#------------------------------------------------------------------------------
# Character positioned at the start of a script name to indicate a subfolder.
# All scripts (or other subfolders) below it will be placed within this folder.
# This must only be a one character string.
#------------------------------------------------------------------------------
FOLDER_INDICATOR = '@'
#------------------------------------------------------------------------------
# This tag will be added to the end of a script name in the CSV file for any
# scripts that do not have code in them. This tag will be removed when imported
# back into the project. Note that this does not apply to scripts with no name.
#------------------------------------------------------------------------------
BLANK_SCRIPT_TAG = '~blank'
#------------------------------------------------------------------------------
# When exporting, if the folder FOLDER_NAME already exists, it will create
# another folder of the same name along with an ID. This will make sure you do
# not overwrite the changes you made to your scripts accidentally. If false,
# it will erase all the files in the folder prior to exporting.
# Useless for importing.
#------------------------------------------------------------------------------
MAKE_EXPORT_COPIES = true
#------------------------------------------------------------------------------
# Creates a duplicate of the Scripts.r_data file to ensure you don't break your
# project. The duplicate will be placed in the Data folder as "Copy - Scripts".
# Useless for exporting.
#------------------------------------------------------------------------------
CREATE_SCRIPTS_COPY = true
#------------------------------------------------------------------------------
# If true, converts any instances of tab characters (\t) into two spaces. This
# is extremely helpful if writing code from an external editor and moving it
# back into RPG Maker where tab characters are instantly treated as two spaces.
#------------------------------------------------------------------------------
TABS_TO_SPACES = true
#******************************************************************************
# E N D   C O N F I G U R A T I O N
#******************************************************************************
#------------------------------------------------------------------------------
if IMPORT_EXPORT_MODE != 0

  RGSS = (RUBY_VERSION == "1.9.2" ? 3 : defined?(Hangup) ? 1 : 2)
 
  if RGSS == 3
    def p(*args)
      msgbox_p *args
    end
  end
 
  # From GubiD's script
  # These characters cannot be used as folder/file names. Any of your script
  # names that use the characters on the left will be replaced with the right.
  INVALID_CHAR_REPLACE = {
    '\\'=> '&',
    '/' => '&',
    ':' => ';',
    '*' => '°',
    '?' => '!',
    '<' => '«',
    '>' => '»',
    '|' => '¦',
    '"' => '\''
  }
 
  unless FOLDER_INDICATOR.is_a?(String) && FOLDER_INDICATOR.size == 1
    raise "FOLDER_INDICATOR needs to be 1 character long!"
  end
 
  def mkdir_p(list)
    path = ''
    list.each do |dirname|
      Dir.mkdir(path + dirname) unless File.exists?(path + dirname)
      path += "#{dirname}/"
    end
  end
 
  def traceback_report
    backtrace = $!.backtrace.clone
    backtrace.each{ |bt|
      bt.sub!(/{(\d+)}/) {"[#{$1}]#{$RGSS_SCRIPTS[$1.to_i][1]}"}
    }
    return $!.message + "\n\n" + backtrace.join("\n")
  end
 
  def raise_traceback_error
    if $!.message.size >= 900
      File.open('traceback.log', 'w') { |f| f.write($!) }
      raise 'Traceback is too big. Output in traceback.log'
    else
      raise
    end
  end
#-[ B E G I N ]-----------------------------------------------------------------
  # Get project's script file
  ini = Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L')
  scripts_filename = "\0" * 256
  ini.call('Game', 'Scripts', '', scripts_filename, 256, '.\\Game.ini')
  scripts_filename.delete!("\0")
 
  counter = 0
  # Exporting?
  if IMPORT_EXPORT_MODE == 1
    folder_name = FOLDER_NAME
    if File.exists?(FOLDER_NAME)
      # Keep a history of exports? Or only one folder?
      if MAKE_EXPORT_COPIES
        i = 1
        i += 1 while File.exists?("#{FOLDER_NAME}_#{i}")
        Dir.mkdir("#{FOLDER_NAME}_#{i}")
        folder_name = "#{FOLDER_NAME}_#{i}"
      else
        Dir['Scripts/*'].each { |file| File.delete(file) }
      end
    else
      Dir.mkdir(FOLDER_NAME) unless File.exists?(FOLDER_NAME)
    end
    # Create script order list
    script_order = File.open("#{folder_name}/!script_order.csv", 'w')
    script_names = {}
    folder_tree = [folder_name]
    current_subfolder_level = 0
    # Load the raw script data
    scripts = load_data(scripts_filename)
    scripts.each_index do |index|
      # skip ESIE
      next if index == 0
      script = scripts[index]
      id, name, code = script
      next if id.nil?
    
      # if this is a subfolder script name
      subfolder_level, subfolder_name = name.scan(/^(#{FOLDER_INDICATOR}+)(.*)/).flatten
      if subfolder_level
        # Replace invalid filename characters with valid characters
        subfolder_level = subfolder_level.size
        subfolder_name.split('').map{ |chr| INVALID_CHAR_REPLACE[chr] || chr }.join
      
        case subfolder_level <=> current_subfolder_level
        when -1
          (current_subfolder_level - subfolder_level).times do |n|
            folder_tree.pop
            current_subfolder_level -= 1
          end
          if subfolder_name.empty?
            folder_tree.pop
            current_subfolder_level -= 1
          else
            folder_tree[-1] = subfolder_name
          end
        
        when 0
          if subfolder_name.empty?
            folder_tree.pop
            current_subfolder_level -= 1
          else
            folder_tree[-1] = subfolder_name
          end
        
        when 1
          if subfolder_level - current_subfolder_level != 1
            raise "Invalid sublevel for folder!\n" +
                  "Expected: #{FOLDER_INDICATOR * (current_subfolder_level + 1)}#{subfolder_name}\n" +
                  "Received: #{name}"
          end
          raise "Branching subfolder needs a name!" if subfolder_name.empty?
          folder_tree << subfolder_name
          current_subfolder_level += 1
        end
        mkdir_p(folder_tree)
        script_order.write("#{name}\n")
        # no need to continue further with this script, so go to next
        next
      end
    
      # Replace invalid filename characters with valid characters
      name = name.split('').map{ |chr| INVALID_CHAR_REPLACE[chr] || chr }.join
      # Convert script data to readable format
      code = Zlib::Inflate.inflate(code)
      code.gsub!(/\t/) {'  '} if TABS_TO_SPACES

      if code.empty?
        name += BLANK_SCRIPT_TAG unless name.empty?
        script_order.write("#{name}\n")
        next
      end

      name = 'no_script_name' if name.empty?
      if script_names.key?(name)
        script_names[name] += 1
        name = "#{name}~@#{script_names[name]}"
      else
        script_names[name] = 0
      end
      # Output script to file
      script_order.write("#{name}\n")
      dir_path = folder_tree.join('/')
      File.open("#{dir_path}/#{name}.rb", 'wb') { |f| f.write(code) }
      counter += 1
    end
    script_order.close
    p "#{counter} files successfully exported to folder '#{folder_name}'"
    exit
  end
  # If importing or play-testing
  if IMPORT_EXPORT_MODE >= 2
    folder_tree = [FOLDER_NAME]
    counter = 1
    # If strictly importing, we want to replace the data directly in the scripts
    # data file. Otherwise, just override the scripts global variable.
    if IMPORT_EXPORT_MODE == 2
      scripts_file = File.open(scripts_filename, 'rb')
      import_obj = Marshal.load(scripts_file)
    else
      import_obj = $RGSS_SCRIPTS
    end
    # If strictly importing, create a copy of the scripts file in case something
    # goes wrong with the import.
    if IMPORT_EXPORT_MODE == 2 && CREATE_SCRIPTS_COPY
      base_name = File.basename(scripts_filename)
      dir_name = File.dirname(scripts_filename)
      copy = File.open(dir_name + "/Copy - " + base_name, 'wb')
      Marshal.dump(import_obj, copy)
      copy.close
    end
    # Load each script file
    File.open("#{FOLDER_NAME}/!script_order.csv", 'r') do |list|
      list = list.read.split("\n")
      list.each do |filename|
        code = ''
        script_name = filename.gsub(/(.*?)(?:~@\d+)?$/) {$1}
        # Is this a subfolder?
        level, subfolder = script_name.scan(/^(#{FOLDER_INDICATOR}+)(.*)/).flatten
        if level
          level = level.size
          case level <=> (folder_tree.size - 1)
          when -1
            (folder_tree.size - 1 - level).times { |n| folder_tree.pop }
            if subfolder.empty?
              folder_tree.pop
            else
              folder_tree[-1] = subfolder
            end
          when 0
            if subfolder.empty?
              folder_tree.pop
            else
              folder_tree[-1] = subfolder
            end
          when 1
            if level - (folder_tree.size - 1) != 1
              raise "Invalid sublevel for folder!\n" +
                    "Expected: #{FOLDER_INDICATOR * (folder_tree.size)}#{subfolder}\n" +
                    "Received: #{script_name}"
            end
            raise "Branching subfolder needs a name!" if subfolder.empty?
            folder_tree << subfolder
          end
        
        elsif script_name.empty? || script_name[/#{BLANK_SCRIPT_TAG}$/]
          script_name = script_name.chomp("#{BLANK_SCRIPT_TAG}")
          code = ''
        else # script file
          dir_path = folder_tree.join('/')
          code = File.open("#{dir_path}/#{filename}.rb", 'r') { |f| f.read }
          code.gsub!(/\t/) {'  '} if TABS_TO_SPACES
        end
        # If strictly importing, compress script. Otherwise, keep script in
        # readable format.
        if IMPORT_EXPORT_MODE == 2
          z = Zlib::Deflate.new(6)
          data = z.deflate(code, Zlib::FINISH)
        else
          data = code
        end
        # If strictly importing, replaces entries in the scripts file data with
        # the newly-compressed imported scripts. Otherwise, replace entries in
        # $RGSS_SCRIPTS with imported scripts.
        import_obj[counter] = [counter]
        import_obj[counter][1] = script_name
        import_obj[counter][IMPORT_EXPORT_MODE] = data
        counter += 1
      end
    end
    # Dump imported file data to a new Scripts file and close the program.
    if IMPORT_EXPORT_MODE == 2
      data = File.open(scripts_filename, 'wb')
      Marshal.dump(import_obj[0, counter], data)
      data.close
      p "#{counter-1} files successfully imported. Please close your RPG Maker " +
      "now without saving it. Re-open your project to find the scripts imported."
      exit
    else
      # Run the project from here, eval-ing everything
      ($RGSS_SCRIPTS.size - counter).times { |n| $RGSS_SCRIPTS.pop }
      $RGSS_SCRIPTS.each_with_index do |script, i|
        next if i == 0
        begin
          eval(script[3], nil, script[1])
        rescue ScriptError
          raise ScriptError.new($!.message)
        rescue
          $!.message.sub!($!.message, traceback_report)
          raise_traceback_error
        end
      end
      exit
    end
  end
#------------------------------------------------------------------------------
end # if IMPORT_EXPORT_MODE != 0

How difficult would it be to include it into your tool as an optional plugin? Having this as an option would be really neat for script heavy games.
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
A similar feature is already included.
Patchmaker adds the scripts in Gaijinizer\Plugins (text or ruby).
Using the syntax X_name you decided the order of your scripts.
For example:
20206
Adds Gaijinizer_Redistribute, the Fillscreen++, then ..., then Game System Fix.
The changes are then saved in the translated scripts in Gaijinizer/Game_en/Scripts.rvdata2 and the .ini file.
Meaning you can go back to the untranslated, unmodified if you want and also don't need to keep the contents in the Plugins folder once you are done.
 
Last edited:
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Patchmaker is now in 0.2.0. I'm improving it as I use it on SHRIFT. You can see my own customizations for the game in Gaijinizer/Eval/config_SHRIFT.rb
There might be some issues if you started a project on 0.1:
-The patch syntax was slightly changed (nothing that cannot be salvaged with Notepad++ search and replace).
-If you modded Gaijinizer, previous Gaijinizer/Eval/Gaijinizer.rb might no longer be working properly (due to a major bug fix).
 

Shrifted

Well-known member
Joined
Feb 28, 2019
Messages
287
Reputation score
540
Heyo, bringing a QoL suggestion over here from the Shrift translation thread while I still had it on my brain...

How hard would it be to display some text saying something like "Translating, please wait (may freeze, be patient!)" and then let the script freeze on that while it does it's work instead of letting it freeze on the regular page without any indication of what's happening? I have no clue on how easy something like this may be (I have no experience with Ruby or RPGMaker stuff in the slightest), but I think it shouldn't be too bad....
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Great, now I just feel stupid for not adding something that obvious. I might as well put some extra work into it so at least I won't feel that's something literally anyone could have done.

Edit: Adding this to Patchmaker v0.2.3
I'll update this thread when I'm done updating the script regex.
20833

Edit2: Updated and tested on https://ulmf.org/threads/legend-of-the-holy-tree-machine-translation.12944/
I could also test and debug dialogue translation as discussed above (see config_聖樹伝説.rb or dialogue_brackets.rb)
20850
20851
20852
 
Last edited:

T4ke

Lurker
Joined
Jul 15, 2009
Messages
312
Reputation score
258
Quick question: Can you recommend a tool that can quickly compare files and mark changed files between different version (when games get updated for example)?
 

zipetya

Evard's Tentacles of Forced Intrusion
Joined
Nov 13, 2013
Messages
1,037
Reputation score
230
Quick question: Can you recommend a tool that can quickly compare files and mark changed files between different version (when games get updated for example)?
Probably not the smartest way, but I had partial successes (lol?) on that front with WinMerge.
 
OP
Lv1VillagerA

Lv1VillagerA

Lurker
Joined
Apr 3, 2018
Messages
1,370
Reputation score
3,082
Quick question: Can you recommend a tool that can quickly compare files and mark changed files between different version (when games get updated for example)?
Long answer:

Method 1 using Gaijnizer:
-When you patch an updated game you can take a quick peak in the Log.txt file, (updated patch is in Path_en_updated)
Pros:
-Simple
-Included in Gaijnizer
Cons:
-Changing Gaijinizer version or modding it will complicate things
-Log txt can be a little long
-Only marks changes in the Log file
-Only compares 2 versions

Use it, it's always available.

Method 2 using a code manager like Github desktop:
-Compare the empty patches
-Compare the translated patches
Pros:
-Can revert changes (branches, commits, etc.)
-Lots of possibilities
Cons:
-Needs an account (free)
-Not adapted to patch Syntax
-Does not synthesize all the information

Try to separate empty & translated patches and learn how to find the information you want.

Method 3 ask a friend:
That's not translation work so literally anyone can do it.

It really depends on what you want to do. You can use one or all of the methods above.
For example, if you just want to see the untranslated stuff you can just search for the "< UNSTRANSLATED" tag.
 
Last edited:

GaryFckenOak

New member
Joined
Jun 20, 2018
Messages
3
Reputation score
0
So for some reason when i try to load it up it does not give me the option to do anything with patches it just takes me straight to the game and then gives me an error saying ""Script 'Game_Interpreter' line 1411: Name Error Occurred undefined local variable or method 'write_public data' for #<Game_Interpreter:0x132df330> any help would be apreciated
 

culac69

New member
Joined
Feb 27, 2020
Messages
1
Reputation score
0
Hi. I used your patch but meet this problem. It lead to RGSS301.dll, how can i fix it? When I use RPGMaker VX Ace, I meet the same problem too, at the same RGSS301.dll :(
1586575008015.png
 

qwerxzvcasdf

Active member
Joined
May 6, 2019
Messages
141
Reputation score
60
Stupid question: Is this tool auto trans? i wan ttry it with some games.
edit: i do what #1 say wirh RJ279043 but nothing happen? what i wrong?
 
Last edited:

MdHouse

New member
Joined
May 5, 2020
Messages
1
Reputation score
0
I have a problem that was already described earlier, can someone help?

For some reason when i try to load it up it does not give me the option to do anything with patches it just takes me straight to the simple game menu then gives me an error"
 

rex1996

New member
Joined
Oct 19, 2020
Messages
3
Reputation score
1
hey i deleted the Game.rgss3a but now i cant start the game any advice?

and i cant see my data on my files am i doing something wrong?
 
Top