[VX] Bestiary

Bestiary
by Dargor
Version 1.5


Introduction

I felt like doing a bestiary, so I did one!

Features
  • Customizable enemy list
  • Play a BGM depending on the enemy
  • Element Icons (To display elemental weakness)
  • You can cycle through enemy status (using L/R)
  • Compatible with Crissaegrim ABS

Screenshots
ImageImage

Script

Bestiary Script Spoiler
  1. #==============================================================================
  2. # ** Bestiary
  3. #------------------------------------------------------------------------------
  4. #    © Dargor, 2008
  5. #   31/08/08
  6. #   Version 1.5
  7. #------------------------------------------------------------------------------
  8. #   VERSION HISTORY:
  9. #     - 1.0 (21/05/08), Initial release
  10. #     - 1.1 (21/05/08), Minor bugs fixed
  11. #     - 1.2 (24/05/08), Reseted Bestiary bug fixed
  12. #     - 1.3 (01/06/08), Minor changes to the windows visibility/opacity
  13. #     - 1.4 (04/06/08), Bug fixed with cursor width
  14. #     - 1.5 (31/08/08), Compatible with Crissaegrim ABS
  15. #------------------------------------------------------------------------------
  16. #   INSTRUCTIONS:
  17. #     1) Paste the script above main
  18. #     2) Edit the Vocab variables
  19. #     2) Edit the constants in the Bestiary module
  20. #==============================================================================
  21.  
  22. #==============================================================================
  23. #   ** Bestiary Configuration
  24. #==============================================================================
  25.  
  26. module Bestiary
  27.   # Enemies that won't appear in the bestiary
  28.   Excluded_Enemies = [31]
  29.   # 'Real' Elements, displayed in the bestiary
  30.   Elements = [9,10,11,12,13,14,15,16]
  31.   # 'Real' Elements Icon Index
  32.   Element_Icons = { 9  => 104,
  33.                              10 => 105,
  34.                              11 => 106,
  35.                              12 => 107,
  36.                              13 => 108,
  37.                              14 => 109,
  38.                              15 => 110,
  39.                              16 => 111,
  40.                           }
  41.   # Play a BG' in the bestiary
  42.   Play_BGM = true
  43.   # BGM List based on enemy ID
  44.   BGM = { 19 => 'Battle7',
  45.               20 => 'Battle7',
  46.               21 => 'Battle7',
  47.               22 => 'Battle7',
  48.               23 => 'Battle7',
  49.               24 => 'Battle7',
  50.               25 => 'Battle8',
  51.               26 => 'Battle8',
  52.               27 => 'Battle8',
  53.               28 => 'Battle8',
  54.               29 => 'Battle8',
  55.               30 => 'Battle9'
  56.            }
  57.   # Default BGM name
  58.   BGM.default = 'Battle1'
  59.   # Use Action Battle System
  60.   # Set this to true ONLY if you are using Crissaegrim ABS
  61.   Use_ABS = false
  62. end
  63.  
  64. # Vocabulary
  65. Vocab::Hit = 'Hit Rate'
  66. Vocab::Eva = 'Evasion'
  67. Vocab::Exp = 'EXP'
  68. Vocab::UnknownEnemy = '??????'
  69. Vocab::UnknownDrop  = '??????'
  70.  
  71. #==============================================================================
  72. # ** Game_System
  73. #------------------------------------------------------------------------------
  74. #   This class handles system-related data. Also manages vehicles and BGM, etc.
  75. # The instance of this class is referenced by $game_system.
  76. #==============================================================================
  77.  
  78. class Game_System
  79.   #--------------------------------------------------------------------------
  80.   # * Public Instance Variables
  81.   #--------------------------------------------------------------------------
  82.   attr_accessor :new_enemy
  83.   attr_accessor :enemy_encountered
  84.   attr_accessor :enemy_defeated
  85.   attr_accessor :enemy_drops
  86.   #--------------------------------------------------------------------------
  87.   # * Alias Listing
  88.   #--------------------------------------------------------------------------
  89.   alias dargor_vx_bestiary_system_initialize initialize
  90.   #--------------------------------------------------------------------------
  91.   # * Object Initialization
  92.   #--------------------------------------------------------------------------
  93.   def initialize
  94.      @new_enemy = []
  95.      @enemy_encountered = []
  96.      @enemy_defeated = []
  97.      @enemy_drops = []
  98.      for i in 1...$data_enemies.size
  99.         @new_enemy[i] = true
  100.         @enemy_encountered[i] = 0
  101.         @enemy_defeated[i] = 0
  102.         @enemy_drops[i] = [false, false]
  103.      end
  104.      dargor_vx_bestiary_system_initialize
  105.   end
  106. end
  107.  
  108. #==============================================================================
  109. # ** Game_Troop
  110. #------------------------------------------------------------------------------
  111. #   This class handles enemy groups and battle-related data. Also performs
  112. # battle events. The instance of this class is referenced by $game_troop.
  113. #==============================================================================
  114.  
  115. class Game_Troop < Game_Unit
  116.   #--------------------------------------------------------------------------
  117.   # * Alias Listing
  118.   #--------------------------------------------------------------------------
  119.   alias dargor_vx_bestiary_troop_setup setup
  120.   alias dargor_vx_bestiary_troop_make_drop_items make_drop_items
  121.   #--------------------------------------------------------------------------
  122.   # * Setup
  123.   #        troop_id : troop ID
  124.   #--------------------------------------------------------------------------
  125.   def setup(troop_id)
  126.      dargor_vx_bestiary_troop_setup(troop_id)
  127.      for member in troop.members
  128.         next if $data_enemies[member.enemy_id] == nil
  129.         enemy = Game_Enemy.new(@enemies.size, member.enemy_id)
  130.         $game_system.enemy_encountered[member.enemy_id] += 1
  131.      end
  132.   end
  133.   #--------------------------------------------------------------------------
  134.   # * Create Array of Dropped Items
  135.   #--------------------------------------------------------------------------
  136.   def make_drop_items
  137.      drop_items = []
  138.      for enemy in dead_members
  139.         for di in [enemy.drop_item1, enemy.drop_item2]
  140.            next if di.kind == 0
  141.            next if rand(di.denominator) != 0
  142.            index = [enemy.drop_item1, enemy.drop_item2].index(di)
  143.            $game_system.enemy_drops[enemy.enemy_id][index] = true
  144.            if di.kind == 1
  145.               drop_items.push($data_items[di.item_id])
  146.            elsif di.kind == 2
  147.               drop_items.push($data_weapons[di.weapon_id])
  148.            elsif di.kind == 3
  149.               drop_items.push($data_armors[di.armor_id])
  150.            end
  151.         end
  152.      end
  153.      return drop_items
  154.   end
  155. end
  156.  
  157. #==============================================================================
  158. # ** Game_Enemy
  159. #------------------------------------------------------------------------------
  160. #   This class handles enemy characters. It's used within the Game_Troop class
  161. # ($game_troop).
  162. #==============================================================================
  163.  
  164. class Game_Enemy < Game_Battler
  165.   #--------------------------------------------------------------------------
  166.   # * Alias Listing
  167.   #--------------------------------------------------------------------------
  168.   alias dargor_vx_bestiary_enemy_perform_collapse perform_collapse
  169.   #--------------------------------------------------------------------------
  170.   # * Perform Collapse
  171.   #--------------------------------------------------------------------------
  172.   def perform_collapse
  173.      dargor_vx_bestiary_enemy_perform_collapse
  174.      if $game_temp.in_battle and dead?
  175.         $game_system.enemy_defeated[@enemy_id] += 1
  176.      end
  177.   end
  178. end
  179.  
  180. #==============================================================================
  181. # ** Game_Event
  182. #------------------------------------------------------------------------------
  183. #   This class deals with events. It handles functions including event page
  184. # switching via condition determinants, and running parallel process events.
  185. # It's used within the Game_Map class.
  186. #==============================================================================
  187.  
  188. class Game_Event < Game_Character
  189.   #--------------------------------------------------------------------------
  190.   # * Public Instance Variables
  191.   #--------------------------------------------------------------------------
  192.   attr_reader :encountered
  193.   #--------------------------------------------------------------------------
  194.   # * Alias Listing
  195.   #--------------------------------------------------------------------------
  196.   alias dargor_vx_bestiary_event_initialize initialize
  197.   alias dargor_vx_bestiary_event_update update
  198.   if Bestiary::Use_ABS
  199.      alias dargor_vx_bestiary_event_kill_enemy kill_enemy
  200.   end
  201.   #--------------------------------------------------------------------------
  202.   # * Object Initialization
  203.   #--------------------------------------------------------------------------
  204.   def initialize(map_id, event)
  205.      dargor_vx_bestiary_event_initialize(map_id, event)
  206.      @encountered = false
  207.      @defeated = false
  208.   end
  209.   #--------------------------------------------------------------------------
  210.   # * Update
  211.   #--------------------------------------------------------------------------
  212.   def update
  213.      if self.methods.include?('kill_enemy') && Bestiary::Use_ABS
  214.         if @in_battle && !@encountered
  215.            $game_system.enemy_encountered[@enemy_id] += 1
  216.            @encountered = true
  217.         end
  218.      end
  219.      dargor_vx_bestiary_event_update
  220.   end
  221.   #--------------------------------------------------------------------------
  222.   # * Kill enemy
  223.   #--------------------------------------------------------------------------
  224.   def kill_enemy
  225.      if self.methods.include?('kill_enemy') && Bestiary::Use_ABS && !@defeated
  226.         @defeated = true
  227.         $game_system.enemy_defeated[@enemy_id] += 1
  228.         $game_system.enemy_drops[@enemy_id][0] = true
  229.         $game_system.enemy_drops[@enemy_id][1] = true
  230.         dargor_vx_bestiary_event_kill_enemy
  231.      end
  232.   end
  233. end
  234.  
  235. #==============================================================================
  236. # ** Window_Base
  237. #------------------------------------------------------------------------------
  238. #   This is a superclass of all windows in the game.
  239. #==============================================================================
  240.  
  241. class Window_Base < Window
  242.   #--------------------------------------------------------------------------
  243.   # * Get HP Text Color
  244.   #        enemy : enemy
  245.   #--------------------------------------------------------------------------
  246.   def hp_color(actor)
  247.      return normal_color if actor.is_a?(RPG::Enemy)
  248.      return knockout_color if actor.hp == 0
  249.      return crisis_color if actor.hp < actor.maxhp / 4
  250.      return normal_color
  251.   end
  252.   #--------------------------------------------------------------------------
  253.   # * Draw Enemy MAXHP
  254.   #        enemy : enemy
  255.   #        x       : draw spot x-coordinate
  256.   #        y       : draw spot y-coordinate
  257.   #        width : Width
  258.   #--------------------------------------------------------------------------
  259.   def draw_enemy_maxhp(enemy, x, y, width = 120)
  260.      draw_enemy_hp_gauge(enemy, x, y, width)
  261.      self.contents.font.color = system_color
  262.      self.contents.draw_text(x, y, 30, WLH, Vocab::hp)
  263.      self.contents.font.color = hp_color(enemy)
  264.      last_font_size = self.contents.font.size
  265.      xr = x + width
  266.      self.contents.font.color = normal_color
  267.      self.contents.draw_text(xr - 80, y, 80, WLH, enemy.maxhp, 2)
  268.   end
  269.   #--------------------------------------------------------------------------
  270.   # * Draw Enemy HP gauge
  271.   #        enemy : enemy
  272.   #        x       : draw spot x-coordinate
  273.   #        y       : draw spot y-coordinate
  274.   #        width : Width
  275.   #--------------------------------------------------------------------------
  276.   def draw_enemy_hp_gauge(enemy, x, y, width = 120)
  277.      gw = width
  278.      gc1 = hp_gauge_color1
  279.      gc2 = hp_gauge_color2
  280.      self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  281.      self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  282.   end
  283.   #--------------------------------------------------------------------------
  284.   # * Draw Enemy MAXMP
  285.   #        enemy : enemy
  286.   #        x       : draw spot x-coordinate
  287.   #        y       : draw spot y-coordinate
  288.   #        width : Width
  289.   #--------------------------------------------------------------------------
  290.   def draw_enemy_maxmp(enemy, x, y, width = 120)
  291.      draw_enemy_mp_gauge(enemy, x, y, width)
  292.      self.contents.font.color = system_color
  293.      self.contents.draw_text(x, y, 30, WLH, Vocab::mp)
  294.      self.contents.font.color = hp_color(enemy)
  295.      last_font_size = self.contents.font.size
  296.      xr = x + width
  297.      self.contents.font.color = normal_color
  298.      self.contents.draw_text(xr - 80, y, 80, WLH, enemy.maxmp, 2)
  299.   end
  300.   #--------------------------------------------------------------------------
  301.   # * Draw Enemy MP gauge
  302.   #        enemy : enemy
  303.   #        x       : draw spot x-coordinate
  304.   #        y       : draw spot y-coordinate
  305.   #        width : Width
  306.   #--------------------------------------------------------------------------
  307.   def draw_enemy_mp_gauge(enemy, x, y, width = 120)
  308.      gw = width
  309.      gc1 = mp_gauge_color1
  310.      gc2 = mp_gauge_color2
  311.      self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
  312.      self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  313.   end
  314.   #--------------------------------------------------------------------------
  315.   # * Draw Enemy Parameters
  316.   #        enemy : enemy
  317.   #        x       : draw spot x-coordinate
  318.   #        y       : draw spot y-coordinate
  319.   #        type  : Type of parameters (0-7)
  320.   #--------------------------------------------------------------------------
  321.   def draw_enemy_parameter(enemy, x, y, type)
  322.      case type
  323.      when 0
  324.         parameter_name = Vocab::atk
  325.         parameter_value = enemy.atk
  326.      when 1
  327.         parameter_name = Vocab::def
  328.         parameter_value = enemy.def
  329.      when 2
  330.         parameter_name = Vocab::spi
  331.         parameter_value = enemy.spi
  332.      when 3
  333.         parameter_name = Vocab::agi
  334.         parameter_value = enemy.agi
  335.      when 4
  336.         parameter_name = Vocab::Hit
  337.         parameter_value = enemy.hit
  338.      when 5
  339.         parameter_name = Vocab::Eva
  340.         parameter_value = enemy.eva
  341.      when 6
  342.         parameter_name = Vocab::Exp
  343.         parameter_value = enemy.exp
  344.      when 7
  345.         parameter_name = Vocab::gold
  346.         parameter_value = enemy.gold
  347.      end
  348.      self.contents.font.color = system_color
  349.      self.contents.draw_text(x, y, 120, WLH, parameter_name)
  350.      self.contents.font.color = normal_color
  351.      parameter_value = "#{parameter_value}%" if [4,5].include?(type)
  352.      self.contents.draw_text(x + 100, y, 56, WLH, parameter_value, 2)
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # * Draw Enemy Drop
  356.   #        enemy : enemy
  357.   #        x       : draw spot x-coordinate
  358.   #        y       : draw spot y-coordinate
  359.   #--------------------------------------------------------------------------
  360.   def draw_enemy_drop(enemy,x,y)
  361.      self.contents.font.color = system_color
  362.      self.contents.draw_text(x,y,220,WLH,'Items Dropped')
  363.      drops = []
  364.      drops_index = []
  365.      drops << enemy.drop_item1 unless enemy.drop_item1.kind == 0
  366.      drops << enemy.drop_item2 unless enemy.drop_item2.kind == 0
  367.      drops_index << 0 unless enemy.drop_item1.kind == 0
  368.      drops_index << 1 unless enemy.drop_item2.kind == 0
  369.      for i in 0...drops.size
  370.         drop = drops[i]
  371.         index = drops_index[i]
  372.         case drop.kind
  373.         when 1
  374.            item = $data_items[drop.item_id]
  375.         when 2
  376.            item = $data_weapons[drop.weapon_id]
  377.         when 3
  378.            item = $data_armors[drop.armor_id]
  379.         end
  380.         if $game_system.enemy_drops[enemy.id][index]
  381.            draw_item_name(item,x,y + (i+1) * WLH)
  382.            probability = 100 / drop.denominator
  383.            self.contents.draw_text(x,y + (i+1) * WLH,220,WLH, "#{probability}%",2)
  384.         else
  385.            self.contents.font.color = normal_color
  386.            self.contents.draw_text(x+26,y + (i+1) * WLH,220,WLH,Vocab::UnknownDrop)
  387.         end
  388.      end
  389.   end
  390.   #--------------------------------------------------------------------------
  391.   # * Draw Enemy Encountered
  392.   #        enemy : enemy
  393.   #        x       : draw spot x-coordinate
  394.   #        y       : draw spot y-coordinate
  395.   #--------------------------------------------------------------------------
  396.   def draw_enemy_encountered(enemy,x,y)
  397.      self.contents.font.color = system_color
  398.      self.contents.draw_text(x,y,120,WLH,'Encountered')
  399.      times = $game_system.enemy_encountered[enemy.id]
  400.      self.contents.font.color = normal_color
  401.      self.contents.draw_text(x + 120,y,36,WLH,times,2)
  402.   end
  403.   #--------------------------------------------------------------------------
  404.   # * Draw Enemy Defeated
  405.   #        enemy : enemy
  406.   #        x       : draw spot x-coordinate
  407.   #        y       : draw spot y-coordinate
  408.   #--------------------------------------------------------------------------
  409.   def draw_enemy_defeated(enemy,x,y)
  410.      self.contents.font.color = system_color
  411.      self.contents.draw_text(x,y,120,WLH,'Defeated')
  412.      times = $game_system.enemy_defeated[enemy.id]
  413.      self.contents.font.color = normal_color
  414.      self.contents.draw_text(x + 120,y,36,WLH,times,2)
  415.   end
  416.   #--------------------------------------------------------------------------
  417.   # * Draw Enemy Weakness
  418.   #        enemy : enemy
  419.   #        x       : draw spot x-coordinate
  420.   #        y       : draw spot y-coordinate
  421.   #--------------------------------------------------------------------------
  422.   def draw_enemy_weakness(enemy,x,y)
  423.      enemy = Game_Enemy.new(0, enemy.id)
  424.      self.contents.font.color = system_color
  425.      self.contents.draw_text(x,y,120,WLH,'Weakness')
  426.      weakness = []
  427.      for element_id in Bestiary::Elements
  428.         weakness << element_id if enemy.element_rate(element_id) > 100
  429.      end
  430.      for i in 0...weakness.size
  431.         element_id = weakness[i]
  432.         x = 144 * (i % 2)
  433.         y2 = WLH * (i / 2)
  434.         icon_index = Bestiary::Element_Icons[element_id]
  435.         draw_icon(icon_index,x,y2 + (y + WLH))
  436.         element = $data_system.elements[element_id]
  437.         self.contents.font.color = normal_color
  438.         self.contents.draw_text(x+26,y2 + (y + WLH),120,WLH,element)
  439.      end
  440.   end
  441. end
  442.  
  443. #==============================================================================
  444. # ** Window_EnemyStatus
  445. #------------------------------------------------------------------------------
  446. #   This window displays full status specs on the bestiary screen.
  447. #==============================================================================
  448.  
  449. class Window_EnemyStatus < Window_Base
  450.   #--------------------------------------------------------------------------
  451.   # * Object Initialization
  452.   #--------------------------------------------------------------------------
  453.   def initialize
  454.      super(0,0,544,416)
  455.   end
  456.   #--------------------------------------------------------------------------
  457.   # * Setup
  458.   #        enemy : enemy
  459.   #        id     : bestiary id
  460.   #--------------------------------------------------------------------------
  461.   def setup(enemy, id)
  462.      @enemy = enemy
  463.      @id = id
  464.      $game_system.new_enemy[enemy.id] = false
  465.      refresh
  466.   end
  467.   #--------------------------------------------------------------------------
  468.   # * Refresh
  469.   #--------------------------------------------------------------------------
  470.   def refresh
  471.      self.contents.clear
  472.      bitmap = Cache.battler(@enemy.battler_name, @enemy.battler_hue)
  473.      self.contents.blt(0,32,bitmap,bitmap.rect)
  474.      self.contents.font.color = normal_color
  475.      self.contents.draw_text(0,0,272,WLH,"#{@id}: #{@enemy.name}")
  476.      draw_enemy_maxhp(@enemy,272,WLH * 1,156)
  477.      draw_enemy_maxmp(@enemy,272,WLH * 2,156)
  478.      for i in 0..7
  479.         draw_enemy_parameter(@enemy, 304, WLH * 3 + (WLH * i), i)
  480.      end
  481.      draw_enemy_drop(@enemy,272,WLH * 11)
  482.      draw_enemy_encountered(@enemy,272,WLH * 14)
  483.      draw_enemy_defeated(@enemy,272,WLH * 15)
  484.      draw_enemy_weakness(@enemy,0,WLH * 11)
  485.   end
  486. end
  487.  
  488. #==============================================================================
  489. # ** Window_EnemyList
  490. #------------------------------------------------------------------------------
  491. #   This window displays full status specs on the bestiary screen.
  492. #==============================================================================
  493.  
  494. class Window_EnemyList < Window_Selectable
  495.   #--------------------------------------------------------------------------
  496.   # * Object Initialization
  497.   #        x       : draw spot x-coordinate
  498.   #        y       : draw spot y-coordinate
  499.   #--------------------------------------------------------------------------
  500.   def initialize(x,y)
  501.      super(x,y,544,360)
  502.      @column_max = 2
  503.      self.index = 0
  504.      refresh
  505.   end
  506.   #--------------------------------------------------------------------------
  507.   # * Enemy
  508.   #--------------------------------------------------------------------------
  509.   def enemy
  510.      return @data[self.index]
  511.   end
  512.   #--------------------------------------------------------------------------
  513.   # * Enemies
  514.   #--------------------------------------------------------------------------
  515.   def enemies
  516.      return @data
  517.   end
  518.   #--------------------------------------------------------------------------
  519.   # * Refresh
  520.   #--------------------------------------------------------------------------
  521.   def refresh
  522.      self.contents.clear
  523.      @data = []
  524.      for item in $data_enemies
  525.         next if Bestiary::Excluded_Enemies.include?(item.id)
  526.         @data << item
  527.      end
  528.      @data.compact!
  529.      @item_max = @data.size
  530.      create_contents
  531.      for i in 0...@item_max
  532.         draw_item(i)
  533.      end
  534.   end
  535.   #--------------------------------------------------------------------------
  536.   # * Draw Item
  537.   #        index : index
  538.   #--------------------------------------------------------------------------
  539.   def draw_item(index)
  540.      rect = item_rect(index)
  541.      self.contents.clear_rect(rect)
  542.      item = @data[index]
  543.      if item != nil
  544.         rect.width -= 4
  545.         if $game_system.enemy_encountered[item.id] > 0
  546.            if $game_system.new_enemy[item.id]
  547.               self.contents.font.color = power_up_color
  548.            else
  549.               self.contents.font.color = normal_color
  550.            end
  551.            self.contents.draw_text(rect, "#{index+1}:#{item.name}")
  552.         else
  553.            self.contents.font.color = normal_color
  554.            text = "#{index+1}:#{Vocab::UnknownEnemy}"
  555.            x = rect.x
  556.            y = rect.y
  557.            width = rect.width
  558.            height = rect.height
  559.            bitmap = self.contents
  560.            color1 = Color.new(255,0,0)
  561.            color2 = Color.new(0,255,0)
  562.            self.contents.draw_text(rect, "#{index+1}:#{Vocab::UnknownEnemy}")
  563.         end
  564.      end
  565.   end
  566. end
  567. #==============================================================================
  568. # ** Scene_Bestiary
  569. #------------------------------------------------------------------------------
  570. #   This class performs the bestiary screen processing.
  571. #==============================================================================
  572.  
  573. class Scene_Bestiary < Scene_Base
  574.   #--------------------------------------------------------------------------
  575.   # * Start processing
  576.   #--------------------------------------------------------------------------
  577.   def start
  578.      super
  579.      create_menu_background
  580.      @last_bgm = RPG::BGM.last
  581.      @help_window = Window_Help.new
  582.      @list_window = Window_EnemyList.new(0,56)
  583.      @status_window = Window_EnemyStatus.new
  584.      @status_window.visible = false
  585.      encountered = 0
  586.      for enemy in @list_window.enemies
  587.         if $game_system.enemy_encountered[enemy.id] > 0
  588.            encountered += 1
  589.         end
  590.      end
  591.      completion1 = "#{encountered}/#{@list_window.enemies.size}"
  592.      completion2 = (encountered * 100) / @list_window.enemies.size
  593.      @help_window.set_text("Completion: #{completion1}(#{completion2}%)")
  594.   end
  595.   #--------------------------------------------------------------------------
  596.   # * Termination Processing
  597.   #--------------------------------------------------------------------------
  598.   def terminate
  599.      super
  600.      $game_message.texts = []
  601.      dispose_menu_background
  602.      @help_window.dispose
  603.      @list_window.dispose
  604.      @status_window.dispose
  605.   end
  606.   #--------------------------------------------------------------------------
  607.   # * Frame Update Processing
  608.   #--------------------------------------------------------------------------
  609.   def update
  610.      super
  611.      if @status_window.visible
  612.         update_status_selection
  613.         return
  614.      end
  615.      if @list_window.active
  616.         @list_window.update
  617.         update_list_selection
  618.         return
  619.      end
  620.   end
  621.   #--------------------------------------------------------------------------
  622.   # * Update Status Selection
  623.   #--------------------------------------------------------------------------
  624.   def update_status_selection
  625.      if Input.trigger?(Input::B)
  626.         Sound.play_cancel
  627.         @status_window.visible = false
  628.         @list_window.visible = true
  629.         @help_window.visible = true
  630.         @last_bgm.play
  631.         return
  632.      end
  633.      if Input.trigger?(Input::L) or Input.repeat?(Input::L)
  634.         Sound.play_cursor
  635.         loop do
  636.            @list_window.index = (@list_window.index + 1)
  637.            @list_window.index %= @list_window.enemies.size
  638.            break if $game_system.enemy_encountered[@list_window.index+1] > 0
  639.         end
  640.         process_status_window(@list_window.enemy, @list_window.index+1)
  641.      end
  642.      if Input.trigger?(Input::R) or Input.repeat?(Input::R)
  643.         Sound.play_cursor
  644.         loop do
  645.            @list_window.index = (@list_window.index - 1) % @list_window.enemies.size
  646.            break if $game_system.enemy_encountered[@list_window.index+1] > 0
  647.         end
  648.         process_status_window(@list_window.enemy, @list_window.index+1)
  649.      end
  650.   end
  651.   #--------------------------------------------------------------------------
  652.   # * Update List Selection
  653.   #--------------------------------------------------------------------------
  654.   def update_list_selection
  655.      if Input.trigger?(Input::B)
  656.         Sound.play_cancel
  657.         $scene = Scene_Map.new
  658.         return
  659.      end
  660.      if Input.trigger?(Input::C)
  661.         unless $game_system.enemy_encountered[@list_window.enemy.id] > 0
  662.            Sound.play_buzzer
  663.            return
  664.         end
  665.         process_status_window(@list_window.enemy, @list_window.index+1)
  666.      end
  667.   end
  668.   #--------------------------------------------------------------------------
  669.   # * Process Status Window
  670.   #--------------------------------------------------------------------------
  671.   def process_status_window(enemy, index)
  672.      if Bestiary::Play_BGM
  673.         bgm_name = Bestiary::BGM[enemy.id]
  674.         if bgm_name.nil?
  675.            bgm = RPG::BGM.new(Bestiary::BGM.default)
  676.            bgm.play
  677.         else
  678.            bgm = RPG::BGM.new(bgm_name)
  679.            bgm.play
  680.         end
  681.      end
  682.      @status_window.setup(enemy, index)
  683.      @status_window.visible = true
  684.      @list_window.visible = false
  685.      @help_window.visible = false
  686.      @list_window.draw_item(index-1)
  687.   end
  688. end
