Advertisement
TheSixth

Event Command Corrector

Dec 5th, 2016
411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 28.84 KB | None | 0 0
  1. #===============================================================================
  2. # * [ACE] Event Command Corrector
  3. #===============================================================================
  4. # * Made by: Sixth (www.rpgmakervxace.net, www.forums.rpgmakerweb.com)
  5. # * Version: 1.0
  6. # * Updated: 06/12/2016
  7. # * Requires: --------
  8. #-------------------------------------------------------------------------------
  9. # * < Change Log >
  10. #-------------------------------------------------------------------------------
  11. # * Version 1.0 (06/12/2016)
  12. #   - Initial release.
  13. #-------------------------------------------------------------------------------
  14. # * < Description >
  15. #-------------------------------------------------------------------------------
  16. # * First thing first, this is NOT an eventing tool!
  17. #   This script can NOT be used in published games, only in unencrypted
  18. #   projects, and only for development corrections!
  19. #   Now that this is out of the way...
  20. # * Ever got into a situation when you needed to change a face graphic,
  21. #   switch ID, BGM name, or anthing else in tons of event commands?
  22. #   If you have, you certainly know how time consuming and tedious can that be.
  23. # * This is a developer's tool to ease the amount of tediousness if you need
  24. #   to adjust some very common event commands in case you changed your mind
  25. #   about something or got new resources to implement, for example.
  26. #   With this script you can modify any event commands in any events on any maps
  27. #   you want based on your conditions with a single script call.
  28. #   Your changes will be saved in your physical map files, so you won't need to
  29. #   worry about them ever again after the change (unless you want to change
  30. #   them again, of course).
  31. # * Map and event filters available in case you kinda know where are the event
  32. #   commands you want to modify located or where they aren't.
  33. # * The console will show which event commands are changed with very precise
  34. #   information (map ID, event ID, page number, command line, parameter index,
  35. #   old and new values).
  36. # * Note that this can NOT re-structure your events, it can only modify
  37. #   existing commands without deleting them or adding new ones. For example,
  38. #   you can not remove a choice from a Show Choices command, but you can change
  39. #   it's text.
  40. # * As a bonus, this script will fix a bug in the default Game_Interpreter
  41. #   class. The "Shake Screen" event command reads the wrong parameters for the
  42. #   wait flag and it's duration, so that part of the command is not functional
  43. #   without a fix.
  44. #-------------------------------------------------------------------------------
  45. # * < Script Calls >
  46. #-------------------------------------------------------------------------------
  47. # * To modify your event commands, use this script call:
  48. #
  49. #     EvEdit.modify(setting_key,reload_flag)
  50. #
  51. #   The setting_key is a valid key you use in the script settings below.
  52. #   Based on your settings, the event commands matching your criterias will be
  53. #   changed according to your settings.
  54. #
  55. #   The reload_flag can be used to reload the current map in the game if any
  56. #   event on it has been modified.
  57. #   Set it to true, and it will reload the map if needed.
  58. #   Set it to false, and map will not be reloaded.
  59. #   Even if you set this to false, if the current map has been modified and
  60. #   the player leaves and re-enters the map, the changes made will be loaded.
  61. #   The default value for this is false.
  62. #
  63. #   NOTE:
  64. #   After running this script call, if any changes has been made, you will have
  65. #   to restart the opened project in order to see your changes in the editor!
  66. #
  67. #   Examples:
  68. #
  69. #     EvEdit.modify(:bgm_change1)
  70. #   Will load the settings named :bgm_change1. The events modified and the new
  71. #   values will be based on those settings.
  72. #
  73. #     EvEdit.modify(:face2,true)
  74. #   Will load the settings named :face2. The events modified and the new
  75. #   values will be based on those settings.
  76. #   The current map will be immediately reloaded if any changes were made to any
  77. #   event on it.
  78. #-------------------------------------------------------------------------------
  79. # * < Installation >
  80. #-------------------------------------------------------------------------------
  81. # * Place this script between Materials and Main!
  82. #-------------------------------------------------------------------------------
  83. # * < Compatibility Info >
  84. #-------------------------------------------------------------------------------
  85. # * No known incompatibilities.
  86. #-------------------------------------------------------------------------------
  87. # * < Known Issues >
  88. #-------------------------------------------------------------------------------
  89. # * No known issues.
  90. #-------------------------------------------------------------------------------
  91. # * < Terms of Use >
  92. #-------------------------------------------------------------------------------
  93. # * Free to use for whatever purposes you want.
  94. # * Credit me (Sixth) in your game, pretty please! :P
  95. # * Posting modified versions of this script is allowed as long as you notice me
  96. #   about it with a link to it!
  97. #===============================================================================
  98. $imported = {} if $imported.nil?
  99. $imported["SixthEvCorrector"] = true
  100. #===============================================================================
  101. # Settings:
  102. #===============================================================================
  103. module EvEdit
  104.   #-----------------------------------------------------------------------------
  105.   # Corrector Settings:
  106.   #-----------------------------------------------------------------------------
  107.   # This is where you set up the conditions and new values for the event
  108.   # commands you want to change.
  109.   #
  110.   # Format:
  111.   #
  112.   #   setting_key => {
  113.   #     :inc_maps => [map_id1, map_id2, ...],
  114.   #     :exc_maps => [map_id1, map_id2, ...],
  115.   #     :inc_evs => [ev_id1, ev_id2, ...],
  116.   #     :exc_evs => [ev_id1, ev_id2, ...],
  117.   #     :command => command_code,
  118.   #     :params => {
  119.   #       param_index => { :current => current_data, :new => new_data },
  120.   #       [param_indexes] => {:current => [current_data], :new => [new_data]},
  121.   #       ...
  122.   #     },
  123.   #   },
  124.   #
  125.   # Details:
  126.   #
  127.   #   setting_key => {
  128.   # This is the identifier for the setting.
  129.   # You can use anything you want here, strings, symbols, integers, and so on.
  130.   # This is the key you will use in your script calls to trigger the check and
  131.   # modification of the specified event commands.
  132.   #
  133.   #   :inc_maps => [map_id1, map_id2, ...],
  134.   # This is the inclusive filter for maps.
  135.   # If you want to check and modify the events on specific maps only, you can
  136.   # use this setting to specify these maps.
  137.   # If you use this setting, only the events on the maps included in the array
  138.   # will be checked and modified, the rest of them will be skipped!
  139.   # This setting is optional, you can omit it if you want.
  140.   #
  141.   #   :exc_maps => [map_id1, map_id2, ...],
  142.   # This is the exclusive filter for maps.
  143.   # If you want to exclude some specific maps from the check, you can use this
  144.   # setting to specify these maps.
  145.   # If you use this setting, the events on the maps included in the array will
  146.   # not be checked/modified at all.
  147.   # This setting is optional, you can omit it if you want.
  148.   #
  149.   #   :inc_evs => [ev_id1, ev_id2, ...],
  150.   # This is the inclusive filter for events.
  151.   # Works the same way as the inclusive map filter, but for events instead.
  152.   # This setting is optional, you can omit it if you want.
  153.   #
  154.   #   :exc_evs => [ev_id1, ev_id2, ...],
  155.   # This is the exclusive filter for events.
  156.   # Works the same way as the exclusive map filter, but for events instead.
  157.   # This setting is optional, you can omit it if you want.
  158.   #
  159.   #   :command => command_code,
  160.   # This is the command code for the event command.
  161.   # You must know the command code for the specific event command you want to
  162.   # modify. That code is a 3-digit integer. You can get the correct command
  163.   # codes from that very long documentation I made named
  164.   # "Event Command Structure". You might as well get familiar with that
  165.   # documentation, because you will use it a lot for this script.
  166.   # There is a table of contents chapter there, and each event command's code
  167.   # is shown there on the right side of each section name.
  168.   #
  169.   #   :params => {
  170.   #     param_index => { :current => current_value, :new => new_value },
  171.   #     [param_indexes] => {:current => [current_values], :new => [new_values]},
  172.   #     ...
  173.   #   },
  174.   # This is where you select which parameters of the event command you want to
  175.   # change, as well as the current and new values of these parameters.
  176.   # You may notice the difference between the two sample lines I made, and
  177.   # there is a reason for that.
  178.   # The first type will check for one parameter only, and will modify that
  179.   # single parameter accordingly if the condition is met.
  180.   # The second type will check for multiple parameters, and will modify those
  181.   # parameters accordingly if the conditions are met.
  182.   # The number of parameters and their value type vary for each event commands.
  183.   # You can check the structure of them in my "Event Command Structure"
  184.   # documentation.
  185.   # You should only set the correct value type for a parameter or bad things
  186.   # may happen! Very, very bad things! Almost evil! Or something... :P
  187.   # If you use the multi type setting here, you must use an array of parameter
  188.   # indexes for the key (the thing leftmost from the 1st => sign), and an array
  189.   # of parameter values for the :current and :new settings.
  190.   # The :current setting will be the condition check. If the specified
  191.   # parameter's current value is the same as that setting, it will be changed to
  192.   # the value you have set in the :new setting.
  193.   # In the case of multi type setting, the values in the :current and :new
  194.   # arrays must match with the parameter indexes used in the setting key!
  195.   # I can't really explain this well, instead of that, check the sample
  196.   # settings. I added notes for each of them explaining what they would do if
  197.   # you would use them with the script call.
  198.   #
  199.   # NOTE 1:
  200.   # In the case of parameters which use audio files (BGM, BGS, ME or SE
  201.   # objects), you should use an array containing the audio file's name, volume
  202.   # and pitch (in this order) instead of directly using an audio object.
  203.   # This is because audio objects can not be compared with each other directly,
  204.   # so I converted them to arrays before comparing them, and converted these
  205.   # arrays into audio files before setting the new parameter.
  206.   # You can set nil for the name, volume and/or pitch in the :current settings
  207.   # if you want to skip the check on these audio properties.
  208.   # You can do the same for the :new settings if you want to keep an audio
  209.   # property from the current audio file.
  210.   #
  211.   # NOTE 2:
  212.   # You can use Regexp to check for string parameters.
  213.   # If you use Regexp for a :current setting, only the matching part from the
  214.   # text will be replaced by the text you specify in the :new setting!
  215.   # This is true for all parameters which use string for their value (note that
  216.   # a parameter that uses an array of strings can NOT use this feature!).
  217.   # If you use a regular string for the :current setting, the whole text will
  218.   # be replaced with the one in your :new setting!
  219.   #
  220.   # NOTE 3:
  221.   # Set Move Route commands are NOT supported at the moment!
  222.   # I will try to find a way to change these too, but doing this is not a high
  223.   # priority thing on my list right now.
  224.   #
  225.   # And that's it, in short.
  226.   # Remember that if you run the script call, and if there were changes made to
  227.   # any events, the changes will be saved immediately in your physical map files
  228.   # found in the Data folder of your project (by default).
  229.   # It might be a good idea to backup your map files before you try to change
  230.   # anything, so if you managed to make an invalid setting, you can just restore
  231.   # the files from your backups.
  232.   #
  233.   # Check the sample setting explanations to get some insight on how these
  234.   # settings work.
  235.   #-----------------------------------------------------------------------------
  236.   Mods = {
  237.     :msg_face1 => { # This will modify a face image used in Show Text commands.
  238.       :inc_maps => [3], # Will only execute on events found on Map 3.
  239.       #:exc_maps => [], # Excluded maps - not used.
  240.       #:inc_evs => [], # Included events - not used.
  241.       #:exc_evs => [], # Excluded events - not used.
  242.       :command => 101, # This is the (1st) command code for Show Text commands.
  243.       :params => { # Parameters to check and replace:
  244.       # Parameter 0 for the Show Text commands stores the face graphic used.
  245.       # The face graphic parameter's value must be a string, the image filename.
  246.       # This setting will check for any Show Text commands which use the
  247.       # "ActorPrison1" face graphic, and will replace those with the "Actor2"
  248.       # graphic.
  249.       # index => {  current_data  => new_data },
  250.           0   => { :current => "ActorPrison1", :new => "Actor2" },
  251.       },
  252.     },
  253.     :msg_face2 => { # This will modify a face image and it's index used in Show Text commands.
  254.       #:inc_maps => [], # Included maps - not used.
  255.       :exc_maps => [1,2,4,8,10], # Will skip the included maps from the change.
  256.       :inc_evs => [*6..45], # Will only make changes in the included events. (From Event 6 to 45 here.)
  257.       #:exc_evs => [], # Excluded events - not used.
  258.       :command => 101, # This is the (1st) command code for Show Text commands.
  259.       :params => { # Parameters to check and replace:
  260.       # Parameter 0 for the Show Text commands stores the face graphic used.
  261.       # Parameter 1 for the Show Text commands stores the face index used.
  262.       # The face graphic parameter's value must be a string, the image filename.
  263.       # The face index parameter's value must be an integer, the spritesheet index.
  264.       # This setting will check for any Show Text commands which use the
  265.       # "Actor2" face graphic AND their face index is set to 0. Any matching
  266.       # commands will get their face graphic changed to "ActorPrison1" AND
  267.       # their face index will be set to 5 as well.
  268.       # index => {  current_data  => new_data },
  269.         [0,1]   => { :current => ["Actor2",0], :new => ["ActorPrison1",5] },
  270.       },
  271.     },
  272.     :choice1 => { # This will modify choice texts used in Show Choice commands.
  273.       # No optional settings were used, all maps and all events will be checked.
  274.       :command => 102, # This is the command code used for Show Choices commands.
  275.       :params => { # Parameters to check and modify:
  276.       # Parameter 0 for the Show Choices commands stores the choice texts in an array.
  277.       # So, this parameter must be an array containing strings only.
  278.       # This setting will search for any Show Choices commands which got the
  279.       # included choice options, and will change the text used for them to the
  280.       # specified choice texts.
  281.       # Note that if your Show Choices command got 3 choices, you also must set
  282.       # 3 choices in the :new setting! You can NOT enter more or less!
  283.         0 => {
  284.           :current => ["Enhance","Bind","Cancel"],
  285.           :new => ["Upgrade","Seal","Cancel"]
  286.         },
  287.       },
  288.     },
  289.     :battle_bgm1 => { # This will modify the BGM for Change Battle BGM command.
  290.       # No optional settings were used, all maps and all events will be checked.
  291.       :command => 132, # This is the command code for Change Battle BGM commands.
  292.       :params => { # Parameters to check and modify:
  293.       # Parameter 0 for the Change Battle BGM commands stores a BGM object.
  294.       # However, these objects can't be compared with each other directly, so
  295.       # instead of using a real BGM object, you should use an array with the
  296.       # BGM's name, volume and pitch (in this order).
  297.       # This setting will search for any Change Battle BGM commands which got
  298.       # the specified BGM from the :current setting, and will set their BGM to
  299.       # the specified one in the :new setting.
  300.         0 => {
  301.           # Checks for: RPG::BGM.new("Battle4",any_volume,any_pitch),
  302.           :current => ["Battle4",nil,nil],
  303.           # Sets matches to: RPG::BGM.new("EpicBattleTheme12",old_volume,old_pitch)
  304.           :new => ["EpicBattleTheme12",nil,nil]
  305.         },
  306.       },
  307.     },
  308.     :msg_text1 => { # This will modify the text of the Show Text commands.
  309.       :command => 401, # This is the command code for Show Text (text data) commands.
  310.       :params => { # Parameters to check and modify:
  311.       # Parameter 0 for this command is a string.
  312.       # As such, we can use a Regexp to search for specific words or phrases,
  313.       # and replace only those in these strings.
  314.       # Regexp looks like a string, but instead of double quotes, you put the
  315.       # text between / signs.
  316.       # In this example, any "Forest of Pain" text (case insensitive because of
  317.       # the "i" used at the end of the Regexp) will get replaced by the
  318.       # "Towwer of Struggle" text.
  319.       # Note that if you got a lot of Show Text commands (and you most probably
  320.       # have), it can take a while to finish the check and modification!
  321.         0 => {:current => /Forest of Pain/i, :new => "Tower of Struggle"},
  322.       },
  323.     }
  324.     # <-- Add more settings here!
  325.   }
  326.  
  327. #===============================================================================
  328. # End of Settings! Editing anything below may lead to... you know it, right?
  329. #===============================================================================
  330.  
  331.   def self.modify(data,reload=false)
  332.     return unless $TEST
  333.     changed = false
  334.     inc_maps = Mods[data][:inc_maps]
  335.     exc_maps = Mods[data][:exc_maps]
  336.     inc_evs = Mods[data][:inc_evs]
  337.     exc_evs = Mods[data][:exc_evs]
  338.     mcmd = Mods[data][:command]
  339.     mparams = Mods[data][:params]
  340.    
  341.     display_cmd(mcmd)
  342.    
  343.     files = Dir.glob('Data/Map*.rvdata2')
  344.     files.each do |file|
  345.       next if file.include?("Infos")
  346.       if file =~ /Map(\d+).rvdata2/i
  347.         changed = false # Determines if something has been changed on the map or not
  348.         mid = $1.to_i
  349.         next if inc_maps && !inc_maps.include?(mid) # Included maps check
  350.         next if exc_maps && exc_maps.include?(mid)  # Excluded maps check
  351.         map = load_data(file)
  352.        
  353.         map.events.each do |eid,ev|
  354.           next if inc_evs && !inc_evs.include?(eid) # Included events check
  355.           next if exc_evs && exc_evs.include?(eid)  # Excluded events check
  356.          
  357.           ev.pages.each_with_index do |page,pnum|
  358.             page.list.each_with_index do |command,cnum|
  359.               next if command.code != mcmd      # Command code check              
  360.               cprms = command.parameters
  361.              
  362.               mparams.each do |pid,data|
  363.                 # For multi-conditions
  364.                 if pid.is_a?(Array)
  365.                   # Change only if there is a match
  366.                   if pid.all? {|piid| check_equal(cprms[piid],data[:current][piid]) }
  367.                     pid.each do |piid|
  368.                       # Change only if the param is not the same
  369.                       next if check_equal(cprms[piid],data[:new][piid])
  370.                       case cprms[piid]
  371.                       when RPG::AudioFile # Separate method for audio files!
  372.                         old = cprms[piid].to_ary
  373.                         new = []
  374.                         old.each_with_index do |prop,i|
  375.                           new[i] = data[:new][piid][i] || prop
  376.                         end
  377.                         audio = convert_audio(cprms[piid],new)
  378.                         display_data(mid,eid,pnum,cnum,piid,old,new)
  379.                         cprms[piid] = audio
  380.                       else
  381.                         if cprms[piid].is_a?(String) && data[:current][piid].is_a?(Regexp)
  382.                           new = cprms[piid].gsub(data[:current][piid],data[:new][piid])
  383.                           display_data(mid,eid,pnum,cnum,piid,cprms[piid],new)
  384.                           cprms[piid] = new
  385.                         else
  386.                           display_data(mid,eid,pnum,cnum,piid,cprms[piid],data[:new][piid])
  387.                           cprms[piid] = data[:new][piid]
  388.                         end
  389.                       end # Audio check end
  390.                       changed = true
  391.                     end # Param index iter end
  392.                   end # Param condition check end
  393.                 else
  394.                   # Change only if there is a match which is not the same
  395.                   if check_equal(cprms[pid],data[:current]) && !check_equal(cprms[pid],data[:new])
  396.                     case cprms[pid]
  397.                     when RPG::AudioFile # Separate method for audio files!
  398.                       old = cprms[pid].to_ary
  399.                       new = []
  400.                       old.each_with_index do |prop,i|
  401.                         new[i] = data[:new][i] || prop
  402.                       end
  403.                       audio = convert_audio(cprms[pid],new)
  404.                       display_data(mid,eid,pnum,cnum,pid,old,new)
  405.                       cprms[pid] = audio
  406.                     else
  407.                       if cprms[pid].is_a?(String) && data[:current].is_a?(Regexp)
  408.                         new = cprms[pid].gsub(data[:current],data[:new])
  409.                         display_data(mid,eid,pnum,cnum,pid,cprms[pid],new)
  410.                         cprms[pid] = new
  411.                       else
  412.                         display_data(mid,eid,pnum,cnum,pid,cprms[pid],data[:new])
  413.                         cprms[pid] = data[:new]
  414.                       end
  415.                     end # Audio check end
  416.                     changed = true
  417.                   end # Param condition check end
  418.                 end # Array check end
  419.               end # Param iter end
  420.              
  421.             end # page line iter close
  422.           end # event page iter close
  423.         end # event iter close
  424.        
  425.         if changed # Save only if there were changes made
  426.           save_data(map, sprintf("Data/Map%03d.rvdata2", mid))
  427.           # Reload map if requested and if it is the current map
  428.           if reload && $game_map && $game_map.map_id == mid
  429.             old_pos = [$game_map.display_x,$game_map.display_y]
  430.             $game_map.setup(mid)
  431.             $game_map.set_display_pos(*old_pos)
  432.           end
  433.         end
  434.        
  435.       end # file name check close
  436.     end # file iter close
  437.    
  438.   end
  439.  
  440.   def self.check_equal(current,check)
  441.     case current
  442.     when RPG::AudioFile # Separate method for audio files!
  443.       old = current.to_ary
  444.       check.each_with_index do |prop,i|
  445.         return false if prop && prop != old[i]
  446.       end
  447.       return true
  448.     when RPG::MoveRoute # Set Move Route commands are not supported yet!
  449.       return false
  450.     else
  451.       if current.is_a?(String) && check.is_a?(Regexp)
  452.         return current =~ check
  453.       else
  454.         return current == check
  455.       end
  456.     end
  457.   end
  458.  
  459.   def self.convert_audio(old,ary)
  460.     case old
  461.     when RPG::BGM; return RPG::BGM.new(*ary)
  462.     when RPG::BGS; return RPG::BGS.new(*ary)
  463.     when RPG::SE;  return RPG::SE.new(*ary)
  464.     when RPG::ME;  return RPG::ME.new(*ary)
  465.     end
  466.   end
  467.  
  468.   def self.display_cmd(code)
  469.     cname = cmd_name(code)
  470.     txt = "--> Looking up '#{cname}' commands..."
  471.     puts txt
  472.   end
  473.  
  474.   def self.display_data(mid,eid,pgid,cmindex,pid,oprm,nprm)
  475.     mtxt = sprintf("Map: %03d, ", mid)
  476.     etxt = sprintf("Ev: %03d, ", eid)
  477.     pgtxt = sprintf("Page: %03d, ", pgid)
  478.     itxt = sprintf("Line: %03d, ", cmindex)
  479.     ptxt = "Param #{pid}: #{oprm} → #{nprm}"
  480.     txt = mtxt + etxt + pgtxt + itxt + ptxt
  481.     puts txt
  482.   end
  483.  
  484.   def self.cmd_name(code)
  485.     case code
  486.     when 101; return "Show Text"
  487.     when 401; return "Show Text - Message Text Data"
  488.     when 102; return "Show Choices"
  489.     when 402; return "Show Choices - Choice Branches"
  490.     when 403; return "Show Choices - Cancel Branch"
  491.     when 103; return "Input Number"
  492.     when 104; return "Select Key Item"
  493.     when 105; return "Show Scrolling Text"
  494.     when 405; return "Show Scrolling Text - Message Text Data"
  495.    
  496.     when 108; return "Comment"
  497.     when 408; return "Comment - Continual"
  498.     when 111; return "Conditional Branch"
  499.     when 411; return "Conditional Branch - Else Branch"
  500.     when 112; return "Loop"
  501.     when 413; return "Repeat Above"
  502.     when 113; return "Break Loop"
  503.     when 115; return "Exit Event Processing"
  504.     when 117; return "Common Event"
  505.     when 118; return "Label"
  506.     when 119; return "Jump to Label"
  507.      
  508.     when 121; return "Control Switches"
  509.     when 122; return "Control Variables"
  510.     when 123; return "Control Self-Switches"
  511.     when 124; return "Control Timer"
  512.      
  513.     when 125; return "Change Gold"
  514.     when 126; return "Change Items"
  515.     when 127; return "Change Weapons"
  516.     when 128; return "Change Armors"
  517.     when 129; return "Change Party Member"
  518.      
  519.     when 132; return "Change Battle BGM"
  520.     when 133; return "Change Battle End ME"
  521.     when 134; return "Change Save Access"
  522.     when 135; return "Change Menu Access"
  523.     when 136; return "Change Encounter Disable"
  524.     when 137; return "Change Formation Access"
  525.     when 138; return "Change Window Color"
  526.    
  527.     when 201; return "Transfer Player"
  528.     when 202; return "Set Vehicle Location"
  529.     when 203; return "Set Event Location"
  530.     when 204; return "Scroll Map"
  531.     when 205; return "Set Mouve Route"
  532.     when 206; return "Get ON/OFF Vehicle"
  533.      
  534.     when 211; return "Change Transparency"
  535.     when 212; return "Show Animation"
  536.     when 213; return "Show Balloon"
  537.     when 214; return "Erase Event"
  538.     when 216; return "Change Player Followers"
  539.     when 217; return "Gather Followers"
  540.      
  541.     when 221; return "Fadeout Screen"
  542.     when 222; return "Fadein Screen"
  543.     when 223; return "Tint Screen"
  544.     when 224; return "Flash Screen"
  545.     when 225; return "Shake Screen"
  546.      
  547.     when 230; return "Wait"
  548.      
  549.     when 231; return "Show Picture"
  550.     when 232; return "Move Picture"
  551.     when 233; return "Rotate Picture"
  552.     when 234; return "Tint Picture"
  553.     when 235; return "Erase Picture"
  554.     when 236; return "Set Weather"
  555.      
  556.     when 241; return "Play BGM"
  557.     when 242; return "Fadeout BGM"
  558.     when 243; return "Save BGM"
  559.     when 244; return "Resume BGM"
  560.     when 245; return "Play BGS"
  561.     when 246; return "Fadeout BGS"
  562.     when 249; return "Play ME"
  563.     when 250; return "Play SE"
  564.     when 251; return "Stop SE"
  565.      
  566.     when 261; return "Play Movie"
  567.      
  568.     when 281; return "Change Map Name Display"
  569.     when 282; return "Change Tileset"
  570.     when 283; return "Change Battleback"
  571.     when 284; return "Change Parallax Background"
  572.     when 285; return "Get Location Info"
  573.      
  574.     when 301; return "Battle Processing"
  575.     when 601; return "Battle Processing - Win Branch"
  576.     when 602; return "Battle Processing - Escape Branch"
  577.     when 603; return "Battle Processing - Lose Branch"
  578.     when 302; return "Shop Processing"
  579.     when 605; return "Shop Processing - Rest of the Items"
  580.     when 303; return "Name Input Processing"
  581.      
  582.     when 311; return "Change HP"
  583.     when 312; return "Change MP"
  584.     when 313; return "Change State"
  585.     when 314; return "Recover All"
  586.     when 315; return "Change EXP"
  587.     when 316; return "Change Level"
  588.     when 317; return "Change Parameters"
  589.     when 318; return "Change Skills"
  590.     when 319; return "Change Equipment"
  591.     when 320; return "Change Name"
  592.     when 321; return "Change Class"
  593.     when 322; return "Change Actor Graphic"
  594.     when 323; return "Change Vehicle Graphic"
  595.     when 324; return "Change Nickname"
  596.      
  597.     when 331; return "Change Enemy HP"
  598.     when 332; return "Change Enemy MP"
  599.     when 333; return "Change Enemy State"
  600.     when 334; return "Enemy Recover All"
  601.     when 335; return "Enemy Appear"
  602.     when 336; return "Enemy Transform"
  603.     when 337; return "Show Battle Animation"
  604.     when 339; return "Force Action"
  605.     when 340; return "Abort Battle"
  606.      
  607.     when 351; return "Open Menu Screen"
  608.     when 352; return "Open Save Screen"
  609.     when 353; return "Game Over"
  610.     when 354; return "Return to Title Screen"
  611.      
  612.     when 355; return "Script"
  613.     when 655; return "Script - Continued"
  614.      
  615.     else;     return "Wrong Command Code!" # This should never come up anyway...
  616.      
  617.     end
  618.   end
  619.  
  620. end
  621.  
  622. class RPG::AudioFile
  623.  
  624.   def to_ary
  625.     return [@name,@volume,@pitch]
  626.   end
  627.  
  628. end
  629.  
  630. class Game_Map
  631.  
  632.   attr_accessor :display_x, :display_y
  633.  
  634. end
  635.  
  636. class Game_Interpreter
  637.  
  638.   def command_225 # Fixes the Screen Shake event command bug
  639.     screen.start_shake(@params[0], @params[1], @params[2])
  640.     wait(@params[2]) if @params[3] # Bug here by default, wrong params used!
  641.   end
  642.  
  643. end
  644. #==============================================================================
  645. # !!END OF SCRIPT - OHH, NOES!!
  646. #==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement