SHARE
TWEET

Extract Events to Text File (VX Ace)

ezmash Sep 14th, 2013 (edited) 2,909 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #============================================================================
  2. # EXTRACT EVENTS
  3. # v1.01 by Shaz
  4. #----------------------------------------------------------------------------
  5. # This script extracts ALL event commands into a number of text files.
  6. # These can be opened in a spreadsheet, split into columns, searched and
  7. # sorted.
  8. #
  9. # Data/_EventContents.txt
  10. # Contains ALL event commands
  11. # - useful for perusing, searching for anything in any event
  12. # - this also includes everything in the following two files
  13. #
  14. # Data/_EventDialogue.txt
  15. # A subset of _EventContents.txt
  16. # Contains any event commands to do with text - Show Text, Show Choices,
  17. # actor names, etc
  18. # - useful for proofreading and translation (there is no facility to replace
  19. #   text with translations - this is JUST an extract)
  20. #
  21. # Data/_EventSwitchesVariables.txt
  22. # A subset of _EventContents.txt
  23. # Contains any event commands and conditions to do with switches and variables
  24. # - useful for finding where they've been used
  25. #----------------------------------------------------------------------------
  26. # To Install:
  27. # Copy and paste into a new slot in materials, below all other scripts
  28. #----------------------------------------------------------------------------
  29. # To Customize:
  30. # Change the values of the following constants and variables
  31. #
  32. #  EXPORT_COMMON_EVENTS = true
  33. #    true to export common events
  34. #    false to exclude common events
  35. #
  36. #  EXPORT_BATTLE_EVENTS = true
  37. #    true to export battle events
  38. #    false to export battle events
  39. #
  40. #  MAP_START = 1
  41. #  MAP_END = 999
  42. #    range of maps to include
  43. #    set to 1 and 999 for all maps
  44. #    change both to the same map number to export just a single map
  45. #
  46. #  EXPAND_MOVE_ROUTES = true
  47. #    true to export every line in a move route command
  48. #    false to export the move route "heading" only, but no individual move route commands
  49. #
  50. #  INDENT = true
  51. #  @ind = ". "
  52. #    true to indent text within blocks, as you see it in the editor
  53. #    false to align everything to the left
  54. #    if true, @ind is the string that will be repeated to show indenting
  55. #
  56. #  @cb = "^"
  57. #    column break character - this MUST be something that is not used
  58. #    in any text or Call Script commands
  59. #
  60. #  @lb = "\n"
  61. #    line break character - changing this is not recommended
  62. #
  63. #----------------------------------------------------------------------------
  64. # To Use:
  65. # You do not "call" this script.  
  66. # Paste it, hit Play Test.
  67. # When your title screen appears, the script has run and the files have been
  68. # created.
  69. #
  70. # The script will run every time you play unless you disable it.  
  71. # Once you've run it once, edit the script and disable the whole thing
  72. # (Ctrl A to select all, Ctrl Q to disable)
  73. # Enable it when you want to run it again (same key sequence)
  74. #
  75. # Once the files have been created, open them in a spreadsheet and use the
  76. # Text to Columns feature to separate based on your chosen delimiter
  77. #----------------------------------------------------------------------------
  78. # Terms:
  79. # This is a DEVELOPMENT ONLY script.  You may use it when creating free or
  80. # commercial games, but PLEASE remove the script before the game is released.
  81. # You do NOT need to credit me in the game.
  82. # If you share this script, PLEASE keep this header intact, and include a
  83. # link back to the original RPG Maker Web forum post.
  84. #----------------------------------------------------------------------------
  85. # Revisions:
  86. # 1.01  Jun 22 2014   Fix troop condition crash
  87. #============================================================================
  88.  
  89.  
  90. class Game_Event < Game_Character
  91.   attr_reader    :event
  92.   attr_reader    :name
  93.   attr_reader    :pages
  94.  
  95.   alias shaz_ee_game_event_initialize initialize
  96.   def initialize(map_id, event)
  97.     @name = event.name
  98.     @pages = event.pages
  99.     shaz_ee_game_event_initialize(map_id, event)
  100.   end
  101. end
  102.  
  103. module EVExport
  104.   EXPORT_COMMON_EVENTS = true
  105.   EXPORT_BATTLE_EVENTS = true
  106.   MAP_START = 1
  107.   MAP_END = 999
  108.   EXPAND_MOVE_ROUTES = true
  109.   INDENT = true
  110.  
  111.   @cb = "^"
  112.   @lb = "\n"
  113.   @ind = ". "
  114.  
  115.   @expline = 0
  116.  
  117.   def self.export
  118.     DataManager.load_normal_database
  119.     DataManager.create_game_objects
  120.     @file_all = File.open('Data/_EventContents.txt', 'w')
  121.     @file_text = File.open('Data/_EventDialogue.txt', 'w')
  122.     @file_swvar = File.open('Data/_EventSwitchesVariables.txt', 'w')
  123.    
  124.     text = sprintf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
  125.       'Seq', @cb, 'Type', @cb, 'Source', @cb, 'Event ID', @cb, 'Name', @cb,
  126.       'Page', @cb, 'Line', @cb, 'Code', @cb, 'Command', @cb, 'Arguments', @lb)
  127.      
  128.     @file_all.print(text)
  129.     @file_text.print(text)
  130.    
  131.     text = sprintf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
  132.       'Seq', @cb, 'Type', @cb, 'Source', @cb, 'Event ID', @cb, 'Name', @cb,
  133.       'Page', @cb, 'Line', @cb, 'Code', @cb, 'Command', @cb, 'Switch/Var', @cb,
  134.       'Arguments', @lb)
  135.    
  136.     @file_swvar.print(text)
  137.    
  138.     @mapnames = []
  139.     for m in 1...999
  140.       if File.exists?(sprintf('Data/Map%03d.rvdata2', m))
  141.         @mapnames[m] = load_data(sprintf("Data/Map%03d.rvdata2", m)).display_name
  142.       else
  143.         @mapnames[m] = 'undefined'
  144.       end
  145.     end
  146.    
  147.     @sv3 = nil
  148.     self.export_common_events if EXPORT_COMMON_EVENTS
  149.     self.export_battle_events if EXPORT_BATTLE_EVENTS
  150.     @event_seq = 3
  151.     for m in MAP_START .. MAP_END
  152.       self.export_map_events(m) if File.exists?(sprintf('Data/Map%03d.rvdata2', m))
  153.     end
  154.    
  155.     @file_all.close
  156.     @file_text.close
  157.   end
  158.  
  159.   def self.export_common_events
  160.     @event_seq = 1
  161.     @event_type = "Common Event"
  162.     @event_tab = ""
  163.     for @event in $data_common_events.compact
  164.       @event_source = sprintf("%d%s%s", @event.id, @cb, @event.name)
  165.       @list = @event.list
  166.       self.export_common_event_conditions
  167.       self.export_event_list
  168.     end
  169.   end
  170.  
  171.   def self.export_battle_events
  172.     @event_seq = 2
  173.     for troop in $data_troops
  174.       next if troop.nil?
  175.       @event_type = "Troop"
  176.       @event_source = sprintf("%d%s%s", troop.id, @cb, troop.name)
  177.       for index in 0..troop.pages.size - 1
  178.         @event_tab = index.to_s
  179.         page = troop.pages[index]
  180.         @cond = page.condition
  181.         @list = page.list
  182.         self.export_troop_event_conditions
  183.         self.export_event_list
  184.       end
  185.     end
  186.   end
  187.  
  188.   def self.export_map_events(m)
  189.     $game_map.setup(m)
  190.     @event_type = sprintf("Map %3d (%s - %s)", m, $game_map.display_name, @mapnames[m])
  191.    
  192.     for event_key in $game_map.events.keys
  193.       @event = $game_map.events[event_key]
  194.       next if @event.nil? || @event.pages.nil?
  195.       @event_source = sprintf("%d%sEV%03d (%d,%d) - %s", @event.id, @cb, @event.id,
  196.       @event.event.x, @event.event.y, @event.name)
  197.       for page in 0..@event.pages.size - 1
  198.         @event_tab = (page + 1).to_s
  199.         @cond = @event.pages[page].condition
  200.         @list = @event.pages[page].list
  201.         self.export_map_event_conditions
  202.         self.export_event_list
  203.       end
  204.     end
  205.   end
  206.  
  207.   def self.export_common_event_conditions
  208.     @line = 0
  209.     @sv2 = nil
  210.     if @event.trigger != 0
  211.       @swvar_export = true
  212.       @sv1 = get_switch(@event.switch_id)
  213.       @cmd = "Switch"
  214.       @arg = sprintf('%s is ON', @sv1)
  215.       self.export_condition
  216.     end
  217.   end
  218.  
  219.   def self.export_troop_event_conditions
  220.     @line = 0
  221.     @sv1 = nil
  222.     @sv2 = nil
  223.     if @cond.turn_ending
  224.       @cmd = 'Turn'
  225.       @arg = 'End of turn'
  226.       @swvar_export = false
  227.       self.export_condition
  228.     end
  229.     if @cond.turn_valid
  230.       @cmd = 'Turn'
  231.       @arg = sprintf('Turn no. %d + %d * X', @cond.turn_a, @cond.turn_b)
  232.       @swvar_export = false
  233.       self.export_condition
  234.     end
  235.     if @cond.enemy_valid
  236.       @cmd = 'Enemy'
  237.       @arg = sprintf('Enemy %d\'s HP is %d%% or below', @cond.enemy_index,
  238.         @cond.enemy_hp)
  239.       @swvar_export = false
  240.       self.export_condition
  241.     end
  242.     if @cond.actor_valid
  243.       @cmd = 'Actor'
  244.       @arg = sprintf('Actor %d\'s HP is %d%% or below', @cond.actor_id,
  245.         @cond.actor_hp)
  246.       @swvar_export = false
  247.       self.export_condition
  248.     end
  249.     if @cond.switch_valid
  250.       @sv1 = get_switch(@cond.switch_id)
  251.       @cmd = 'Switch'
  252.       @arg = sprintf('%s is ON', @sv1)
  253.       @swvar_export = true
  254.       self.export_condition
  255.     end
  256.   end
  257.  
  258.   def self.export_map_event_conditions
  259.     @line = 0
  260.     @sv2 = nil
  261.     @swvar_export = true
  262.     if @cond.switch1_valid
  263.       @sv1 = get_switch(@cond.switch1_id)
  264.       @cmd = 'Switch'
  265.       @arg = sprintf('%s is ON', @sv1)
  266.       self.export_condition
  267.     end
  268.     if @cond.switch2_valid
  269.       @sv1 = get_switch(@cond.switch2_id)
  270.       @cmd = 'Switch'
  271.       @arg = sprintf('%s is ON', @sv1)
  272.       self.export_condition
  273.     end
  274.     @sv1 = nil
  275.     if @cond.variable_valid
  276.       @sv1 = get_variable(@cond.variable_id)
  277.       @cmd = 'Variable'
  278.       @arg = sprintf('%s >= %d', @sv1, @cond.variable_value)
  279.       self.export_condition
  280.     end
  281.     @swvar_export = false
  282.     if @cond.self_switch_valid
  283.       @cmd = 'Self Switch'
  284.       @arg = sprintf('Self Switch %s is ON', @cond.self_switch_ch)
  285.       self.export_condition
  286.     end
  287.     if @cond.item_valid
  288.       @cmd = 'Item'
  289.       @arg = sprintf('Item %d (%s) is in Inventory', @cond.item_id,
  290.         self.item_name(@cond.item_id))
  291.       self.export_condition
  292.     end
  293.     if @cond.actor_valid
  294.       @cmd = 'Actor'
  295.       @arg = sprintf('Actor %d (%s) is in the Party', @cond.actor_id,
  296.         self.actor_name(@cond.actor_id))
  297.       self.export_condition
  298.     end
  299.   end
  300.  
  301.   def self.export_event_list
  302.     return if @list.nil?
  303.     @cmdline = 0
  304.    
  305.     while @cmdline < @list.size
  306.       @line = @cmdline + 1
  307.       @command = @list[@cmdline]
  308.       @params = @command.parameters.clone
  309.       @indent = @command.indent
  310.       @cmd = ""
  311.       @arg = ""
  312.       @sv1 = nil
  313.       @sv2 = nil
  314.       @sv3 = nil
  315.       @skip_export = false
  316.       @text_export = false
  317.       @swvar_export = false
  318.       method_name = "command_#{@command.code}"
  319.       send(method_name) if respond_to?(method_name)
  320.       self.export_command if !@skip_export
  321.       @cmdline += 1
  322.     end
  323.   end
  324.  
  325.   def self.get_switch(id)
  326.     sprintf('Switch %04d [%s]', id, $data_system.switches[id])
  327.   end
  328.  
  329.   def self.get_variable(id)
  330.     sprintf('Variable %04d [%s]', id, $data_system.variables[id])
  331.   end
  332.  
  333.   def self.actor_name(id)
  334.     $data_actors[id].nil? ? 'undefined' : $data_actors[id].name
  335.   end
  336.  
  337.   def self.class_name(id)
  338.     $data_classes[id].nil? ? 'undefined' : $data_classes[id].name
  339.   end
  340.  
  341.   def self.skill_name(id)
  342.     $data_skills[id].nil? ? 'undefined' : $data_skills[id].name
  343.   end
  344.  
  345.   def self.item_name(id)
  346.     $data_items[id].nil? ? 'undefined' : $data_items[id].name
  347.   end
  348.  
  349.   def self.weapon_name(id)
  350.     $data_weapons[id].nil? ? 'undefined' : $data_weapons[id].name
  351.   end
  352.  
  353.   def self.armor_name(id)
  354.     $data_armors[id].nil? ? 'undefined' : $data_armors[id].name
  355.   end
  356.  
  357.   def self.enemy_name(id)
  358.     $data_enemies[id].nil? ? 'undefined' : $data_enemies[id].name
  359.   end
  360.  
  361.   def self.troop_name(id)
  362.     $data_troops[id].nil? ? 'undefined' : $data_troops[id].name
  363.   end
  364.  
  365.   def self.state_name(id)
  366.     $data_states[id].nil? ? 'undefined' : $data_states[id].name
  367.   end
  368.  
  369.   def self.animation_name(id)
  370.     $data_animations[id].nil? ? 'undefined' : $data_animations[id].name
  371.   end
  372.  
  373.   def self.tileset_name(id)
  374.     $data_tilesets[id].nil? ? 'undefined' : $data_tilesets[id].name
  375.   end
  376.  
  377.   def self.common_event_name(id)
  378.     $data_common_events[id].nil? ? 'undefined' : $data_common_events[id].name
  379.   end
  380.    
  381.   def self.next_event_code
  382.     @list[@cmdline + 1].code
  383.   end
  384.  
  385.   def self.get_operator(operator)
  386.     return ['=', '+=', '-=', '*=', '/=', '%='][operator]
  387.   end
  388.    
  389.   def self.operate_value(sign, value, const = true)
  390.     @swvar_export = !const
  391.     @sv1 = get_variable(value) if @swvar_export
  392.     return sprintf("%s %s", (sign == 0 ? "+" : "-"),
  393.       (const ? value.to_s : sprintf("%s", @sv1)))
  394.   end
  395.  
  396.   def self.get_actor(type, id)
  397.     @swvar_export = type != 0
  398.     @sv1 = get_variable(id) if @swvar_export
  399.     return type == 0 ? (id == 0 ? "All actors" : sprintf('Actor %d (%s)', id,
  400.       self.actor_name(id))) : sprintf('Actor %s', @sv1)
  401.   end
  402.  
  403.   def self.get_enemy(id)
  404.     return id < 0 ? "All enemies" : ("Enemy " + id.to_s)
  405.   end
  406.    
  407.   def self.get_character(character)
  408.     return character < 0 ? "Player" : character > 0 ? ("Event " + character.to_s) :
  409.       "This event"
  410.   end
  411.    
  412.   def self.get_direction(dir)
  413.     return ['', '', 'down', '', 'left', '', 'right', '', 'up'][dir]
  414.   end
  415.  
  416.   def self.get_audio(audio)
  417.     return sprintf("%s;  Volume %d  Pitch %d", audio.name, audio.volume, audio.pitch)
  418.   end
  419.  
  420.   def self.get_vehicle(vehicle)
  421.     return ['boat', 'ship', 'airship'][vehicle]
  422.   end
  423.  
  424.   def self.get_map_loc(map, x, y, const = true)
  425.     @swvar_export = !const
  426.     if const
  427.       return sprintf("%d (%s - %s), (%d, %d)", map, @mapnames[map],
  428.         $data_mapinfos[map] ? $data_mapinfos[map].name : 'unknown', x, y)
  429.     else
  430.       @sv1 = get_variable(map)
  431.       @sv2 = get_variable(x)
  432.       @sv3 = get_variable(y)
  433.       return sprintf("%s, (%s, %s)", @sv1, @sv2, @sv3)
  434.     end
  435.   end
  436.  
  437.   def self.get_loc(x, y, const = true)
  438.     if const
  439.       return sprintf("(%d, %d)", x, y)
  440.     else
  441.       @swvar_export = true
  442.       @sv1 = get_variable(x)
  443.       @sv2 = get_variable(y)
  444.       return sprintf("(%s, %s)", @sv1, @sv2)
  445.     end
  446.   end
  447.  
  448.   def self.command_0
  449.     @skip_export = true
  450.   end
  451.   def self.command_505
  452.     @skip_export = true
  453.   end
  454.   def self.command_404
  455.     @cmd = "End Show Choices"
  456.     @arg = 'end choices'
  457.   end
  458.   def self.command_412
  459.     @cmd = "End Conditional Branch"
  460.     @arg = 'end condition'
  461.   end
  462.   def self.command_604
  463.     @cmd = "End Battle Result"
  464.     @arg = 'end battle result'
  465.   end
  466.  
  467.   #--------------------------------------------------------------------------
  468.   # * Show Text
  469.   #--------------------------------------------------------------------------
  470.   def self.command_101
  471.     @text_export = true
  472.     @cmd = "Show Text"
  473.     @arg = sprintf('Face: %s (index %d) on %s at %s',
  474.       (@params[0] == "" ? 'none' : @params[0]), @params[1],
  475.       ['normal window', 'dim background', 'transparent'][@params[2]],
  476.       ['top', 'middle', 'bottom'][@params[3]])
  477.   end
  478.   def self.command_401
  479.     @text_export = true
  480.     @cmd = "Show Text"
  481.     @arg = @params[0]
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # * Show Choices
  485.   #--------------------------------------------------------------------------
  486.   def self.command_102
  487.     @text_export = true
  488.     @cmd = "Show Choices"
  489.     for choice in @params[0]
  490.       @arg += choice + "; "
  491.     end
  492.   end
  493.   #--------------------------------------------------------------------------
  494.   # * When [**]
  495.   #--------------------------------------------------------------------------
  496.   def self.command_402
  497.     @text_export = true
  498.     @cmd = "When [**]"
  499.     @arg = "When " + @params[1]
  500.   end
  501.   #--------------------------------------------------------------------------
  502.   # * When Cancel
  503.   #--------------------------------------------------------------------------
  504.   def self.command_403
  505.     @text_export = true
  506.     @cmd = "When Cancel"
  507.     @arg = "When Cancel"
  508.   end
  509.   #--------------------------------------------------------------------------
  510.   # * Input Number
  511.   #--------------------------------------------------------------------------
  512.   def self.command_103
  513.     @cmd = "Input Number"
  514.     @sv1 = get_variable(@params[0])
  515.     @arg = sprintf("%s  Digits: %d", @sv1, @params[1])
  516.     @swvar_export = true
  517.   end
  518.   #--------------------------------------------------------------------------
  519.   # * Select Item
  520.   #--------------------------------------------------------------------------
  521.   def self.command_104
  522.     @cmd = "Select Item"
  523.     @sv1 = @params[0]
  524.     @args = sprintf("%s", @sv1)
  525.     @swvar_export = true
  526.   end
  527.   #--------------------------------------------------------------------------
  528.   # * Show Scrolling Text
  529.   #--------------------------------------------------------------------------
  530.   def self.command_105
  531.     @text_export = true
  532.     @cmd = "Show Scrolling Text"
  533.     while next_event_code == 405
  534.       @cmdline += 1
  535.       @arg += @list[@cmdline].parameters[0] + " "
  536.     end
  537.   end
  538.   #--------------------------------------------------------------------------
  539.   # * Comment
  540.   #--------------------------------------------------------------------------
  541.   def self.command_108
  542.     @cmd = "Comment"
  543.     @arg = @params[0]
  544.   end
  545.   def self.command_408
  546.     @cmd = "Comment"
  547.     @arg = @params[0]
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # * Conditional Branch
  551.   #--------------------------------------------------------------------------
  552.   def self.command_111
  553.     @cmd = "Conditional Branch"
  554.     @arg = "IF "
  555.     case @params[0]
  556.     when 0 # Switch
  557.       @swvar_export = true
  558.       @sv1 = get_switch(@params[1])
  559.       @arg += sprintf("%s is %s", @sv1, (@params[2] == 0 ? "ON" : "OFF"))
  560.     when 1 # Variable
  561.       @swvar_export = true
  562.       @sv1 = get_variable(@params[1])
  563.       @arg += sprintf("%s %s ", @sv1, ['==', '>=', '<=', '>', '<', '!='][@params[4]])
  564.       if @params[2] == 0 #constant
  565.         @arg += @params[3].to_s
  566.       else
  567.         @sv2 = get_variable(@params[3])
  568.         @arg += sprintf("%s", @sv2)
  569.       end
  570.     when 2 # Self Switch
  571.       @arg += sprintf("Self Switch %s is %s", @params[1],
  572.         (@params[2] == 0 ? "ON" : "OFF"))
  573.     when 3 # Timer
  574.       @arg += sprintf("Timer: %d minutes %d seconds or %s", @params[1]/60,
  575.         @params[1]%60, (@params2 == 0 ? "more" : "less"))
  576.     when 4 # Actor
  577.       @arg += sprintf("Actor %d (%s): ", @params[1], self.actor_name(@params[1]))
  578.       case @params[2]
  579.       when 0
  580.         @arg += "is in the party"
  581.       when 1
  582.         @text_export = true
  583.         @arg += sprintf("name is %s", @params[3])
  584.       when 2
  585.         @arg += sprintf("is class %d (%s)", @params[3], self.class_name(@params[3]))
  586.       when 3
  587.         @arg += sprintf("knows skill %d (%s)", @params[3], self.skill_name(@params[3]))
  588.       when 4
  589.         @arg += sprintf("has weapon %d (%s) equipped", @params[3], self.weapon_name(@params[3]))
  590.       when 5
  591.         @arg += sprintf("has armor %d (%s) equipped", @params[3], self.armor_name(@params[3]))
  592.       when 6
  593.         @arg += sprintf("has state %d (%s) applied", @params[3], self.state_name(@params[3]))
  594.       end
  595.     when 5 # Enemy
  596.       @arg += sprintf("Enemy %d ", @params[1])
  597.       case @params[2]
  598.       when 0 # appear
  599.         @arg += "is visible"
  600.       when 1 # state
  601.         @arg += sprintf("has state %d (%s) applied", @params[3], self.state_name(@params[3]))
  602.       end
  603.     when 6 # Character facing
  604.       @arg += sprintf("%s is facing %s", self.get_character(@params[1]),
  605.         self.get_direction(@params[2]))
  606.     when 7 # Gold
  607.       @arg += sprintf("Gold %s %d", (@params[2] == 0 ? ">=" : @params[2] == 1 ? "<=" : "<"),
  608.         @params[1])
  609.     when 8 # Item
  610.       @arg += sprintf("Party has item %d (%s)", @params[1], self.item_name(@params[1]))
  611.     when 9 # Weapon
  612.       @arg += sprintf("Party has weapon %d (%s)", @params[1],
  613.         self.weapon_name(@params[1]))
  614.       @arg += ' (including equipped)' if @params[2]
  615.     when 10 # Armor
  616.       @arg += sprintf("Party has armor %d (%s)", @params[1],
  617.         self.armor_name(@params[1]))
  618.       @arg += ' (including equipped)' if @params[2]
  619.     when 11 # Button
  620.       @arg += sprintf("Button %s is pressed", ['0', '1', 'down', '3', 'left', '5', 'right',
  621.         '7', 'up', '9', '10', 'A', 'B', 'C', 'X', 'Y', 'Z', 'L', 'R'][@params[1]])
  622.     when 12 # Script
  623.       @arg += sprintf("Script (%s)", @params[1])
  624.     when 13 # Vehicle
  625.       @arg += sprintf("Player is in %s", self.get_vehicle(@params[1]))
  626.     end
  627.   end
  628.   #--------------------------------------------------------------------------
  629.   # * Else
  630.   #--------------------------------------------------------------------------
  631.   def self.command_411
  632.     @cmd = "Else"
  633.     @arg = "Else"
  634.   end
  635.   #--------------------------------------------------------------------------
  636.   # * Loop
  637.   #--------------------------------------------------------------------------
  638.   def self.command_112
  639.     @cmd = "Loop"
  640.     @arg = "Loop"
  641.   end
  642.   #--------------------------------------------------------------------------
  643.   # * Repeat Above
  644.   #--------------------------------------------------------------------------
  645.   def self.command_413
  646.     @cmd = "Repeat Above"
  647.     @arg = "Repeat Above"
  648.   end
  649.   #--------------------------------------------------------------------------
  650.   # * Break Loop
  651.   #--------------------------------------------------------------------------
  652.   def self.command_113
  653.     @cmd = "Break Loop"
  654.     @arg = "Break Loop"
  655.   end
  656.   #--------------------------------------------------------------------------
  657.   # * Exit Event Processing
  658.   #--------------------------------------------------------------------------
  659.   def self.command_115
  660.     @cmd = "Exit Event Processing"
  661.     @arg = "Exit Event Processing"
  662.   end
  663.   #--------------------------------------------------------------------------
  664.   # * Common Event
  665.   #--------------------------------------------------------------------------
  666.   def self.command_117
  667.     @cmd = "Common Event"
  668.     @arg = sprintf("Common Event %03d (%s)", @params[0],
  669.       self.common_event_name(@params[0]))
  670.   end
  671.   #--------------------------------------------------------------------------
  672.   # * Label
  673.   #--------------------------------------------------------------------------
  674.   def self.command_118
  675.     @cmd = "Label"
  676.     @arg = @params[0]
  677.   end
  678.   #--------------------------------------------------------------------------
  679.   # * Jump to Label
  680.   #--------------------------------------------------------------------------
  681.   def self.command_119
  682.     @cmd = "Jump to Label"
  683.     @arg = @params[0]
  684.   end
  685.   #--------------------------------------------------------------------------
  686.   # * Control Switches
  687.   #--------------------------------------------------------------------------
  688.   def self.command_121
  689.     @cmd = "Control Switches"
  690.     @swvar_export = true
  691.     for s in @params[0]..@params[1]
  692.       @sv1 = get_switch(s)
  693.       @arg = sprintf("%s = %s", @sv1, (@params[2] == 0 ? "ON" : "OFF"))
  694.       self.export_command
  695.     end
  696.     @skip_export = true  
  697.   end
  698.   #--------------------------------------------------------------------------
  699.   # * Control Variables
  700.   #--------------------------------------------------------------------------
  701.   def self.command_122
  702.     @cmd = "Control Variables"
  703.     @swvar_export = true
  704.     case @params[3]
  705.     when 0 # Constant
  706.       value = @params[4].to_s
  707.     when 1 # Variable
  708.       @sv2 = get_variable(@params[4])
  709.       value = sprintf("%s", @sv2)
  710.     when 2 # Random
  711.       value = sprintf("Random %d - %d", @params[4], @params[5])
  712.     when 3 # Game Data
  713.       case @params[4]
  714.       when 0 # Items
  715.         value = sprintf("Item %d (%s) in inventory", @params[5], self.item_name(@params[5]))
  716.       when 1 # Weapons
  717.         value = sprintf("Weapon %d (%s) in inventory", @params[5], self.item_name(@params[5]))
  718.       when 2 # Armor
  719.         value = sprintf("Armor %d (%s) in inventory", @params[5], self.item_name(@params[5]))
  720.       when 3 # Actor
  721.         value = sprintf("Actor %d's (%s) %s", @params[5], self.actor_name(@params[5]),
  722.           ['level', 'EXP', 'HP', 'MP', 'MHP', 'MMP', 'ATK', 'DEF', 'MAT', 'MDF',
  723.           'AGI', 'LUK'][@params[6]])
  724.       when 4 # Enemy
  725.         value = sprintf("Enemy %d's %s", @params[5],
  726.           ['HP', 'MP', 'MHP', 'MMP', 'ATK', 'DEF', 'MAT', 'MDF',
  727.           'AGI', 'LUK'][@params[6]])
  728.       when 5 # Character
  729.         value = sprintf("%s's %s", self.get_character(@params[5]),
  730.           ['x coordinate', 'y coordinate', 'direction', 'screen x coordinate',
  731.           'screen y coordinate'][@params[6]])
  732.       when 6 # Party
  733.         value = sprintf("Party member %d's id", @params[5])
  734.       when 7 # Other
  735.         value = ['Map ID', 'Party Size', 'Gold', 'Steps', 'Play Time', 'Timer',
  736.           'Save Count', 'Battle Count'][@params[5]]
  737.       end
  738.     when 4 # Script
  739.       value = sprintf("Script: %s", @params[4])
  740.     end
  741.    
  742.     operator = get_operator(@params[2])
  743.  
  744.     (@params[0]..@params[1]).each do |i|
  745.       @sv1 = get_variable(i)
  746.       @arg = sprintf("%s %s %s", @sv1, operator, value)
  747.       self.export_command
  748.     end
  749.     @skip_export = true
  750.   end
  751.   #--------------------------------------------------------------------------
  752.   # * Control Self Switch
  753.   #--------------------------------------------------------------------------
  754.   def self.command_123
  755.     @cmd = "Control Self Switch"
  756.     @arg = sprintf("Self Switch %s = %s", @params[0], (@params[1] ? "true" : "false"))
  757.   end
  758.   #--------------------------------------------------------------------------
  759.   # * Control Timer
  760.   #--------------------------------------------------------------------------
  761.   def self.command_124
  762.     @cmd = "Control Timer"
  763.     if @params[0] == 0
  764.       @arg = sprintf("Start Timer at %d minutes, %d seconds", @params[1]/60, @params[1]%60)
  765.     else
  766.       @arg = "Stop Timer"
  767.     end
  768.   end
  769.   #--------------------------------------------------------------------------
  770.   # * Change Gold
  771.   #--------------------------------------------------------------------------
  772.   def self.command_125
  773.     @cmd = "Change Gold"
  774.     @arg = sprintf("%s", self.operate_value(@params[0], @params[2], @params[1] == 0))
  775.   end
  776.   #--------------------------------------------------------------------------
  777.   # * Change Items
  778.   #--------------------------------------------------------------------------
  779.   def self.command_126
  780.     @cmd = "Change Items"
  781.     @arg = sprintf("Item %d (%s) %s", @params[0], self.item_name(@params[0]),
  782.       self.operate_value(@params[1], @params[3], @params[2] == 0))
  783.   end
  784.   #--------------------------------------------------------------------------
  785.   # * Change Weapons
  786.   #--------------------------------------------------------------------------
  787.   def self.command_127
  788.     @cmd = "Change Weapons"
  789.     @arg = sprintf("Weapon %d (%s) %s", @params[0], self.weapon_name(@params[0]),
  790.       self.operate_value(@params[1], @params[3], @params[2] == 0))
  791.     @arg += " (include equipped)" if @params[1] == 0 && @params[4]
  792.   end
  793.   #--------------------------------------------------------------------------
  794.   # * Change Armor
  795.   #--------------------------------------------------------------------------
  796.   def self.command_128
  797.     @cmd = "Change Armor"
  798.     @arg = sprintf("Armor %d (%s) %s", @params[0], self.armor_name(@params[0]),
  799.       self.operate_value(@params[1], @params[3], @params[2] == 0))
  800.     @arg += " (include equipped)" if @params[1] == 0 && @params[4]
  801.   end
  802.   #--------------------------------------------------------------------------
  803.   # * Change Party Member
  804.   #--------------------------------------------------------------------------
  805.   def self.command_129
  806.     @cmd = "Change Party Member"
  807.     @arg = sprintf("%s %s %s", (@params[1] == 0 ? "+" : "-"), self.get_actor(0, @params[0]),
  808.       (@params[1] == 0 && @params[2] == 1 ? "(initialize)" : ""))
  809.   end
  810.   #--------------------------------------------------------------------------
  811.   # * Change Battle BGM
  812.   #--------------------------------------------------------------------------
  813.   def self.command_132
  814.     @cmd = "Change Battle BGM"
  815.     @arg = sprintf("BGM %s", self.get_audio(@params[0]))
  816.   end
  817.   #--------------------------------------------------------------------------
  818.   # * Change Battle End ME
  819.   #--------------------------------------------------------------------------
  820.   def self.command_133
  821.     @cmd = "Change Battle End ME"
  822.     @arg = sprintf("ME %s", self.get_audio(@params[0]))
  823.   end
  824.   #--------------------------------------------------------------------------
  825.   # * Change Save Access
  826.   #--------------------------------------------------------------------------
  827.   def self.command_134
  828.     @cmd = "Change Save Access"
  829.     @arg = @params[0] == 0 ? "disable" : "enable"
  830.   end
  831.   #--------------------------------------------------------------------------
  832.   # * Change Menu Access
  833.   #--------------------------------------------------------------------------
  834.   def self.command_135
  835.     @cmd = "Change Menu Access"
  836.     @arg = @params[0] == 0 ? "disable" : "enable"
  837.   end
  838.   #--------------------------------------------------------------------------
  839.   # * Change Encounter Disable
  840.   #--------------------------------------------------------------------------
  841.   def self.command_136
  842.     @cmd = "Change Encounter Disable"
  843.     @arg = @params[0] == 0 ? "disable" : "enable"
  844.   end
  845.   #--------------------------------------------------------------------------
  846.   # * Change Formation Access
  847.   #--------------------------------------------------------------------------
  848.   def self.command_137
  849.     @cmd = "Change Formation Access"
  850.     @arg = @params[0] == 0 ? "disable" : "enable"
  851.   end
  852.   #--------------------------------------------------------------------------
  853.   # * Change Window Color
  854.   #--------------------------------------------------------------------------
  855.   def self.command_138
  856.     @cmd = "Change Window Color"
  857.     @arg = @params[0].to_s
  858.   end
  859.   #--------------------------------------------------------------------------
  860.   # * Transfer Player
  861.   #--------------------------------------------------------------------------
  862.   def self.command_201
  863.     @cmd = "Transfer Player"
  864.     @arg = sprintf("Map %s", self.get_map_loc(@params[1], @params[2], @params[3],
  865.       @params[0] == 0))
  866.     @arg += ' Direction: ' + self.get_direction(@params[4])
  867.   end
  868.   #--------------------------------------------------------------------------
  869.   # * Set Vehicle Location
  870.   #--------------------------------------------------------------------------
  871.   def self.command_202
  872.     @cmd = "Set Vehicle Location"
  873.     @arg = sprintf("%s to Map %s", self.get_vehicle(@params[0]),
  874.       self.get_map_loc(@params[2], @params[3], @params[4], @params[1] == 0))
  875.   end
  876.   #--------------------------------------------------------------------------
  877.   # * Set Event Location
  878.   #--------------------------------------------------------------------------
  879.   def self.command_203
  880.     @cmd = "Set Event Location"
  881.     if [0,1].include?(@params[1])
  882.       @arg = sprintf("%s to %s", self.get_character(@params[0]), self.get_loc(@params[2],
  883.         @params[3], @params[1] == 0))
  884.     else
  885.       @arg = sprintf("swap %s and %s", self.get_character(@params[0]),
  886.         self.get_character(@params[2]))
  887.     end
  888.     @arg += ' direction ' + self.get_direction(@params[4]) if @params[4] > 0
  889.   end
  890.   #--------------------------------------------------------------------------
  891.   # * Scroll Map
  892.   #--------------------------------------------------------------------------
  893.   def self.command_204
  894.     @cmd = "Scroll Map"
  895.     @arg = sprintf('%s %d tiles, speed %d',
  896.       self.get_direction(@params[0]), @params[1],
  897.       @params[2])
  898.   end
  899.   #--------------------------------------------------------------------------
  900.   # * Set Move Route
  901.   #--------------------------------------------------------------------------
  902.   def self.command_205
  903.     @cmd = "Set Move Route"
  904.     @arg = self.get_character(@params[0])
  905.     mvr = @params[1]
  906.     extra = ''
  907.     extra = ' (repeat' if mvr.repeat
  908.     extra += (mvr.repeat ? ', ' : ' (') + 'skip if can\'t move' if mvr.skippable
  909.     extra += (mvr.repeat || mvr.skippable ? ', ' : ' (') + 'wait' if mvr.wait
  910.     extra += ')' if extra != ''
  911.     @arg += extra
  912.     self.export_command
  913.    
  914.     if EXPAND_MOVE_ROUTES
  915.       mvr.list.each do |cmd|
  916.         mp = cmd.parameters
  917.         @arg = '  '
  918.         @sv1 = nil
  919.         @swvar_export = false
  920.         case cmd.code
  921.         when 0
  922.           @arg += 'end'
  923.         when 1
  924.           @arg += 'move down'
  925.         when 2
  926.           @arg += 'move left'
  927.         when 3
  928.           @arg += 'move right'
  929.         when 4
  930.           @arg += 'move up'
  931.         when 5
  932.           @arg += 'move lower left'
  933.         when 6
  934.           @arg += 'move lower right'
  935.         when 7
  936.           @arg += 'move upper left'
  937.         when 8
  938.           @arg += 'move upper right'
  939.         when 9
  940.           @arg += 'move at random'
  941.         when 10
  942.           @arg += 'move toward player'
  943.         when 11
  944.           @arg += 'move away from player'
  945.         when 12
  946.           @arg += '1 step forward'
  947.         when 13
  948.           @arg += '1 step backward'
  949.         when 14
  950.           @arg += sprintf('jump %d, %d', mp[0], mp[1])
  951.         when 15
  952.           @arg += sprintf('wait %d frames', mp[0])
  953.         when 16
  954.           @arg += 'turn down'
  955.         when 17
  956.           @arg += 'turn left'
  957.         when 18
  958.           @arg += 'turn right'
  959.         when 19
  960.           @arg += 'turn up'
  961.         when 20
  962.           @arg += 'turn 90 degrees right'
  963.         when 21
  964.           @arg += 'turn 90 degrees left'
  965.         when 22
  966.           @arg += 'turn 180 degrees'
  967.         when 23
  968.           @arg += 'turn 90 degrees right or left'
  969.         when 24
  970.           @arg += 'turn at random'
  971.         when 25
  972.           @arg += 'turn toward player'
  973.         when 26
  974.           @arg += 'turn away from player'
  975.         when 27
  976.           @sv1 = get_switch(mp[0])
  977.           @arg += sprintf('%s ON', @sv1)
  978.           @swvar_export = true
  979.         when 28
  980.           @sv1 = get_switch(mp[0])
  981.           @arg += sprintf('%s OFF', @sv1)
  982.           @swvar_export = true
  983.         when 29
  984.           @arg += sprintf('change speed to %d', mp[0])
  985.         when 30
  986.           @arg += sprintf('change frequency to %d', mp[0])
  987.         when 31
  988.           @arg += 'walking animation on'
  989.         when 32
  990.           @arg += 'walking animation off'
  991.         when 33
  992.           @arg += 'stepping animation on'
  993.         when 34
  994.           @arg += 'stepping animation off'
  995.         when 35
  996.           @arg += 'direction fix on'
  997.         when 36
  998.           @arg += 'direction fix off'
  999.         when 37
  1000.           @arg += 'through on'
  1001.         when 38
  1002.           @arg += 'through off'
  1003.         when 39
  1004.           @arg += 'transparent on'
  1005.         when 40
  1006.           @arg += 'transparent off'
  1007.         when 41
  1008.           @arg += sprintf('change graphic to %s index %s', mp[0], mp[1].to_s)
  1009.         when 42
  1010.           @arg += sprintf('change opacity to %d', mp[0])
  1011.         when 43
  1012.           @arg += sprintf('change blending to %s', ['normal', 'add', 'sub'][mp[0]])
  1013.         when 44
  1014.           @arg += sprintf('play SE %s;  Volume %d  Pitch %d', mp[0].name, mp[0].volume, mp[0].pitch)
  1015.         when 45
  1016.           @arg += sprintf('script: %s', mp[0])
  1017.         end
  1018.         self.export_command
  1019.       end
  1020.     end
  1021.     @skip_export = true
  1022.   end
  1023.   #--------------------------------------------------------------------------
  1024.   # * Getting On and Off Vehicles
  1025.   #--------------------------------------------------------------------------
  1026.   def self.command_206
  1027.     @cmd = "Getting On and Off Vehicles"
  1028.     @arg = "Get on/off Vehicle"
  1029.   end
  1030.   #--------------------------------------------------------------------------
  1031.   # * Change Transparency
  1032.   #--------------------------------------------------------------------------
  1033.   def self.command_211
  1034.     @cmd = "Change Transparency"
  1035.     @arg = sprintf('Transparency %s', (@params[0] == 0 ? 'ON' : 'OFF'))
  1036.   end
  1037.   #--------------------------------------------------------------------------
  1038.   # * Show Animation
  1039.   #--------------------------------------------------------------------------
  1040.   def self.command_212
  1041.     @cmd = "Show Animation"
  1042.     @arg = sprintf('%d (%s) on %s', @params[1], self.animation_name(@params[1]),
  1043.       self.get_character(@params[0]))
  1044.     @arg += ' (wait)' if @params[2]
  1045.   end
  1046.   #--------------------------------------------------------------------------
  1047.   # * Show Balloon Icon
  1048.   #--------------------------------------------------------------------------
  1049.   def self.command_213
  1050.     @cmd = "Show Balloon Icon"
  1051.     @arg = sprintf('%d (%s) on %s', @params[1],
  1052.       ['Exclamation', 'Question', 'Music Note', 'Heart', 'Anger', 'Sweat',
  1053.       'Cobweb', 'Silence', 'Light Bulb', 'Zzz'][@params[1]],
  1054.       self.get_character(@params[0]))
  1055.     @arg += ' (wait)' if @params[2]
  1056.   end
  1057.   #--------------------------------------------------------------------------
  1058.   # * Temporarily Erase Event
  1059.   #--------------------------------------------------------------------------
  1060.   def self.command_214
  1061.     @cmd = "Temporarily Erase Event"
  1062.     @arg = 'Erase Event'
  1063.   end
  1064.   #--------------------------------------------------------------------------
  1065.   # * Change Player Followers
  1066.   #--------------------------------------------------------------------------
  1067.   def self.command_216
  1068.     @cmd = "Change Player Followers"
  1069.     @arg = @params[0] == 0 ? "make visible" : "make invisible"
  1070.   end
  1071.   #--------------------------------------------------------------------------
  1072.   # * Gather Followers
  1073.   #--------------------------------------------------------------------------
  1074.   def self.command_217
  1075.     @cmd = "Gather Followers"
  1076.     @arg = 'Gather Followers'
  1077.   end
  1078.   #--------------------------------------------------------------------------
  1079.   # * Fadeout Screen
  1080.   #--------------------------------------------------------------------------
  1081.   def self.command_221
  1082.     @cmd = "Fadeout Screen"
  1083.     @arg = '30 frames'
  1084.   end
  1085.   #--------------------------------------------------------------------------
  1086.   # * Fadein Screen
  1087.   #--------------------------------------------------------------------------
  1088.   def self.command_222
  1089.     @cmd = "Fadein Screen"
  1090.     @arg = '30 frames'
  1091.   end
  1092.   #--------------------------------------------------------------------------
  1093.   # * Tint Screen
  1094.   #--------------------------------------------------------------------------
  1095.   def self.command_223
  1096.     @cmd = "Tint Screen"
  1097.     @arg = sprintf('%s in %d frames', @params[0].to_s, @params[1])
  1098.     @arg += ' (wait)' if @params[2]
  1099.   end
  1100.   #--------------------------------------------------------------------------
  1101.   # * Screen Flash
  1102.   #--------------------------------------------------------------------------
  1103.   def self.command_224
  1104.     @cmd = "Screen Flash"
  1105.     @arg = sprintf('%s for %d frames', @params[0].to_s, @params[1])
  1106.     @arg += ' (wait)' if @params[2]
  1107.   end
  1108.   #--------------------------------------------------------------------------
  1109.   # * Screen Shake
  1110.   #--------------------------------------------------------------------------
  1111.   def self.command_225
  1112.     @cmd = "Screen Shake"
  1113.     @arg = sprintf('Power %d  Speed %d  for %d frames', @params[0], @params[1],
  1114.       @params[2])
  1115.     @arg += ' (wait)' if @params[3]
  1116.   end
  1117.   #--------------------------------------------------------------------------
  1118.   # * Wait
  1119.   #--------------------------------------------------------------------------
  1120.   def self.command_230
  1121.     @cmd = "Wait"
  1122.     @arg = sprintf("%d frames", @params[0])
  1123.   end
  1124.   #--------------------------------------------------------------------------
  1125.   # * Show Picture
  1126.   #--------------------------------------------------------------------------
  1127.   def self.command_231
  1128.     @cmd = "Show Picture"
  1129.     @arg = sprintf("%d (%s) origin %s at %s, opacity %d", @params[0], @params[1],
  1130.      (@params[2] == 0 ? "top left" : "center"), self.get_loc(@params[4], @params[5],
  1131.      @params[3] == 0), @params[8])
  1132.   end
  1133.   #--------------------------------------------------------------------------
  1134.   # * Move Picture
  1135.   #--------------------------------------------------------------------------
  1136.   def self.command_232
  1137.     @cmd = "Move Picture"
  1138.     @arg = sprintf("%d origin %s to %s, opacity %d, duration %d", @params[0],
  1139.       (@params[2] == 0 ? "top left" : "center"), self.get_loc(@params[4], @params[5],
  1140.       @params[3] == 0), @params[8], @params[10])
  1141.     @arg += ' (wait)' if @params[11]
  1142.   end
  1143.   #--------------------------------------------------------------------------
  1144.   # * Rotate Picture
  1145.   #--------------------------------------------------------------------------
  1146.   def self.command_233
  1147.     @cmd = "Rotate Picture"
  1148.     @arg = sprintf('%d at speed %d', @params[0], @params[1])
  1149.   end
  1150.   #--------------------------------------------------------------------------
  1151.   # * Tint Picture
  1152.   #--------------------------------------------------------------------------
  1153.   def self.command_234
  1154.     @cmd = "Tint Picture"
  1155.     @arg = sprintf('%d to tone %s in %d frames', @params[0], @params[1].to_s, @params[2])
  1156.     @arg += ' (wait)' if @params[3]
  1157.   end
  1158.   #--------------------------------------------------------------------------
  1159.   # * Erase Picture
  1160.   #--------------------------------------------------------------------------
  1161.   def self.command_235
  1162.     @cmd = "Erase Picture"
  1163.     @arg = @params[0].to_s
  1164.   end
  1165.   #--------------------------------------------------------------------------
  1166.   # * Set Weather
  1167.   #--------------------------------------------------------------------------
  1168.   def self.command_236
  1169.     @cmd = "Set Weather"
  1170.     @arg = sprintf('%s  Power %d  Time %d frames', @params[0],
  1171.       @params[1], @params[2])
  1172.     @arg += ' (wait)' if @params[3]
  1173.   end
  1174.   #--------------------------------------------------------------------------
  1175.   # * Play BGM
  1176.   #--------------------------------------------------------------------------
  1177.   def self.command_241
  1178.     @cmd = "Play BGM"
  1179.     @arg = self.get_audio(@params[0])
  1180.   end
  1181.   #--------------------------------------------------------------------------
  1182.   # * Fadeout BGM
  1183.   #--------------------------------------------------------------------------
  1184.   def self.command_242
  1185.     @cmd = "Fadeout BGM"
  1186.     @arg = sprintf('%d seconds', @params[0])
  1187.   end
  1188.   #--------------------------------------------------------------------------
  1189.   # * Save BGM
  1190.   #--------------------------------------------------------------------------
  1191.   def self.command_243
  1192.     @cmd = "Save BGM"
  1193.     @arg = 'Save BGM'
  1194.   end
  1195.   #--------------------------------------------------------------------------
  1196.   # * Resume BGM
  1197.   #--------------------------------------------------------------------------
  1198.   def self.command_244
  1199.     @cmd = "Resume BGM"
  1200.     @arg = 'Resume BGM'
  1201.   end
  1202.   #--------------------------------------------------------------------------
  1203.   # * Play BGS
  1204.   #--------------------------------------------------------------------------
  1205.   def self.command_245
  1206.     @cmd = "Play BGS"
  1207.     @arg = self.get_audio(@params[0])
  1208.   end
  1209.   #--------------------------------------------------------------------------
  1210.   # * Fadeout BGS
  1211.   #--------------------------------------------------------------------------
  1212.   def self.command_246
  1213.     @cmd = "Fadeout BGS"
  1214.     @arg = sprintf('%d seconds', @params[0])
  1215.   end
  1216.   #--------------------------------------------------------------------------
  1217.   # * Play ME
  1218.   #--------------------------------------------------------------------------
  1219.   def self.command_249
  1220.     @cmd = "Play ME"
  1221.     @arg = self.get_audio(@params[0])
  1222.   end
  1223.   #--------------------------------------------------------------------------
  1224.   # * Play SE
  1225.   #--------------------------------------------------------------------------
  1226.   def self.command_250
  1227.     @cmd = "Play SE"
  1228.     @arg = self.get_audio(@params[0])
  1229.   end
  1230.   #--------------------------------------------------------------------------
  1231.   # * Stop SE
  1232.   #--------------------------------------------------------------------------
  1233.   def self.command_251
  1234.     @cmd = "Stop SE"
  1235.     @arg = 'Stop SE'
  1236.   end
  1237.   #--------------------------------------------------------------------------
  1238.   # * Play Movie
  1239.   #--------------------------------------------------------------------------
  1240.   def self.command_261
  1241.     @cmd = "Play Movie"
  1242.     @arg = @params[0]
  1243.   end
  1244.   #--------------------------------------------------------------------------
  1245.   # * Change Map Name Display
  1246.   #--------------------------------------------------------------------------
  1247.   def self.command_281
  1248.     @cmd = "Change Map Name Display"
  1249.     @arg = @params[0] == 0 ? "visible" : "hidden"
  1250.   end
  1251.   #--------------------------------------------------------------------------
  1252.   # * Change Tileset
  1253.   #--------------------------------------------------------------------------
  1254.   def self.command_282
  1255.     @cmd = "Change Tileset"
  1256.     @arg = sprintf('%d (%s)', @params[0], self.tileset_name(@params[0]))
  1257.   end
  1258.   #--------------------------------------------------------------------------
  1259.   # * Change Battle Background
  1260.   #--------------------------------------------------------------------------
  1261.   def self.command_283
  1262.     @cmd = "Change Battle Background"
  1263.     @arg = sprintf('Ground: %s  Walls: %s', @params[0], @params[1])
  1264.   end
  1265.   #--------------------------------------------------------------------------
  1266.   # * Change Parallax Background
  1267.   #--------------------------------------------------------------------------
  1268.   def self.command_284
  1269.     @cmd = "Change Parallax Background"
  1270.     @arg = @params[0]
  1271.     @arg += sprintf(' (loop horizontal%s)',
  1272.       (@params[3] > 0 ? " [scroll " + @params[3] + "]" : "")) if @params[1]
  1273.     @arg += sprintf(' (loop vertical%s)',
  1274.       (@params[4] > 0 ? " [scroll " + @params[4] + "]" : "")) if @params[2]
  1275.   end
  1276.   #--------------------------------------------------------------------------
  1277.   # * Get Location Info
  1278.   #--------------------------------------------------------------------------
  1279.   def self.command_285
  1280.     @cmd = "Get Location Info"
  1281.     @sv1 = get_variable(@params[0])
  1282.     @arg = sprintf('Tile %s, %s into %s', self.get_loc(@params[3], @params[4], @params[2] == 0),
  1283.       ['Terrain Tag', 'Event ID', 'Tile ID (Layer 1)', 'Tile ID (Layer 2)',
  1284.       'Tile ID (Layer 3)', 'Region ID'][@params[1]], @sv1)
  1285.     @swvar_export = true
  1286.   end
  1287.   #--------------------------------------------------------------------------
  1288.   # * Battle Processing
  1289.   #--------------------------------------------------------------------------
  1290.   def self.command_301
  1291.     @cmd = "Battle Processing"
  1292.     @sv1 = get_variable(@params[1]) if @params[0] == 1
  1293.     @arg = @params[0] == 0 ? sprintf('Troop %d (%s)', @params[1],
  1294.       self.troop_name(@params[1])) : @params[0] == 1 ? sprintf('Troop from %s',
  1295.       @sv1) : 'map-designated troop'
  1296.     @swvar_export = @params[0] == 1
  1297.   end
  1298.   #--------------------------------------------------------------------------
  1299.   # * If Win
  1300.   #--------------------------------------------------------------------------
  1301.   def self.command_601
  1302.     @cmd = "If Win"
  1303.     @arg = 'if win'
  1304.   end
  1305.   #--------------------------------------------------------------------------
  1306.   # * If Escape
  1307.   #--------------------------------------------------------------------------
  1308.   def self.command_602
  1309.     @cmd = "If Escape"
  1310.     @arg = 'if escape'
  1311.   end
  1312.   #--------------------------------------------------------------------------
  1313.   # * If Lose
  1314.   #--------------------------------------------------------------------------
  1315.   def self.command_603
  1316.     @cmd = "If Lose"
  1317.     @arg = 'if lose'
  1318.   end
  1319.   #--------------------------------------------------------------------------
  1320.   # * Shop Processing
  1321.   #--------------------------------------------------------------------------
  1322.   def self.command_302
  1323.     @cmd = "Shop Processing"
  1324.     if @params[4]
  1325.       @arg = "(purchase only)"
  1326.       self.export_command
  1327.     end
  1328.     goods = @params
  1329.     item = goods[0] == 0 ? $data_items[goods[1]] : goods[0] == 1 ? $data_weapons[goods[1]] :
  1330.       $data_armors[goods[1]]
  1331.     if item
  1332.       @arg = sprintf('%s %d (%s)', ['Item', 'Weapon', 'Armor'][goods[0]], item.id, item.name)
  1333.       @arg += goods[2] == 0 ? sprintf(' : %d', item.price) : sprintf(' : %d (price override)',
  1334.         goods[3])
  1335.     else
  1336.       @arg = sprintf('%s %d (%s)', ['Item', 'Weapon', 'Armor'][goods[0]], goods[1], 'undefined')
  1337.     end
  1338.     self.export_command
  1339.    
  1340.     while next_event_code == 605
  1341.       @cmdline += 1
  1342.       goods = @list[@cmdline].parameters
  1343.       item = goods[0] == 0 ? $data_items[goods[1]] : goods[0] == 1 ? $data_weapons[goods[1]] :
  1344.         $data_armors[goods[1]]
  1345.       if item
  1346.         @arg = sprintf('%s %d (%s)', ['Item', 'Weapon', 'Armor'][goods[0]], item.id, item.name)
  1347.         @arg += goods[2] == 0 ? sprintf(' : %d', item.price) : sprintf(' : %d (price override)',
  1348.           goods[3])
  1349.       else
  1350.         @arg = sprintf('%s %d (%s)', ['Item', 'Weapon', 'Armor'][goods[0]], goods[1], 'undefined')
  1351.       end
  1352.       self.export_command
  1353.     end
  1354.     @skip_export = true
  1355.   end
  1356.   #--------------------------------------------------------------------------
  1357.   # * Name Input Processing
  1358.   #--------------------------------------------------------------------------
  1359.   def self.command_303
  1360.     @cmd = "Name Input Processing"
  1361.     @arg = sprintf('Actor %d (%s), %d characters', @params[0], self.actor_name(@params[0]),
  1362.       @params[1])
  1363.   end
  1364.   #--------------------------------------------------------------------------
  1365.   # * Change HP
  1366.   #--------------------------------------------------------------------------
  1367.   def self.command_311
  1368.     @cmd = "Change HP"
  1369.     @arg = sprintf('%s %s',
  1370.       self.get_actor(@params[0], @params[1]),
  1371.       self.operate_value(@params[2], @params[4], @params[3] == 0))
  1372.     @arg += ' (allow knockout)' if @params[5]
  1373.   end
  1374.   #--------------------------------------------------------------------------
  1375.   # * Change MP
  1376.   #--------------------------------------------------------------------------
  1377.   def self.command_312
  1378.     @cmd = "Change MP"
  1379.     @arg = sprintf('%s %s', self.get_actor(@params[0], @params[1]),
  1380.       self.operate_value(@params[2], @params[4], @params[3] == 0))
  1381.   end
  1382.   #--------------------------------------------------------------------------
  1383.   # * Change State
  1384.   #--------------------------------------------------------------------------
  1385.   def self.command_313
  1386.     @cmd = "Change State"
  1387.     @arg = sprintf('%s %s %d (%s)', self.get_actor(@params[0], @params[1]),
  1388.       (@params[2] == 0 ? '+' : '-'), @params[3], self.state_name(@params[3]))
  1389.   end
  1390.   #--------------------------------------------------------------------------
  1391.   # * Recover All
  1392.   #--------------------------------------------------------------------------
  1393.   def self.command_314
  1394.     @cmd = "Recover All"
  1395.     @arg = self.get_actor(@params[0], @params[1])
  1396.   end
  1397.   #--------------------------------------------------------------------------
  1398.   # * Change EXP
  1399.   #--------------------------------------------------------------------------
  1400.   def self.command_315
  1401.     @cmd = "Change EXP"
  1402.     @arg = sprintf('%s %s', self.get_actor(@params[0], @params[1]),
  1403.       self.operate_value(@params[2], @params[4], @params[3] == 0))
  1404.     @arg += ' (show level up message)' if @params[5]
  1405.   end
  1406.   #--------------------------------------------------------------------------
  1407.   # * Change Level
  1408.   #--------------------------------------------------------------------------
  1409.   def self.command_316
  1410.     @cmd = "Change Level"
  1411.     @arg = sprintf('%s %s', self.get_actor(@params[0], @params[1]),
  1412.       self.operate_value(@params[2], @params[4], @params[3] == 0))
  1413.     @arg += ' (show level up message)' if @params[5]
  1414.   end
  1415.   #--------------------------------------------------------------------------
  1416.   # * Change Parameters
  1417.   #--------------------------------------------------------------------------
  1418.   def self.command_317
  1419.     @cmd = "Change Parameters"
  1420.     @arg = sprintf('%s %s %s', self.get_actor(@params[0], @params[1]),
  1421.       ['MHP', 'MMP', 'ATK', 'DEF', 'MAT', 'MDF', 'AGI', 'LUK'][@params[2]],
  1422.       self.operate_value(@params[3], @params[5], @params[4] == 0))
  1423.   end
  1424.   #--------------------------------------------------------------------------
  1425.   # * Change Skills
  1426.   #--------------------------------------------------------------------------
  1427.   def self.command_318
  1428.     @cmd = "Change Skills"
  1429.     @arg = sprintf('%s %s %d (%s)', self.get_actor(@params[0], @params[1]),
  1430.       (@params[2] == 0 ? "learn" : "forget"), @params[3],
  1431.       self.skill_name(@params[3]))
  1432.   end
  1433.   #--------------------------------------------------------------------------
  1434.   # * Change Equipment
  1435.   #--------------------------------------------------------------------------
  1436.   def self.command_319
  1437.     @cmd = "Change Equipment"
  1438.     @arg += sprintf('%s %s %d %s',
  1439.       self.get_actor(0, @params[0] + 1), $data_system.terms.etypes[@params[1]],
  1440.       @params[2], (@params[2] == 0 ? "None" : (@params[1] == 0 ?
  1441.       self.weapon_name(@params[2]) : self.armor_name(@params[2]))))
  1442.   end
  1443.   #--------------------------------------------------------------------------
  1444.   # * Change Name
  1445.   #--------------------------------------------------------------------------
  1446.   def self.command_320
  1447.     @text_export = true
  1448.     @cmd = "Change Name"
  1449.     @arg = sprintf('Actor %d (%s) to %s', @params[0], self.actor_name(@params[0]),
  1450.       @params[1])
  1451.   end
  1452.   #--------------------------------------------------------------------------
  1453.   # * Change Class
  1454.   #--------------------------------------------------------------------------
  1455.   def self.command_321
  1456.     @cmd = "Change Class"
  1457.     @arg = sprintf('Actor %d (%s) to %d (%s)', @params[0],
  1458.       $data_actors[@params[0]].name, @params[1], self.class_name(@params[1]))
  1459.   end
  1460.   #--------------------------------------------------------------------------
  1461.   # * Change Actor Graphic
  1462.   #--------------------------------------------------------------------------
  1463.   def self.command_322
  1464.     @cmd = "Change Actor Graphic"
  1465.     @arg = sprintf('Actor %d (%s)  Character %s (%d)  Face %s (%d)',
  1466.       @params[0], self.actor_name(@params[0]), @params[1], @params[2],
  1467.       @params[3], @params[4])
  1468.   end
  1469.   #--------------------------------------------------------------------------
  1470.   # * Change Vehicle Graphic
  1471.   #--------------------------------------------------------------------------
  1472.   def self.command_323
  1473.     @cmd = "Change Vehicle Graphic"
  1474.     @arg = sprintf('%s  Character %s (%d)',
  1475.       self.get_vehicle(@params[0]), @params[1], @params[2])
  1476.   end
  1477.   #--------------------------------------------------------------------------
  1478.   # * Change Nickname
  1479.   #--------------------------------------------------------------------------
  1480.   def self.command_324
  1481.     @text_export = true
  1482.     @cmd = "Change Nickname"
  1483.     @arg = sprintf('Actor %d (%s) to %s', @params[0], $data_actors[@params[0]],
  1484.       @params[1])
  1485.   end
  1486.   #--------------------------------------------------------------------------
  1487.   # * Change Enemy HP
  1488.   #--------------------------------------------------------------------------
  1489.   def self.command_331
  1490.     @cmd = "Change Enemy HP"
  1491.     @arg = sprintf('%s %s', self.get_enemy(@params[0]),
  1492.       self.operate_value(@params[1], @params[3], @params[2] == 0))
  1493.     @arg += ' (allow knockout)' if @params[4]
  1494.   end
  1495.   #--------------------------------------------------------------------------
  1496.   # * Change Enemy MP
  1497.   #--------------------------------------------------------------------------
  1498.   def self.command_332
  1499.     @cmd = "Change Enemy MP"
  1500.     @arg = sprintf('%s %s', self.get_enemy(@params[0]),
  1501.       self.operate_value(@params[1], @params[3], @params[2] == 0))
  1502.   end
  1503.   #--------------------------------------------------------------------------
  1504.   # * Change Enemy State
  1505.   #--------------------------------------------------------------------------
  1506.   def self.command_333
  1507.     @cmd = "Change Enemy State"
  1508.     @arg = sprintf('%s %s %d (%s)', self.get_enemy(@params[0]),
  1509.       (@params[1] == 0 ? '+' : '-'), @params[2], self.state_name(@params[2]))
  1510.   end
  1511.   #--------------------------------------------------------------------------
  1512.   # * Enemy Recover All
  1513.   #--------------------------------------------------------------------------
  1514.   def self.command_334
  1515.     @cmd = "Enemy Recover All"
  1516.     @arg = self.get_enemy(@params[0])
  1517.   end
  1518.   #--------------------------------------------------------------------------
  1519.   # * Enemy Appear
  1520.   #--------------------------------------------------------------------------
  1521.   def self.command_335
  1522.     @cmd = "Enemy Appear"
  1523.     @arg = self.get_enemy(@params[0])
  1524.   end
  1525.   #--------------------------------------------------------------------------
  1526.   # * Enemy Transform
  1527.   #--------------------------------------------------------------------------
  1528.   def self.command_336
  1529.     @cmd = "Enemy Transform"
  1530.     @arg = sprintf('%s to %d (%s)', self.get_enemy(@params[0]), @params[1],
  1531.       self.enemy_name(@params[1]))
  1532.   end
  1533.   #--------------------------------------------------------------------------
  1534.   # * Show Battle Animation
  1535.   #--------------------------------------------------------------------------
  1536.   def self.command_337
  1537.     @cmd = "Show Battle Animation"
  1538.     @arg = sprintf('%d (%s) on %s', @params[1], self.animation_name(@params[1]),
  1539.       self.get_enemy(@params[0]))
  1540.   end
  1541.   #--------------------------------------------------------------------------
  1542.   # * Force Action
  1543.   #--------------------------------------------------------------------------
  1544.   def self.command_339
  1545.     @cmd = "Force Action"
  1546.     @arg = sprintf('%s skill %d (%s) on target %s',
  1547.       (@params[0] == 0 ? self.get_enemy(@params[1]) : self.get_actor(0, @params[1])),
  1548.       @params[2], self.skill_name(@params[2]), (@params[3] == -2 ? 'last target' :
  1549.       (@params[3] == -1 ? 'random target' : @params[3].to_s)))
  1550.   end
  1551.   #--------------------------------------------------------------------------
  1552.   # * Abort Battle
  1553.   #--------------------------------------------------------------------------
  1554.   def self.command_340
  1555.     @cmd = "Abort Battle"
  1556.     @arg = 'Abort'
  1557.   end
  1558.   #--------------------------------------------------------------------------
  1559.   # * Open Menu Screen
  1560.   #--------------------------------------------------------------------------
  1561.   def self.command_351
  1562.     @cmd = "Open Menu Screen"
  1563.     @arg = 'open menu screen'
  1564.   end
  1565.   #--------------------------------------------------------------------------
  1566.   # * Open Save Screen
  1567.   #--------------------------------------------------------------------------
  1568.   def self.command_352
  1569.     @cmd = "Open Save Screen"
  1570.     @arg = 'open save screen'
  1571.   end
  1572.   #--------------------------------------------------------------------------
  1573.   # * Game Over
  1574.   #--------------------------------------------------------------------------
  1575.   def self.command_353
  1576.     @cmd = "Game Over"
  1577.     @arg = 'game over'
  1578.   end
  1579.   #--------------------------------------------------------------------------
  1580.   # * Return to Title Screen
  1581.   #--------------------------------------------------------------------------
  1582.   def self.command_354
  1583.     @cmd = "Return to Title Screen"
  1584.     @arg = 'return to title screen'
  1585.   end
  1586.   #--------------------------------------------------------------------------
  1587.   # * Script
  1588.   #--------------------------------------------------------------------------
  1589.   def self.command_355
  1590.     @cmd = "Script"
  1591.     @arg = @params[0]
  1592.   end
  1593.   def self.command_655
  1594.     @cmd = "Script"
  1595.     @arg = @params[0]
  1596.   end
  1597.  
  1598.   def self.export_condition
  1599.     while @arg.gsub!(/  /) { " " } != nil
  1600.     end
  1601.    
  1602.     @expline += 1
  1603.    
  1604.     text = sprintf("%d%s%d%s%s%s%s%s%s%s%d%s%s%s%s%s%s%s",
  1605.       @expline, @cb, @event_seq, @cb, @event_type, @cb, @event_source, @cb,
  1606.       @event_tab, @cb, @line, @cb, 'Condition', @cb, @cmd, @cb, @arg, @lb)
  1607.      
  1608.     @file_all.print(text)
  1609.    
  1610.     if @swvar_export
  1611.       text = sprintf("%d%s%d%s%s%s%s%s%s%s%d%s%s%s%s%s%s%s%s%s",
  1612.         @expline, @cb, @event_seq, @cb, @event_type, @cb, @event_source, @cb,
  1613.         @event_tab, @cb, @line, @cb, 'Condition', @cb, @cmd, @cb, @sv1, @cb, @arg, @lb)
  1614.       @file_swvar.print(text)
  1615.       if @sv2
  1616.         text = sprintf("%d%s%d%s%s%s%s%s%s%s%d%s%s%s%s%s%s%s%s%s",
  1617.           @expline, @cb, @event_seq, @cb, @event_type, @cb, @event_source, @cb,
  1618.           @event_tab, @cb, @line, @cb, 'Condition', @cb, @cmd, @cb, @sv2, @cb, @arg, @lb)
  1619.         @file_swvar.print(text)
  1620.       end
  1621.       if @sv3
  1622.         text = sprintf("%d%s%d%s%s%s%s%s%s%s%d%s%s%s%s%s%s%s%s%s",
  1623.           @expline, @cb, @event_seq, @cb, @event_type, @cb, @event_source, @cb,
  1624.           @event_tab, @cb, @line, @cb, 'Condition', @cb, @cmd, @cb, @sv3, @cb, @arg, @lb)
  1625.         @file_swvar.print(text)
  1626.       end
  1627.     end
  1628.   end
  1629.    
  1630.    
  1631.  
  1632.   def self.export_command
  1633.     # get rid of any double spaces
  1634.     while @arg.gsub!(/  /) { " " } != nil
  1635.     end
  1636.    
  1637.     @expline += 1
  1638.    
  1639.     indchar = INDENT ? @ind * @indent : ""
  1640.    
  1641.     text = sprintf("%d%s%d%s%s%s%s%s%s%s%d%s%d%s%s%s%s%s%s",
  1642.       @expline, @cb, @event_seq, @cb, @event_type, @cb, @event_source, @cb,
  1643.       @event_tab, @cb, @line, @cb, @command.code, @cb, @cmd, @cb, indchar, @arg, @lb)
  1644.      
  1645.     @file_all.print(text)
  1646.     @file_text.print(text) if @text_export
  1647.     if @swvar_export
  1648.       text = sprintf("%d%s%d%s%s%s%s%s%s%s%d%s%d%s%s%s%s%s%s%s",
  1649.         @expline, @cb, @event_seq, @cb, @event_type, @cb, @event_source, @cb,
  1650.         @event_tab, @cb, @line, @cb, @command.code, @cb, @cmd, @cb, @sv1, @cb, @arg, @lb)
  1651.       @file_swvar.print(text)
  1652.       if @sv2
  1653.         text = sprintf("%d%s%d%s%s%s%s%s%s%s%d%s%d%s%s%s%s%s%s%s",
  1654.           @expline, @cb, @event_seq, @cb, @event_type, @cb, @event_source, @cb,
  1655.           @event_tab, @cb, @line, @cb, @command.code, @cb, @cmd, @cb, @sv2, @cb, @arg, @lb)
  1656.         @file_swvar.print(text)
  1657.       end
  1658.       if @sv3
  1659.         text = sprintf("%d%s%d%s%s%s%s%s%s%s%d%s%d%s%s%s%s%s%s%s",
  1660.           @expline, @cb, @event_seq, @cb, @event_type, @cb, @event_source, @cb,
  1661.           @event_tab, @cb, @line, @cb, @command.code, @cb, @cmd, @cb, @sv3, @cb, @arg, @lb)
  1662.         @file_swvar.print(text)
  1663.       end
  1664.     end
  1665.   end
  1666. end
  1667.    
  1668. EVExport.export
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top