Expand to see the code.

Bestiary (Menu COmmand) Spoiler
  1. #==============================================================================
  2. # ** Custom Menu Commands - Bestiary
  3. #------------------------------------------------------------------------------
  4. #    © Dargor, 2008
  5. #   26/05/08
  6. #   Requested by reikei 
  7. #==============================================================================
  8.  
  9. # Vocabulary
  10. Vocab::Bestiary = 'Bestiary'
  11.  
  12. #==============================================================================
  13. # ** Scene_Menu
  14. #------------------------------------------------------------------------------
  15. #   This class performs the menu screen processing.
  16. #==============================================================================
  17.  
  18. class Scene_Menu < Scene_Base
  19.   #--------------------------------------------------------------------------
  20.   # * Alias Listing
  21.   #--------------------------------------------------------------------------
  22.   alias dargor_vx_cmcbestiary_menu_create_command_window create_command_window
  23.   alias dargor_vx_cmcbestiary_menu_update_command_selection update_command_selection
  24.   #--------------------------------------------------------------------------
  25.   # * Create Command Window
  26.   #--------------------------------------------------------------------------
  27.   def create_command_window
  28.      commands = $game_system.menu_commands
  29.      index = commands.index(Vocab::save)
  30.      $game_system.add_menu_command(index, Vocab::Bestiary)
  31.      dargor_vx_cmcbestiary_menu_create_command_window
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   # * Update Command Selection
  35.   #--------------------------------------------------------------------------
  36.   def update_command_selection
  37.      dargor_vx_cmcbestiary_menu_update_command_selection
  38.      command = @command_window.selection
  39.      if Input.trigger?(Input::C)
  40.         case @command_window.selection
  41.         when Vocab::Bestiary
  42.            $scene = Scene_Bestiary.new(true)
  43.         end
  44.      end
  45.   end
  46. end
  47.  
  48. #==============================================================================
  49. # ** Scene_Bestiary
  50. #------------------------------------------------------------------------------
  51. #   This class performs the bestiary screen processing.
  52. #==============================================================================
  53.  
  54. class Scene_Bestiary < Scene_Base
  55.   #--------------------------------------------------------------------------
  56.   # * Alias Listing
  57.   #--------------------------------------------------------------------------
  58.   alias dargor_vx_cmcbestiary_update_list_selection update_list_selection
  59.   #--------------------------------------------------------------------------
  60.   # * Object Initialization
  61.   #--------------------------------------------------------------------------
  62.   def initialize(from_menu=false)
  63.      @from_menu = from_menu
  64.   end
  65.   #--------------------------------------------------------------------------
  66.   # * Update List Selection
  67.   #--------------------------------------------------------------------------
  68.   def update_list_selection
  69.      if Input.trigger?(Input::B)
  70.         Sound.play_cancel
  71.         if @from_menu
  72.            index = $game_system.menu_commands.index(Vocab::Bestiary)
  73.            $scene = Scene_Menu.new(index)
  74.         else
  75.            $scene = Scene_Map.new
  76.         end
  77.         return
  78.      end
  79.      dargor_vx_cmcbestiary_update_list_selection
  80.   end
  81. end
