document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  2. # Resource Tester by Blizzard
  3. # Version: 1.05b
  4. # Type: Time-and-Space saving Utility
  5. # Convert to module with method: DeadElf79 (23/02/2015)
  6. # Write files only while $DEBUG is true!
  7. # Date: 16.8.2007
  8. # Date v1.0b: 17.8.2007
  9. # Date v1.01b: 17.9.2007
  10. # Date v1.02b: 27.3.2008
  11. # Date v1.05b: 3.4.2008
  12. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  13. #
  14. # Compatibility:
  15. #
  16. #   Compatible with anything, even the SDK 2.x (because it gets overriden).
  17. #   Will not search for script-required resources.
  18. #
  19. #
  20. # Features:
  21. #
  22. #   - finds all resources used in your game
  23. #   - incredible speed: searching trough a game with over 300 maps is a matter
  24. #     of just seconds
  25. #   - optional feature to list all actors, skills, weapons, armors, items,
  26. #     enemies, troops, states, animations, tilesets and common events that are
  27. #     never being used anywhere in the game and only log all the used data
  28. #  
  29. # new in 1.0b:
  30. #   - fixed the typing mistake that would cause adding the skill with ID 1
  31. #     into the logged skills instead of the real skill when the script was
  32. #     processing a "Force Action" event command
  33. #   - rewritten conditions using classic syntax to avoid RGSS conditioning bug
  34. #   - now beta
  35. #
  36. # new in 1.01b:
  37. #   - fixed glitch where changing a Battle End ME would be logged as SE
  38. #   - improved coding
  39. #
  40. # new in 1.02b:
  41. #   - fixed bug caused by a typing mistake
  42. #
  43. # new in 1.05b:
  44. #   - fixed other potential bugs
  45. #
  46. #
  47. # Explanation:
  48. #
  49. #   This script will search through your database and your maps for resources
  50. #   that are being used. It will create a list of the resources used in your
  51. #   game.
  52. #
  53. #
  54. # How to use:
  55. #
  56. #   Put this script over all other scripts in the editor. Set the player\'s
  57. #   starting position and starting party. Set everything up as if you were
  58. #   about to set up the game to be playable and run your game once. Several
  59. #   text files will be created during that time. Now you can remove the script
  60. #   from the editor and open the text files. They will include lists of
  61. #   resources that your game uses, but the file names will not have extensions.
  62. #   Note that resources that are "hard-coded" into your scripts, cannot be
  63. #   located by this script.
  64. #
  65. #
  66. # Configuration:
  67. #
  68. #   Set up following constants to suit your needs:
  69. #
  70. #   $deep_testing - When this value is false, the script will just iterate
  71. #                  through your database and maps and find out which resources
  72. #                  are being accessed. When this values is true, the script
  73. #                  will find out which data isn\'t used first and then create a
  74. #                  list of resources used by data that is being used. It will
  75. #                  also create a file of which data isn\'t used. (i.e. a skill
  76. #                  that no one uses in the entire game)
  77. #
  78. #
  79. # How the script works:
  80. #
  81. # - when $deep_testing is false
  82. #
  83. #    1. The script will open all your maps and gather a list of all events. It
  84. #       will iterate through all the events\' codes and find resources that are
  85. #       being accessed (i.e. playing a sound, changing windowskin, etc.).
  86. #    2. It will do the same with all common events and battle events.
  87. #    3. It will open all actor, skill, weapon, armor, item, enemy, animations,
  88. #       tilesets and system data.
  89. #    4. It will iterate through all of them and find all resources ever being
  90. #       accessed.
  91. #  
  92. # - when $deep_testing is true
  93. #
  94. #    1. Your system data will be logged and the player\'s starting map ID will
  95. #       be accesssed. This map will be logged as "pending".
  96. #         -> logs audio FILES, graphic FILES from system and all actors
  97. #    2. Pending maps are being accessed, their properties are being logged:
  98. #         -> logs new tilesets, troops, event pages and audio FILES
  99. #       Maps are logged as completed.
  100. #    3. Pending troops will be checked:
  101. #         -> logs new enemies and battle events
  102. #       Troops are logged as completed.
  103. #    4. Pending enemies will be checked:
  104. #         -> logs new skills, weapons, armors items, animations and
  105. #            battler FILES
  106. #       Enemies are logged as completed.
  107. #    5. Pending actors will be checked:
  108. #         -> logs classes, weapons, armors, character FILES and battler FILES
  109. #       Actors are logged as completed.
  110. #    6. Pending classes will be checked:
  111. #         -> logs new skills
  112. #       Classes are logged as completed.
  113. #    7. Pending skills will be checked:
  114. #         -> logs new event pages, states, animations, icon FILES and
  115. #            audio FILES
  116. #       Skills are logged as completed.
  117. #    8. Pending items will be checked:
  118. #         -> logs new event pages, states, animations, icon FILES and
  119. #            audio FILES
  120. #       Items are logged as completed.
  121. #    9. Pending events are getting tested on following commands:
  122. #       - call common event     -> logs new event pages
  123. #       - change items          -> logs new items
  124. #       - change weapons        -> logs new weapons
  125. #       - change armors         -> logs new armors
  126. #       - change party members  -> logs new actors and classes
  127. #       - change windowskin     -> logs new windowskin FILES
  128. #       - change battle audio   -> logs new audio FILES
  129. #       - transfer player       -> logs new maps
  130. #       - change map settings   -> logs new panorama/fog/battleback FILES
  131. #       - show animation        -> logs new animations
  132. #       - move event            -> logs new character FILES
  133. #       - execute transition    -> logs new transition FILES
  134. #       - show picture          -> logs new picture FILES
  135. #       - play any audio file   -> logs new audio FILES
  136. #       - battle processing     -> logs new troops
  137. #       - shop processing       -> logs new weapons, armors and items
  138. #       - name processing       -> logs new actors and classes
  139. #       - change actor state    -> logs new actors, classes and states
  140. #       - change actor skill    -> logs new actors, classes and skills
  141. #       - change actor class    -> logs new actors and classes
  142. #       - change actor graphic  -> logs new actors, classes and character FILES
  143. #       - change enemy state    -> logs new stantes
  144. #       - enemy transform       -> logs new enemies
  145. #       - show battle animation -> logs new animations
  146. #       - force action          -> logs new skills
  147. #       Also logs new character FILES if the page is a normal event page.
  148. #       Common Events are logged as completed.
  149. #   10. Returns to step 2 if there are any pending maps, troops, enemies,
  150. #       actors, classes, skills, items, or event pages.
  151. #   11. Pending weapons will be checked:
  152. #         -> logs new states, animations and icon FILES
  153. #   12. Pending armors will be checked:
  154. #         -> logs new states and icon FILES
  155. #   13. Pending states and zero-hp states will be checked:
  156. #         -> logs new states and animations
  157. #   14. Pending animations will be checked:
  158. #         -> logs new animation FILES and audio FILES
  159. #   15. Pending tilesets will be checked:
  160. #         -> logs new tileset FILES, autotile FILES, panorama FILES, fog FILES
  161. #            and battleback FILES
  162. #   16. Saves a list of resources and saves a list of unused actors, classes,
  163. #       skills, weapons, armors, items, enemies, troops, states, animations,
  164. #       tilesets, common events and maps.
  165. #
  166. #
  167. # Final Notes:
  168. #
  169. # - If you use a system where you have more than one start location for the
  170. #   game (i.e. a separated mode with a different storyline) and want to turn
  171. #   $deep_testing on during the testing, then just put in the starting map a
  172. #   dummy event with teleport commands to the starting maps of the other game
  173. #   modes.
  174. #  
  175. # - If you are using $deep_testing, be careful, since teleport commands that
  176. #   use a variable to determine the new map ID can\'t be tested. Do as you
  177. #   would with with different game modes: Create dummy events.
  178. #  
  179. # - Auto-start and parallel process common events will be automatically logged
  180. #   from the beginning.
  181. #  
  182. # - The best moment to use this script is just before you are going to compile
  183. #   and encrypt the game data. If you want to use it for resource cleaning,
  184. #   turn off $deep_testing.
  185. #
  186. #
  187. # If you find any bugs, please report them here:
  188. # http://forum.chaos-project.com
  189. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
  190.  
  191. $deep_testing = false
  192.  
  193. #==============================================================================
  194. # Main
  195. #==============================================================================
  196. module Blizzard
  197. def self.Resource_Test
  198.   time = Time.now
  199.   _actors     = load_data(\'Data/Actors.rxdata\')
  200.   _classes    = load_data(\'Data/Classes.rxdata\')
  201.   _skills     = load_data(\'Data/Skills.rxdata\')
  202.   _items      = load_data(\'Data/Items.rxdata\')
  203.   _weapons    = load_data(\'Data/Weapons.rxdata\')
  204.   _armors     = load_data(\'Data/Armors.rxdata\')
  205.   _enemies    = load_data(\'Data/Enemies.rxdata\')
  206.   _states     = load_data(\'Data/States.rxdata\')
  207.   _animations = load_data(\'Data/Animations.rxdata\')
  208.   _tilesets   = load_data(\'Data/Tilesets.rxdata\')
  209.   _pages      = load_data(\'Data/CommonEvents.rxdata\')
  210.   _troops     = load_data(\'Data/Troops.rxdata\')
  211.   _maps       = load_data(\'Data/MapInfos.rxdata\')
  212.   _system     = load_data(\'Data/System.rxdata\')
  213.   bgm, bgs, se, me, animations, autotiles, battlebacks, battlers, characters,
  214.   fogs, gameovers, icons, panoramas, pictures, tilesets, titles, transitions,
  215.   windowskins = [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [],
  216.                 [], []
  217.   windowskins.push(_system.windowskin_name)
  218.   titles.push(_system.title_name)
  219.   gameovers.push(_system.gameover_name)
  220.   transitions.push(_system.battle_transition)
  221.   bgm.push(_system.title_bgm.name)
  222.   me.push(_system.battle_end_me.name, _system.gameover_me.name)
  223.   se.push(_system.cursor_se.name, _system.decision_se.name,
  224.           _system.cancel_se.name, _system.buzzer_se.name,
  225.           _system.equip_se.name, _system.shop_se.name, _system.save_se.name,
  226.           _system.load_se.name, _system.battle_start_se.name,
  227.           _system.escape_se.name, _system.actor_collapse_se.name,
  228.           _system.enemy_collapse_se.name)
  229.   if $deep_testing
  230.     p_maps, p_troops, p_enemies, p_actors, p_classes, p_skills, p_items,
  231.     p_pages, p_weapons, p_armors, p_states, p_animations, p_tilesets, c_maps,
  232.     c_troops, c_enemies, c_actors, c_classes, c_skills, c_items, c_pages =
  233.     [_system.start_map_id], [], [], _system.party_members.clone, [], [], [],
  234.     [], [], [], [], [], [], [], [], [], [], [], [], [], []
  235.     (_pages - [nil]).each {|page|
  236.         if [1, 2].include?(page.trigger)
  237.           p_pages.push(page)
  238.           c_pages.push(page.id)
  239.         end}
  240.     p_maps.delete(0)
  241.     raise \'Error! There is no start map defined!\' if p_maps.size == 0
  242.     loop do
  243.       Graphics.update
  244.       p_maps.clone.each {|id|
  245.           map = load_data(sprintf("Data/Map%03d.rxdata", id))
  246.           map.events.values.each {|i| p_pages += i.pages}
  247.           p_tilesets.push(map.tileset_id)
  248.           map.encounter_list.each {|i|
  249.               p_troops.push(i) unless (c_troops | p_troops).include?(i)}
  250.           bgm.push(map.bgm.name) if map.autoplay_bgm
  251.           bgs.push(map.bgs.name) if map.autoplay_bgs
  252.           c_maps.push(p_maps.shift)}
  253.       p_troops.clone.each {|id|
  254.           p_pages += _troops[id].pages
  255.           _troops[id].members.each {|member|
  256.               unless (c_enemies | p_enemies).include?(member.enemy_id)
  257.                 p_enemies.push(member.enemy_id)
  258.               end}
  259.           c_troops.push(p_troops.shift)}
  260.       p_enemies.clone.each {|id|
  261.           _enemies[id].actions.each {|i|
  262.               unless (c_skills | p_skills).include?(i.skill_id)
  263.                 p_skills.push(i.skill_id)
  264.               end}
  265.           if _enemies[id].treasure_prob > 0
  266.             if _enemies[id].item_id > 0
  267.               unless (c_items | p_items).include?(_enemies[id].item_id)
  268.                 p_items.push(_enemies[id].item_id)
  269.               end
  270.             elsif _enemies[id].weapon_id > 0
  271.               unless p_weapons.include?(_enemies[id].weapon_id)
  272.                 p_weapons.push(_enemies[id].weapon_id)
  273.               end
  274.             elsif _enemies[id].armor_id > 0
  275.               unless p_armors.include?(_enemies[id].armor_id)
  276.                 p_armors.push(_enemies[id].armor_id)
  277.               end
  278.             end
  279.           end
  280.           [_enemies[id].animation1_id, _enemies[id].animation2_id].each {|i|
  281.               p_animations.push(i) unless i == 0 || p_animations.include?(i)}
  282.           battlers.push(_enemies[id].battler_name)
  283.           c_enemies.push(p_enemies.shift)}
  284.       p_actors.clone.each {|id|
  285.           actor = _actors[id]
  286.           unless _actors[id].weapon_id == 0 || p_weapons.include?(_actors[id].weapon_id)
  287.             p_weapons.push(_actors[id].weapon_id)
  288.           end
  289.           [_actors[id].armor1_id, _actors[id].armor2_id,
  290.           _actors[id].armor3_id, _actors[id].armor4_id].each {|i|
  291.               p_armors.push(i) unless i == 0 || p_armors.include?(i)}
  292.           unless (c_classes | p_classes).include?(_actors[id].class_id)
  293.             p_classes.push(_actors[id].class_id)
  294.           end
  295.           characters.push(_actors[id].character_name)
  296.           battlers.push(_actors[id].battler_name)
  297.           c_actors.push(p_actors.shift)}
  298.       p_classes.clone.each {|id|
  299.           _classes[id].learnings.each {|i|
  300.               unless (c_skills | p_skills).include?(i.skill_id)
  301.                 p_skills.push(i.skill_id)
  302.               end}
  303.           c_classes.push(p_classes.shift)}
  304.       p_skills.clone.each {|id|
  305.           unless _skills[id].common_event_id == 0 ||
  306.               c_pages.include?(_skills[id].common_event_id)
  307.             p_pages.push(_pages[_skills[id].common_event_id])
  308.             c_pages.push(_skills[id].common_event_id)
  309.           end
  310.           _skills[id].plus_state_set.each {|i|
  311.               p_states.push(i) unless p_states.include?(i)}
  312.           [_skills[id].animation1_id, _skills[id].animation2_id].each {|i|
  313.               p_animations.push(i) unless i == 0 || p_animations.include?(i)}
  314.           icons.push(_skills[id].icon_name)
  315.           se.push(_skills[id].menu_se.name)
  316.           c_skills.push(p_skills.shift)}
  317.       p_items.clone.each {|id|
  318.           unless _items[id].common_event_id == 0 ||
  319.               c_pages.include?(_items[id].common_event_id)
  320.             p_pages.push(_pages[_items[id].common_event_id])
  321.             c_pages.push(_items[id].common_event_id)
  322.           end
  323.           _items[id].plus_state_set.each {|i|
  324.               p_states.push(i) unless p_states.include?(i)}
  325.           [_items[id].animation1_id, _items[id].animation2_id].each {|i|
  326.               p_animations.push(i) unless i == 0 || p_animations.include?(i)}
  327.           icons.push(_items[id].icon_name)
  328.           se.push(_items[id].menu_se.name)
  329.           c_items.push(p_items.shift)}
  330.       p_pages.clone.each {|page|
  331.           characters.push(page.graphic.character_name) if page.is_a?(RPG::Event::Page)
  332.           page.list.each {|command|
  333.               case command.code
  334.               when 117
  335.                 p_pages.push(_pages[command.parameters[0]])
  336.                 c_pages.push(command.parameters[0])
  337.               when 126
  338.                 if command.parameters[1] == 0 && command.parameters[2] == 0 &&
  339.                     !(c_items | p_items).include?(command.parameters[0])
  340.                   p_items.push(command.parameters[0])
  341.                 end
  342.               when 127
  343.                 if command.parameters[1] == 0 && command.parameters[2] == 0 &&
  344.                     !p_weapons.include?(command.parameters[0])
  345.                   p_weapons.push(command.parameters[0])
  346.                 end
  347.               when 128
  348.                 if command.parameters[1] == 0 && command.parameters[2] == 0 &&
  349.                     !p_armors.include?(command.parameters[0])
  350.                   p_armors.push(command.parameters[0])
  351.                 end
  352.               when 129
  353.                 if command.parameters[1] == 0 &&
  354.                     !(c_actors | p_actors).include?(command.parameters[0])
  355.                   p_actors.push(command.parameters[0])
  356.                 end
  357.               when 131 then windowskins.push(command.parameters[0])
  358.               when 132 then bgm.push(command.parameters[0].name)
  359.               when 133 then me.push(command.parameters[0].name)
  360.               when 201
  361.                 if command.parameters[0] == 0 &&
  362.                     !(c_maps | p_maps).include?(command.parameters[1])
  363.                   p_maps.push(command.parameters[1])
  364.                 end
  365.               when 204
  366.                 case command.parameters[0]
  367.                 when 0 then panoramas.push(command.parameters[1])
  368.                 when 1 then fogs.push(command.parameters[1])
  369.                 when 2 then battlebacks.push(command.parameters[1])
  370.                 end
  371.               when 207
  372.                 unless p_animations.include?(command.parameters[1])
  373.                   p_animations.push(command.parameters[1])
  374.                 end
  375.               when 209
  376.                 command.parameters[1].list.each {|move|
  377.                     characters.push(move.parameters[0]) if move.code == 41}
  378.               when 222 then transitions.push(command.parameters[0])
  379.               when 231 then pictures.push(command.parameters[1])
  380.               when 241 then bgm.push(command.parameters[0].name)
  381.               when 245 then bgs.push(command.parameters[0].name)
  382.               when 249 then me.push(command.parameters[0].name)
  383.               when 250 then se.push(command.parameters[0].name)
  384.               when 301
  385.                 unless c_troops.include?(command.parameters[0])
  386.                   p_troops.push(command.parameters[0])
  387.                 end
  388.               when 302
  389.                 goods = [command.parameters]
  390.                 index = page.list.index(command)
  391.                 loop do
  392.                   index += 1
  393.                   if page.list[index].code == 605
  394.                     goods.push(page.list[index].parameters)
  395.                   else
  396.                     break
  397.                   end
  398.                 end
  399.                 goods.each {|good|
  400.                     case good[0]
  401.                     when 0
  402.                       unless (c_items | p_items).include?(good[1])
  403.                         p_items.push(good[1])
  404.                       end
  405.                     when 1
  406.                       p_weapons.push(good[1]) unless p_weapons.include?(good[1])
  407.                     when 2
  408.                       p_armors.push(good[1]) unless p_armors.include?(good[1])
  409.                     end}
  410.               when 303
  411.                 unless (c_actors | p_actors).include?(command.parameters[0])
  412.                   p_actors.push(command.parameters[0])
  413.                 end
  414.               when 313
  415.                 if command.parameters[1] == 0 &&
  416.                     !p_states.include?(command.parameters[2])
  417.                   p_states.push(command.parameters[2])
  418.                 end
  419.               when 318
  420.                 unless (c_actors | p_actors).include?(command.parameters[0])
  421.                   p_actors.push(command.parameters[0])
  422.                 end
  423.                 if command.parameters[1] == 0 &&
  424.                     !(c_skills | p_skills).include?(command.parameters[2])
  425.                   p_skills.push(command.parameters[2])
  426.                 end
  427.               when 321
  428.                 unless (c_actors | p_actors).include?(command.parameters[0])
  429.                   p_actors.push(command.parameters[0])
  430.                 end
  431.                 unless (c_classes | p_classes).include?(command.parameters[1])
  432.                   p_classes.push(command.parameters[1])
  433.                 end
  434.               when 322
  435.                 unless (c_actors | p_actors).include?(command.parameters[0])
  436.                   p_actors.push(command.parameters[0])
  437.                 end
  438.                 characters.push(command.parameters[1])
  439.                 battlers.push(command.parameters[3])
  440.               when 333
  441.                 if command.parameters[1] == 0 &&
  442.                     !p_states.include?(command.parameters[2])
  443.                   p_states.push(command.parameters[2])
  444.                 end
  445.               when 336
  446.                 unless (c_enemies | p_enemies).include?(command.parameters[1])
  447.                   p_enemies.push(command.parameters[1])
  448.                 end
  449.               when 337
  450.                 unless p_animations.include?(command.parameters[2])
  451.                   p_animations.push(command.parameters[2])
  452.                 end
  453.               when 339
  454.                 if command.parameters[2] != 0 &&
  455.                     !(c_skills | p_skills).include?(command.parameters[3])
  456.                   p_skills.push(command.parameters[3])
  457.                 end
  458.               end}
  459.           p_pages.shift}
  460.       all = [p_maps, p_troops, p_enemies, p_actors, p_classes, p_skills,
  461.              p_items, p_pages]
  462.       break if all.all? {|ary| ary.size == 0}
  463.     end
  464.     p_weapons.each {|id|
  465.         _weapons[id].plus_state_set.each {|i|
  466.             p_states.push(i) unless p_states.include?(i)}
  467.         [_weapons[id].animation1_id, _weapons[id].animation2_id].each {|i|
  468.             p_animations.push(i) unless i == 0 || p_animations.include?(i)}
  469.         icons.push(_weapons[id].icon_name)}
  470.     p_armors.each {|id|
  471.         unless _armors[id].auto_state_id == 0 ||
  472.             p_states.include?(_armors[id].auto_state_id)
  473.           p_states.push(_armors[id].auto_state_id)
  474.         end
  475.         icons.push(_armors[id].icon_name)}
  476.     (_states - [nil]).each {|s|
  477.         p_states.push(s.id) if s.zero_hp && !p_states.include?(s.id)}
  478.     size = 0
  479.     while size != p_states.size
  480.       size = p_states.size
  481.       p_states.clone.each {|id| _states[id].plus_state_set.each {|i|
  482.               p_states.push(i) unless p_states.include?(i)}}
  483.     end
  484.     p_states.each {|id|
  485.         unless _states[id].animation_id == 0 ||
  486.             p_animations.include?(_states[id].animation_id)
  487.           p_animations.push(_states[id].animation_id)
  488.         end}
  489.     p_animations.each {|id|
  490.         animations.push(_animations[id].animation_name)
  491.         _animations[id].timings.each {|timing| se.push(timing.se.name)}}
  492.     p_tilesets.each {|id|
  493.         tilesets.push(_tilesets[id].tileset_name)
  494.         fogs.push(_tilesets[id].fog_name)
  495.         panoramas.push(_tilesets[id].panorama_name)
  496.         battlebacks.push(_tilesets[id].battleback_name)
  497.         (0..6).each {|i| autotiles.push(_tilesets[id].autotile_names[i])}}
  498.     all = [[_maps, _maps.keys - c_maps],
  499.     [_troops, (1..._troops.size).to_a - c_troops],
  500.     [_enemies, (1..._enemies.size).to_a - c_enemies],
  501.     [_actors, (1..._actors.size).to_a - c_actors],
  502.     [_classes, (1..._classes.size).to_a - c_classes],
  503.     [_skills, (1..._skills.size).to_a - c_skills],
  504.     [_items, (1..._items.size).to_a - c_items],
  505.     [_pages, (1..._pages.size).to_a - c_pages],
  506.     [_weapons, (1..._weapons.size).to_a - p_weapons],
  507.     [_armors, (1..._armors.size).to_a - p_armors],
  508.     [_states, (1..._states.size).to_a - p_states],
  509.     [_animations, (1..._animations.size).to_a - p_animations],
  510.     [_tilesets, (1..._tilesets.size).to_a - p_tilesets]]
  511.    
  512.     if $DEBUG
  513.       datas = [\'Maps\', \'Troops\', \'Enemies\', \'Actors\', \'Classes\', \'Skills\',
  514.                \'Items\', \'Common Events\', \'Weapons\', \'Armors\', \'States\',
  515.                \'Animations\', \'Tilesets\']
  516.       file = File.open(\'Unused.txt\', \'wb\')
  517.       datas.each_index {|i|
  518.           file.write("\\r\\n  --::>> Unused #{datas[i]} <<::--\\r\\n\\r\\n")
  519.           (all[i][1] | all[i][1]).each {|one|
  520.               file.write("#{sprintf(\'%03d\', one)}  :  #{all[i][0][one].name}\\r\\n")}
  521.           file.write("\\r\\n")}
  522.     end
  523.   else
  524.     (_actors - [nil]).each {|actor|
  525.         characters.push(actor.character_name)
  526.         battlers.push(actor.battler_name)}
  527.     (_skills + _items - [nil]).each {|object|
  528.         icons.push(object.icon_name)
  529.         se.push(object.menu_se.name)}
  530.     (_weapons + _armors - [nil]).each {|object| icons.push(object.icon_name)}
  531.     (_enemies - [nil]).each {|enemy| battlers.push(enemy.battler_name)}
  532.     (_animations - [nil]).each {|animation|
  533.         animations.push(animation.animation_name)
  534.         animation.timings.each {|timing| se.push(timing.se.name)}}
  535.     (_tilesets - [nil]).each {|tileset|
  536.         tilesets.push(tileset.tileset_name)
  537.         fogs.push(tileset.fog_name)
  538.         panoramas.push(tileset.panorama_name)
  539.         battlebacks.push(tileset.battleback_name)
  540.         (0..6).each {|i| autotiles.push(tileset.autotile_names[i])}}
  541.     (_troops - [nil]).each {|troop| _pages += troop.pages}
  542.     _keys = _maps.keys
  543.     _keys.each_index {|i|
  544.         Graphics.update if i % 20 == 0
  545.         events = load_data(sprintf("Data/Map%03d.rxdata", _keys[i])).events
  546.         events.values.each {|event| _pages += event.pages}}
  547.     _pages -= [nil]
  548.     _pages.each_index {|i|
  549.         Graphics.update if i % 100 == 0
  550.         if _pages[i].is_a?(RPG::Event::Page)
  551.           characters.push(_pages[i].graphic.character_name)
  552.         end
  553.         _pages[i].list.each {|command|
  554.             case command.code
  555.             when 131 then windowskins.push(command.parameters[0])
  556.             when 132 then bgm.push(command.parameters[0].name)
  557.             when 133 then se.push(command.parameters[0].name)
  558.             when 204
  559.               case command.parameters[0]
  560.               when 0 then panoramas.push(command.parameters[1])
  561.               when 1 then fogs.push(command.parameters[1])
  562.               when 2 then battlebacks.push(command.parameters[1])
  563.               end
  564.             when 209
  565.               command.parameters[1].list.each {|move|
  566.                   characters.push(move.parameters[0]) if move.code == 41}
  567.             when 222 then transitions.push(command.parameters[0])
  568.             when 231 then pictures.push(command.parameters[1])
  569.             when 241 then bgm.push(command.parameters[0].name)
  570.             when 245 then bgs.push(command.parameters[0].name)
  571.             when 249 then me.push(command.parameters[0].name)
  572.             when 250 then se.push(command.parameters[0].name)
  573.             when 322
  574.               characters.push(command.parameters[1])
  575.               battlers.push(command.parameters[3])
  576.             end}}
  577.           end
  578.  
  579.     if $DEBUG
  580.       folders = [\'Audio/BGM\', \'Audio/BGS\', \'Audio/ME\', \'Audio/SE\', \'Animations\',
  581.                  \'Autotiles\', \'Battlebacks\', \'Battlers\', \'Characters\', \'Fogs\',
  582.                  \'Gameovers\', \'Icons\', \'Panoramas\', \'Pictures\', \'Tilesets\',
  583.                  \'Titles\', \'Transitions\', \'Windowskins\']
  584.       all = [bgm, bgs, me, se, animations, autotiles, battlebacks, battlers,
  585.              characters, fogs, gameovers, icons, panoramas, pictures, tilesets,
  586.              titles, transitions, windowskins]
  587.       all.each {|ary| ary.delete(\'\'); ary.sort!}
  588.       file = File.open(\'Tested Resources.txt\', \'wb\')
  589.       folders.each_index {|i|
  590.           file.write("\\r\\n  ---::{ #{folders[i]} }::---\\r\\n\\r\\n")
  591.           (all[i] | all[i]).each {|one| file.write("#{folders[i]}/#{one}\\r\\n")}
  592.           file.write("\\r\\n")}
  593.       file.close
  594.     end
  595. rescue Errno::ENOENT
  596.   filename = $!.message.sub(\'No such file or directory - \', \'\')
  597.   print("File -- #{filename} -- is missing.")
  598. end
  599. end
');