Expand to see the code.
this is kind of a stupid question, but once i put the script into my game, how do i access the beastiary in-game?
Use a Script Call event command and write $scene = Scene_Bestiary.new
By the way, I have updated the script 5 seconds ago because I left a tiny bug 🙂
alright, just tested it out in my game and it works great. i used to have another beastiery script but this one is much better. awesome job.
also, have u ever considered making an Item Collection type script that keeps track of all of the items you've collected throughout the game? kinda of like the same thing except for items
AlbinoWalken69 wrote:
alright, just tested it out in my game and it works great. i used to have another beastiery script but this one is much better. awesome job.
also, have u ever considered making an Item Collection type script that keeps track of all of the items you've collected throughout the game? kinda of like the same thing except for items


I'm glad you like it! ^^
I never thought about that, it's a good idea.
This is great, you should make one for rmxp IMO. Nice work m8.
actually, i came across an error when testing my game. i have no other scripts added but whenever i make an enemy weak against an element, i get an error message when i try to view their bestiary entry that says

Script 'bestiery' line 371:NameError occured.

unitialized constant Window_Base::Junction



please help
Sorry, I used a variable from another of my scripts. I have updated the script and fixed another bug at the same time. :thumb:
alright thanks. works perfect now. great job
Wow, I did have another bestiary but this one looks much better.
Looks Great!, but i'm very old fasioned.

Can you make the same for the XP?. :)
i came across another problem. whenever i fight a monster and check the bestiary, the correct entry for the monster is there but when i save my game and then load it, the bestiary is empty again. help plz
@AlbinoWalken69 
Thanks for the report. Script updated! :thumb:

@mephisto
I'm not planning on doing anymore scripts for XP.
I have my Final Fantasy 6 SDK to finish on XP and that's enough for me.
Hey Dargor? Is there any way you could port your FFVI project to RMVX for me? I know it's a hassle, but I only have VX and can't pay for XP right now. I'm a huge FFVI fan, and I'm begging you to at least try for me. If you can't it's OK, but I'll be sad. Thanks!
Nice work Dargor, quite a bit better than my current bestiary.  Keep it up!
sorry for all of the posts but i found another error

i havet changed anything at all in script, just copied and pasted it from this site and whenever i enter a battle ingame, the game crashes and i get an error message that says

Script 'Bestiary' line 124: NoMethodError occurred.
undefined method '[]' for nil:NilClass

please help
Do you have any other scripts? Especially scripts that changes Game_System and Game_Troop?
alright, i fixed it, thanks
Erm,

http://i284.photobucket.com/albums/ll9/ ... yError.jpg[/img]
Great script, but for some reason for my game it doesn't every track that an enemy was defeated?
Ryuzaki wrote:


I got the same problem
For those of you getting that error does it occur when you hit new game?  Some scripts don't work when you place them in a game and reload a save file.
Do'h I forgot about that. Thx. But does this script only support the RTp monsters, because i encountered 2 monsters a made-my-self monster and a slime but only the slime was indexed
Slight glitch.  I noticed when you enter the Bestiary, the selector shows the whole width of the screen the shortens to half.  Is this a RMVX bug or a bug in your script?  I think I may have noticed it in an Inn selection once, but I'm not sure.

Also, awesome script BTW :)
krudtso wrote:
Do'h I forgot about that. Thx. But does this script only support the RTp monsters, because i encountered 2 monsters a made-my-self monster and a slime but only the slime was indexed


They're probably there just way at the bottom.  Check the bottom of your beastiry list.  (The monsters are indexed by their database monster index).
Thanks for the reports. I'll fix these bugs today.
Hmmm... i tested it a little further and it seems like all other custom monsters are indexed other than one. I have 39 monsters, and it show 38 spots in the bestiary. Nr. 31 dosn't seem to work, can this have anything to do with other custom scripts?
Hi Dargor
I am one Maker of Brazil

I have translated you script for portuguese language...
And also I don't have forget to give your credits in script
Because this script is 100% of you ^^

Thanks for you colaboration

Bye
See Ya
@krudtso
It's because enemy 31 is included in the Excluded_Enemies array. Every monsters of from the database will be added to the bestiary unless you specify otherwise with this array.

@Genesis
no problem.

@Gabriot
I've not been able to encounter the error you mentioned.
It works fine when loading a game.

EDIT:
I have updated the script to version 1.4.
krudtso wrote:
Hmmm... i tested it a little further and it seems like all other custom monsters are indexed other than one. I have 39 monsters, and it show 38 spots in the bestiary. Nr. 31 dosn't seem to work, can this have anything to do with other custom scripts?


Look into the script and look for the section with a comment # Enemies that won't appear in the bestiary
Number 31 is the default enemy excluded from the beastiry.  You can take it out or add in others as you see fit.

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=47559