Bestiary Script V1.1

Any luck on those errors I posted?

In the meantime, I got the font to work, but not the Windowskin. I get the error:
Quote:
Script "Window_" line 64: RGSSError occurred.

disposed window


This is the modified version of Window_
Content Hidden Spoiler
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Trickster\'s Bestiary')

class Window_BestiaryCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Call Window_Selectable#initialize
    super(0, 0, 160, 480)
    # Setup Item Max
    @item_max = $game_system.enemies.size
    # Create Contents
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    # Set Font to Shadow
    #self.contents.font.shadow = true
    # Refresh Window
    refresh
    # Set Index to 0
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Get Battler
  #--------------------------------------------------------------------------
  def battler
    return $game_system.enemies[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # Clear Contents
    self.contents.clear
    # Draw Each Item
    $game_system.enemies.each_index {|index| draw_item(index)}
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    # Get Enemy ID
    enemy_id = $game_system.enemies[index]
    # Get Position
    x, y = 4, index * 32
    # Get Enemy
    enemy = $data_enemies[enemy_id]
    # If Seen At Least Once
    name = $game_system.seen[enemy_id] > 0 ? enemy.name : Bestiary::Not_Seen
    # Draw Index
    self.contents.draw_text(x, y, 32, 32, sprintf("%03d:", index+1))
    # Draw Name
    self.contents.draw_text(x + 36, y, contents.width, 32, name)
  end
end
   
class Window_Bestiary < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Define Windowskin
    self.windowskin = RPG::Cache.windowskin("PlainPearl")
    # Call Window Base#initialize
    super(160, 0, 480, 480)
    # Setup Contents
    self.contents = Bitmap.new(width - 32, height - 32)
    # Set Font
    self.contents.font.name = "LinusScript"
    # Set Shadow
    #self.contents.font.shadow = true
    # Setup Instance Variables
    @battler = nil
    # Refresh Window
    refresh
  end
  #--------------------------------------------------------------------------
  # * Set Battler
  #--------------------------------------------------------------------------
  def battler=(battler)
    # Return if a battler and ids are the same
    return if @battler != nil and @battler.id == battler
    # Set Battler
    @battler = $data_enemies[battler]
    # Refresh
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # if battler is nil or not seen
    if @battler == nil or $game_system.seen[@battler.id] == 0
      # Clear
      self.contents.clear
      # Return
      return
    end
    # Clear Contents
    self.contents.clear
    # Setup Local Variable battler
    battler = @battler
    # Draw Name
    draw_actor_name(battler, 0, 0)
    # Draw Hp
    draw_actor_hp(battler, 176, 0, 112)
    # Draw Sp
    draw_actor_sp(battler, 328, 0, 112)
    # Draw Enemy
    draw_enemy(battler, 0, 32, 176, 176)
    # Do 10 times
    10.times do |i|
      # Get X and Y
      x, y = (i % 2) == 0 ? 176 : 328, (i / 2) * 32 + 32
      # Draw Parameter
      draw_parameter(battler, x, y, 80, i)
    end
    # Draw Seens
    draw_seens(battler, 328, 192, 80)
    # Draw Kills
    draw_kills(battler, 328, 224, 80)
    # Draw Items
    draw_battler_items(battler, 0, 192)
    # Draw Elements
    draw_battler_elements(battler, 0, 224, 328)
    # Draw Maps Where can be found
    draw_maps(battler, 0, 288, 328)
    # Draw Description
    draw_battler_description(battler, 0, 352)
  end
  #--------------------------------------------------------------------------
  # * Draw Name
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 176, 32, actor.name, 1)
  end
  #--------------------------------------------------------------------------
  # * Draw HP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 144)
    # Draw "HP" text string
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
    # Draw HP
    self.contents.font.color =  normal_color
    self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw SP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_sp(actor, x, y, width = 144)
    # Draw "SP" text string
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
    # Draw SP
    self.contents.font.color =  normal_color
    self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Seens
  #--------------------------------------------------------------------------
  def draw_seens(battler, x, y, width)
    # System Color Font
    self.contents.font.color = system_color
    # Draw Parameter Name
    self.contents.draw_text(x, y, width, 32, 'Seen')
    # Normal Color Font
    self.contents.font.color = normal_color
    # Get Value
    value = $game_system.seen[battler.id].to_s
    # Draw Value
    self.contents.draw_text(x + 32, y, width, 32, value, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Kills
  #--------------------------------------------------------------------------
  def draw_kills(battler, x, y, width)
    # System Color Font
    self.contents.font.color = system_color
    # Draw Parameter Name
    self.contents.draw_text(x, y, width, 32, 'Killed')
    # Normal Color Font
    self.contents.font.color = normal_color
    # Get Value
    value = $game_system.killed[battler.id].to_s
    # Draw Value
    self.contents.draw_text(x + 32, y, width, 32, value, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Parameter
  #--------------------------------------------------------------------------
  def draw_parameter(battler, x, y, width, type)
    # Setup Array (Array of Strings)
    array = %w( atk pdef mdef str dex agi int eva gold exp )
    # If type is not eva or exp
    if not ['eva','exp'].include?(array[type])
      # Call $data_system.words.(variable)
      name = $data_system.words.method(array[type]).call
    else
      # Just Capitalize it
      name = array[type].capitalize
    end
    # Call battler.(variable) to get value
    value = battler.method(array[type]).call.to_s
    # System Color Font
    self.contents.font.color = system_color
    # Draw Parameter Name
    self.contents.draw_text(x, y, width, 32, name)
    # Normal Color Font
    self.contents.font.color = normal_color
    # Draw Value
    self.contents.draw_text(x + 32, y, width, 32, value, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Battler Items
  #--------------------------------------------------------------------------
  def draw_battler_items(battler, x, y)
    # Get Width
    cx = contents.text_size('Items:').width
    # Draw Items:
    self.contents.draw_text(x, y, width, 32, 'Items:')
    # Set Total Width
    total_width = cx + 8
    # Setup Battler Array
    item_array = [battler.item_id, battler.weapon_id, battler.armor_id]
    # Get Secondary Item Ids
    secondary = battler.respond_to?(:get_item_ids) ? battler.get_item_ids : []
    # Get Rare Item Ids
    rare = battler.respond_to?(:get_rare_ids) ? battler.get_rare_ids : []
    # If An Item
    if item_array.max != 0
      # Item Id
      item_id = item_array.max
      # Item Type
      item_type = item_array.index(item_id)
      # Branch By Item Type
      case item_type
      when 0
        item = $data_items[item_id]
      when 1
        item = $data_weapons[item_id]
      when 2
        item = $data_armors[item_id]
      end
      # Get Item Name
      item_name = item.name + ((secondary + rare).empty? ? '' : ',')
      # Get Width
      width = contents.text_size(item_name).width
      # Draw Item Name
      self.contents.draw_text(x + cx + 8, y, width, 32, item_name)
      # Set Total Width
      total_width = cx + 16 + width
    end
    # If not empty?
    if not secondary.empty?
      # Get Item ID and Item Type
      item_id, item_type = secondary[0..1]
      # Branch By Item Type
      case item_type
      when 1
        item = $data_items[item_id]
      when 2
        item = $data_weapons[item_id]
      when 3
        item = $data_armors[item_id]
      end
      # Get Item Name
      item_name = item.name + (rare.empty? ? '' : ',')
      # Get Width
      width = contents.text_size(item_name).width
      # Draw Item Name
      self.contents.draw_text(x + total_width, y, width, 32, item_name)
      # Add to Total Width
      total_width += 8 + width
    end
    # If not Empty
    if not rare.empty?
      # Get Item ID and Item Type
      item_id, item_type = rare[0..1]
      # Branch By Item Type
      case item_type
      when 1
        item = $data_items[item_id]
      when 2
        item = $data_weapons[item_id]
      when 3
        item = $data_armors[item_id]
      end
      # Get Width
      width = contents.text_size(item.name).width
      # Set Text to Gold
      self.contents.font.color = Color.new(255, 224, 32)
      # Draw Item Name
      self.contents.draw_text(x + total_width, y, width, 32, item.name)
      # Set Text to Normal Color
      self.contents.font.color = normal_color
      # Add to Total Width
      total_width += 8 + width
    end
    # If Nothing Drawn (that is total width is cx + 8)
    if total_width == cx + 8
      # Draw Nothing
      self.contents.draw_text(x + cx + 8, y, self.width, 32, 'None')
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Enemy
  #--------------------------------------------------------------------------
  def draw_enemy(enemy, x, y, width, height, opacity = 255)
    # Get Bitmap
    bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
    # If Stretching
    if Bestiary::Draw_Type == 0
      # Fit Blt (See MACL)
      self.contents.fit_blt(x, y, width, height, bitmap, opacity)
    # If Cropping
    else
      # Get Direction of Crop
      dir = Bestiary::Crop[enemy.id]
      # Crop Blt (See MACL)
      self.contents.crop_blt(x, y, width, height, bitmap, dir, 1, opacity)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Battler Elements
  #--------------------------------------------------------------------------
  def draw_battler_elements(battler, x, y, width)
    # Get Weakesses
    elements = battler.weaknesses
    # Set String
    string = 'Weak: '
    # If Elements not empty
    if not elements.empty?
      # Set Name OF Element
      elements.each {|element| string += $data_system.elements[element] + ', '}
      # Remove Last Two Characters
      string[-2, 2] = ''
    else
      # Add None
      string += 'None'
    end
    # Draw Weakness String
    self.contents.draw_text(x, y, width, 32, string)
    # Get Resistance Elements
    elements = battler.resistance
    # Set String
    string = 'Strong: '
    # If Elements not empty
    if not elements.empty?
      # Set Name of Element
      elements.each {|element| string += $data_system.elements[element] + ', '}
      # Remove Last Two Characters
      string[-2, 2] = ''
    else
      # Add None
      string += 'None'
    end
    # Draw Resistance String
    self.contents.draw_text(x, y + 32, width, 32, string)
  end
  #--------------------------------------------------------------------------
  # * Draw Battler Maps
  #--------------------------------------------------------------------------
  def draw_maps(battler, x, y, width)
    # Setup String
    string = 'Location: '
    # Get Troops
    troops = (1...$data_troops.size).to_a - Bestiary::Excluded_Troops
    # Delete Id if Enemy is not in it
    troops.delete_if {|troop_id| !$data_troops[troop_id].has_enemy?(battler.id)}
    # Setup Maps Array
    maps = []
    # Get Maps
    $data_mapinfos.each do |index, map|
      # Skip if index is 0
      next if index == 0
      # If Includes any of the troops in list Push index
      maps << index if map.encounter_list.includes_any?(*troops)
    end
    # Remove Excluded
    maps -= Bestiary::Excluded_Maps
    # Add Locations
    maps += Bestiary::Locations[battler.id].to_a
    # Remove Duplicates
    maps.uniq!
    # If Maps are not empty
    if not maps.empty?
      # Run Through and Push Strings
      maps.each {|map_id| string += "#{$data_mapinfos[map_id].name}, "}
      # Remove Last Two Characters
      string[-2, 2] = ''
    else
      # Add None (Unknown)
      string += 'Unknown'
    end
    # Draw Text
    self.contents.draw_text(x, y, width, 32, string)
  end
  #--------------------------------------------------------------------------
  # * Draw Battler Description
  #--------------------------------------------------------------------------
  def draw_battler_description(battler, x, y)
    # Get String
    string = 'Description:  ' + Bestiary::Description[battler.id]
    # Draw Wrapped Text
    self.contents.draw_wrap_text(x, y, contents.width, 32, string)
  end
end 
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Expand to see the code.


I had to manually comment out both Shadow references because they started giving me "NoMethodError undefined method:'shadow'" errors. I honestly don't know what started that one going - something I added in the past few days, but all I did was update your CTBS to v4. I don't need the shadow text so that's okay but it's still worrisome.
Not to be a smartass or anything but shouldn't Windgow be Window? I'm not sure if that is a typo or what the script actually says so...
My fault Twililght. I was tired when I typed that. Typo fixed.
Is it possible, through element tagging, to set "Beast" groups, and the grouping shows on the left? See, I have 175 monsters, (didn't like the original RTP's monsters), and well, it's a pain scrolling through 175 entries. I hope you understand! Maybe something to consider, no?
Mea;239583 wrote:
Any luck on those errors I posted?

In the meantime, I got the font to work, but not the Windowskin. I get the error:


This is the modified version of Window_
Content Hidden Spoiler
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Trickster\'s Bestiary')

class Window_BestiaryCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Call Window_Selectable#initialize
    super(0, 0, 160, 480)
    # Setup Item Max
    @item_max = $game_system.enemies.size
    # Create Contents
    self.contents = Bitmap.new(width - 32, @item_max * 32)
    # Set Font to Shadow
    #self.contents.font.shadow = true
    # Refresh Window
    refresh
    # Set Index to 0
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Get Battler
  #--------------------------------------------------------------------------
  def battler
    return $game_system.enemies[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # Clear Contents
    self.contents.clear
    # Draw Each Item
    $game_system.enemies.each_index {|index| draw_item(index)}
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    # Get Enemy ID
    enemy_id = $game_system.enemies[index]
    # Get Position
    x, y = 4, index * 32
    # Get Enemy
    enemy = $data_enemies[enemy_id]
    # If Seen At Least Once
    name = $game_system.seen[enemy_id] > 0 ? enemy.name : Bestiary::Not_Seen
    # Draw Index
    self.contents.draw_text(x, y, 32, 32, sprintf("%03d:", index+1))
    # Draw Name
    self.contents.draw_text(x + 36, y, contents.width, 32, name)
  end
end
   
class Window_Bestiary < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    # Define Windowskin
    self.windowskin = RPG::Cache.windowskin("PlainPearl")
    # Call Window Base#initialize
    super(160, 0, 480, 480)
    # Setup Contents
    self.contents = Bitmap.new(width - 32, height - 32)
    # Set Font
    self.contents.font.name = "LinusScript"
    # Set Shadow
    #self.contents.font.shadow = true
    # Setup Instance Variables
    @battler = nil
    # Refresh Window
    refresh
  end
  #--------------------------------------------------------------------------
  # * Set Battler
  #--------------------------------------------------------------------------
  def battler=(battler)
    # Return if a battler and ids are the same
    return if @battler != nil and @battler.id == battler
    # Set Battler
    @battler = $data_enemies[battler]
    # Refresh
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    # if battler is nil or not seen
    if @battler == nil or $game_system.seen[@battler.id] == 0
      # Clear
      self.contents.clear
      # Return
      return
    end
    # Clear Contents
    self.contents.clear
    # Setup Local Variable battler
    battler = @battler
    # Draw Name
    draw_actor_name(battler, 0, 0)
    # Draw Hp
    draw_actor_hp(battler, 176, 0, 112)
    # Draw Sp
    draw_actor_sp(battler, 328, 0, 112)
    # Draw Enemy
    draw_enemy(battler, 0, 32, 176, 176)
    # Do 10 times
    10.times do |i|
      # Get X and Y
      x, y = (i % 2) == 0 ? 176 : 328, (i / 2) * 32 + 32
      # Draw Parameter
      draw_parameter(battler, x, y, 80, i)
    end
    # Draw Seens
    draw_seens(battler, 328, 192, 80)
    # Draw Kills
    draw_kills(battler, 328, 224, 80)
    # Draw Items
    draw_battler_items(battler, 0, 192)
    # Draw Elements
    draw_battler_elements(battler, 0, 224, 328)
    # Draw Maps Where can be found
    draw_maps(battler, 0, 288, 328)
    # Draw Description
    draw_battler_description(battler, 0, 352)
  end
  #--------------------------------------------------------------------------
  # * Draw Name
  #--------------------------------------------------------------------------
  def draw_actor_name(actor, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 176, 32, actor.name, 1)
  end
  #--------------------------------------------------------------------------
  # * Draw HP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_hp(actor, x, y, width = 144)
    # Draw "HP" text string
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
    # Draw HP
    self.contents.font.color =  normal_color
    self.contents.draw_text(x, y, width, 32, actor.maxhp.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw SP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  def draw_actor_sp(actor, x, y, width = 144)
    # Draw "SP" text string
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
    # Draw SP
    self.contents.font.color =  normal_color
    self.contents.draw_text(x, y, width, 32, actor.maxsp.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Seens
  #--------------------------------------------------------------------------
  def draw_seens(battler, x, y, width)
    # System Color Font
    self.contents.font.color = system_color
    # Draw Parameter Name
    self.contents.draw_text(x, y, width, 32, 'Seen')
    # Normal Color Font
    self.contents.font.color = normal_color
    # Get Value
    value = $game_system.seen[battler.id].to_s
    # Draw Value
    self.contents.draw_text(x + 32, y, width, 32, value, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Kills
  #--------------------------------------------------------------------------
  def draw_kills(battler, x, y, width)
    # System Color Font
    self.contents.font.color = system_color
    # Draw Parameter Name
    self.contents.draw_text(x, y, width, 32, 'Killed')
    # Normal Color Font
    self.contents.font.color = normal_color
    # Get Value
    value = $game_system.killed[battler.id].to_s
    # Draw Value
    self.contents.draw_text(x + 32, y, width, 32, value, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Parameter
  #--------------------------------------------------------------------------
  def draw_parameter(battler, x, y, width, type)
    # Setup Array (Array of Strings)
    array = %w( atk pdef mdef str dex agi int eva gold exp )
    # If type is not eva or exp
    if not ['eva','exp'].include?(array[type])
      # Call $data_system.words.(variable)
      name = $data_system.words.method(array[type]).call
    else
      # Just Capitalize it
      name = array[type].capitalize
    end
    # Call battler.(variable) to get value
    value = battler.method(array[type]).call.to_s
    # System Color Font
    self.contents.font.color = system_color
    # Draw Parameter Name
    self.contents.draw_text(x, y, width, 32, name)
    # Normal Color Font
    self.contents.font.color = normal_color
    # Draw Value
    self.contents.draw_text(x + 32, y, width, 32, value, 2)
  end
  #--------------------------------------------------------------------------
  # * Draw Battler Items
  #--------------------------------------------------------------------------
  def draw_battler_items(battler, x, y)
    # Get Width
    cx = contents.text_size('Items:').width
    # Draw Items:
    self.contents.draw_text(x, y, width, 32, 'Items:')
    # Set Total Width
    total_width = cx + 8
    # Setup Battler Array
    item_array = [battler.item_id, battler.weapon_id, battler.armor_id]
    # Get Secondary Item Ids
    secondary = battler.respond_to?(:get_item_ids) ? battler.get_item_ids : []
    # Get Rare Item Ids
    rare = battler.respond_to?(:get_rare_ids) ? battler.get_rare_ids : []
    # If An Item
    if item_array.max != 0
      # Item Id
      item_id = item_array.max
      # Item Type
      item_type = item_array.index(item_id)
      # Branch By Item Type
      case item_type
      when 0
        item = $data_items[item_id]
      when 1
        item = $data_weapons[item_id]
      when 2
        item = $data_armors[item_id]
      end
      # Get Item Name
      item_name = item.name + ((secondary + rare).empty? ? '' : ',')
      # Get Width
      width = contents.text_size(item_name).width
      # Draw Item Name
      self.contents.draw_text(x + cx + 8, y, width, 32, item_name)
      # Set Total Width
      total_width = cx + 16 + width
    end
    # If not empty?
    if not secondary.empty?
      # Get Item ID and Item Type
      item_id, item_type = secondary[0..1]
      # Branch By Item Type
      case item_type
      when 1
        item = $data_items[item_id]
      when 2
        item = $data_weapons[item_id]
      when 3
        item = $data_armors[item_id]
      end
      # Get Item Name
      item_name = item.name + (rare.empty? ? '' : ',')
      # Get Width
      width = contents.text_size(item_name).width
      # Draw Item Name
      self.contents.draw_text(x + total_width, y, width, 32, item_name)
      # Add to Total Width
      total_width += 8 + width
    end
    # If not Empty
    if not rare.empty?
      # Get Item ID and Item Type
      item_id, item_type = rare[0..1]
      # Branch By Item Type
      case item_type
      when 1
        item = $data_items[item_id]
      when 2
        item = $data_weapons[item_id]
      when 3
        item = $data_armors[item_id]
      end
      # Get Width
      width = contents.text_size(item.name).width
      # Set Text to Gold
      self.contents.font.color = Color.new(255, 224, 32)
      # Draw Item Name
      self.contents.draw_text(x + total_width, y, width, 32, item.name)
      # Set Text to Normal Color
      self.contents.font.color = normal_color
      # Add to Total Width
      total_width += 8 + width
    end
    # If Nothing Drawn (that is total width is cx + 8)
    if total_width == cx + 8
      # Draw Nothing
      self.contents.draw_text(x + cx + 8, y, self.width, 32, 'None')
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Enemy
  #--------------------------------------------------------------------------
  def draw_enemy(enemy, x, y, width, height, opacity = 255)
    # Get Bitmap
    bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
    # If Stretching
    if Bestiary::Draw_Type == 0
      # Fit Blt (See MACL)
      self.contents.fit_blt(x, y, width, height, bitmap, opacity)
    # If Cropping
    else
      # Get Direction of Crop
      dir = Bestiary::Crop[enemy.id]
      # Crop Blt (See MACL)
      self.contents.crop_blt(x, y, width, height, bitmap, dir, 1, opacity)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Battler Elements
  #--------------------------------------------------------------------------
  def draw_battler_elements(battler, x, y, width)
    # Get Weakesses
    elements = battler.weaknesses
    # Set String
    string = 'Weak: '
    # If Elements not empty
    if not elements.empty?
      # Set Name OF Element
      elements.each {|element| string += $data_system.elements[element] + ', '}
      # Remove Last Two Characters
      string[-2, 2] = ''
    else
      # Add None
      string += 'None'
    end
    # Draw Weakness String
    self.contents.draw_text(x, y, width, 32, string)
    # Get Resistance Elements
    elements = battler.resistance
    # Set String
    string = 'Strong: '
    # If Elements not empty
    if not elements.empty?
      # Set Name of Element
      elements.each {|element| string += $data_system.elements[element] + ', '}
      # Remove Last Two Characters
      string[-2, 2] = ''
    else
      # Add None
      string += 'None'
    end
    # Draw Resistance String
    self.contents.draw_text(x, y + 32, width, 32, string)
  end
  #--------------------------------------------------------------------------
  # * Draw Battler Maps
  #--------------------------------------------------------------------------
  def draw_maps(battler, x, y, width)
    # Setup String
    string = 'Location: '
    # Get Troops
    troops = (1...$data_troops.size).to_a - Bestiary::Excluded_Troops
    # Delete Id if Enemy is not in it
    troops.delete_if {|troop_id| !$data_troops[troop_id].has_enemy?(battler.id)}
    # Setup Maps Array
    maps = []
    # Get Maps
    $data_mapinfos.each do |index, map|
      # Skip if index is 0
      next if index == 0
      # If Includes any of the troops in list Push index
      maps << index if map.encounter_list.includes_any?(*troops)
    end
    # Remove Excluded
    maps -= Bestiary::Excluded_Maps
    # Add Locations
    maps += Bestiary::Locations[battler.id].to_a
    # Remove Duplicates
    maps.uniq!
    # If Maps are not empty
    if not maps.empty?
      # Run Through and Push Strings
      maps.each {|map_id| string += "#{$data_mapinfos[map_id].name}, "}
      # Remove Last Two Characters
      string[-2, 2] = ''
    else
      # Add None (Unknown)
      string += 'Unknown'
    end
    # Draw Text
    self.contents.draw_text(x, y, width, 32, string)
  end
  #--------------------------------------------------------------------------
  # * Draw Battler Description
  #--------------------------------------------------------------------------
  def draw_battler_description(battler, x, y)
    # Get String
    string = 'Description:  ' + Bestiary::Description[battler.id]
    # Draw Wrapped Text
    self.contents.draw_wrap_text(x, y, contents.width, 32, string)
  end
end 
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Expand to see the code.


I had to manually comment out both Shadow references because they started giving me "NoMethodError undefined method:'shadow'" errors. I honestly don't know what started that one going - something I added in the past few days, but all I did was update your CTBS to v4. I don't need the shadow text so that's okay but it's still worrisome.


Mea add this in a new script above main you were missing a few methods

Array.find Spoiler
=begin
==============================================================================
** Array.find
------------------------------------------------------------------------------
Description:
------------
Methods created for finding and returning objects inside of an array.

Method List:
------------
all_indexes
find_index
includes?
includes_any?
include_times?
of_index
==============================================================================
=end

MACL::Loaded << 'Array.find'

class Array
#-------------------------------------------------------------------------
# * Name : All Indexes
# Info : Returns All indexes where obj is (see find_index)
# Author : Trickster
# Call Info : One Argument. Value (Object)
# Comment : Synonym for find_index
#-------------------------------------------------------------------------
def all_indexes(obj)
# Setup Array
array = []
# Run Through Push index if objects are equal
each_index {|index| array << index if obj == self[index]}
# Return Array
return array
end
#-------------------------------------------------------------------------
# * Name : Finds Index
# Info : Finds all indexes with the value sent to it
# Author : Trickster
# Call Info : One Argument. a Object
#-------------------------------------------------------------------------
def find_index(value)
# Setup Array of Indexes
indexes = []
# Run Through each with index and add index if the same
each_with_index {|element, index| indexes << index if element == value}
# Return Indexes
return indexes
end
#-------------------------------------------------------------------------
# Name : Includes?
# Info : Returns true if all of the values sent is included
# Author : Trickster
# Call Info : Variable Amount, Objects
# Comment : If using an array and want to check each element,
# use argument expansion to expand the array.
#-------------------------------------------------------------------------
def includes?(*args)
# Return false if object is not included
args.each {|object| return false unless include?(object)}
# Everything is included
return true
end
#-------------------------------------------------------------------------
# Name : Includes Any?
# Info : Returns true if any of the values sent is included
# Author : Trickster
# Call Info : Variable Amount, Objects
# Comment : If using an array and want to check each element,
# use argument expansion to expand the array.
#-------------------------------------------------------------------------
def includes_any?(*args)
# Return true if args is empty
return true if args.empty?
# Return true if any of the objects is included
args.each {|object| return true if include?(object)}
# Not Included
return false
end
#-------------------------------------------------------------------------
# * Name : Include Times
# Info : Returns how many times the value sent is included
# Author : Trickster
# Call Info : One Argument. anObject
#-------------------------------------------------------------------------
def include_times(obj)
# Setup Local Variable
times = 0
# Run Through Each Increaing Times if object is equal
each {|element| times += 1 if element == obj}
# Return number of times included
return times
end
#-------------------------------------------------------------------------
# * Name : Of index
# Info : Assuming Self is an Array of Arrays returns the values at index
# Author : Trickster
# Call Info : One - Integer index index of the values you want to return
#-------------------------------------------------------------------------
def of_index(index)
# Create Array
array = []
# Run Through and get array at index
each {|sub_array| array << sub_array[index] if sub_array.is_a?(Array)}
# Return Array
return array
end
end


Also give me some time for your request it is going to take a bit

Master InuYasha;240104 wrote:
Is it possible, through element tagging, to set "Beast" groups, and the grouping shows on the left? See, I have 175 monsters, (didn't like the original RTP's monsters), and well, it's a pain scrolling through 175 entries. I hope you understand! Maybe something to consider, no?


I will try to add that in the next version ok?
No problem on time, whenever you can.

Gonna try thge Array.Find thing - I think I put it in the wrong spot initially - let me work with it a bit.

EDIT: No., No change. I tried adding it above the Bestiary stuff, I tried adding it below. Still get the Shadow error.

Don't know if this helps but...
All scripts I have running Spoiler
B]Universal Message System[/B] ccoa Link
CTB Battle System V2.1 Trickster Link
Multi-Attack V3.1 Trickster Link
Blitz Skill Claimh Link
Steal Mug Scan Trickster Link
Equipment, Item & Skill Requirements (EIS) SephirothSpawn Link
Pictoral Indicators Tibuda Link
Main Character Select Raziel Link
Catepillar Unknown Link
Pseudo Case in events Tibuda Link
Remove/Restore all items Trickster link
Unarmed attack settings Chaimh Link
Battle Report Raziel Link
Custom Menu Moghunter Link
Store Limiting SandGolem Link
Bestiary Trickster Link
Bare Handed Attack Settings Claimh Link
oh you need Yeyinde's Font Addons here is a copy

=begin
==============================================================================
** Font.addons
------------------------------------------------------------------------------
Description:
------------
  This sections improves the font class to allow for more font styles, such as
  shadow and outline and strikethrough.
 
Method List:
------------
  Font.default_underline
  Font.default_underline=
  Font.default_underline_full
  Font.default_underline_full=
  Font.default_strikethrough
  Font.default_strikethrough=
  Font.default_strickthrough_full
  Font.default_strickthrough_full=
  Font.default_shadow
  Font.default_shadow=
  Font.default_shadow_color
  Font.default_shadow_color=
  Font.default_outline
  Font.default_outline=
  Font.default_outline_color
  Font.default_outline_color=
  underline
  underline=
  underline_full
  underline_full=
  strikethrough
  strikethrough=
  strikethrough_full
  strikethrough_full=
  shadow_color
  shadow_color=
  outline_color
  outline_color=
  shadow
  shadow=
  outline
  outline=
 
Rewritten Methods:
-------------
  class Font
    initailzie
  class Bitmap
    draw_text
==============================================================================
=end

MACL::Loaded << 'Font.addons'

class Font
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :underline, :underline_full
  attr_accessor :strikethrough, :strikethrough_full
  attr_accessor :shadow_color, :outline_color
  attr_reader :shadow, :outline
  #--------------------------------------------------------------------------
  # * Class Variables
  #--------------------------------------------------------------------------
  class_accessor :default_underline, :default_underline_full
  class_accessor :default_strikethrough, :default_strikethrough_full
  class_accessor :default_shadow, :default_shadow_color
  class_accessor :default_outline, :default_outline_color
  #--------------------------------------------------------------------------
  # * Class Variable Declarations
  #--------------------------------------------------------------------------
  self.default_underline = false
  self.default_underline_full = false
  self.default_strikethrough = false
  self.default_strikethrough_full = false
  self.default_shadow = false
  self.default_shadow_color = Color.new(0, 0, 0, 100)
  self.default_outline = false
  self.default_outline_color = Color.new(0, 0, 0)
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  if @yeyinde_fontaddons_alias.nil?
    alias_method :yeyinde_fontaddons_initialize, :initialize
    @yeyinde_fontaddons_alias = true
  end
  #-------------------------------------------------------------------------
  # * Name      : Object Initialization
  #   Info      : Sets New Properties of Font
  #   Author    : Yeyinde
  #   Call Info : Zero - Two Arguments
  #               String name - name of the font
  #               Integer size - size of the font
  #-------------------------------------------------------------------------
  def initialize(*args)
    yeyinde_fontaddons_initialize(*args)
    # Set Properties
    @underline = Font.default_underline
    @underline_full = Font.default_underline_full
    @strikethrough = Font.default_strikethrough
    @strikethrough_full = Font.default_strikethrough_full
    @shadow = Font.default_shadow
    @shadow_color = Font.default_shadow_color
    @outline = Font.default_outline
    @outline_color = Font.default_outline_color
  end
  #-------------------------------------------------------------------------
  # * Name      : Set Shadow
  #   Info      : Sets Shadow Flag
  #   Author    : Yeyinde
  #   Call Info : One Argument Boolean bool flag
  #-------------------------------------------------------------------------
  def shadow=(bool)
    @shadow = bool
    @outline = false unless bool == false
  end
  #-------------------------------------------------------------------------
  # * Name      : Set Outline
  #   Info      : Sets Outline Flag
  #   Author    : Yeyinde
  #   Call Info : One Argument Boolean bool flag
  #-------------------------------------------------------------------------
  def outline=(bool)
    @shadow = false unless bool == false
    @outline = bool
  end
  #-------------------------------------------------------------------------
  #   Name      : == (Comparision Equals)
  #   Info      : Compares two Fonts
  #   Author    : Trickster
  #   Call Info : One Argument Font other, Font to Check
  #-------------------------------------------------------------------------
  def ==(other)
    attr = %w( name size color bold italic underline underline_full strikethrough
    strikethrough_full shadow_color outline_color shadow outline )
    attr.each do |var|
      return false if method(var).call != other.method(var).call
    end
    return true
  end
end

class Bitmap
  #--------------------------------------------------------------------------
  # * Object Aliasing
  #--------------------------------------------------------------------------
  if @yeyinde_fontaddons_alias.nil?
    alias_method :yeyinde_fontaddons_draw_text, :draw_text
    @yeyinde_fontaddons_alias = true
  end
  #--------------------------------------------------------------------------
  # * Draw Text
  #--------------------------------------------------------------------------
  def draw_text(*args)
    if font.shadow
      orig_color = font.color.dup
      self.font.color = self.font.shadow_color
      if args[0].is_a?(Rect)
        s_x = args[0].x + 2
        s_y = args[0].y + 2
        s_w = args[0].width
        s_h = args[0].height
        s_t = args[1]
        s_a = args[2]
      else
        s_x = args[0] + 2
        s_y = args[1] + 2
        s_w = args[2]
        s_h = args[3]
        s_t = args[4]
        s_a = args[5]
      end
      s_a = 0 if s_a.nil?
      yeyinde_fontaddons_draw_text(s_x, s_y, s_w, s_h, s_t, s_a)
      self.font.color = orig_color
    end
    if font.outline
      orig_color = font.color.dup
      self.font.color = self.font.outline_color
      if args[0].is_a?(Rect)
        o_x = args[0].x
        o_y = args[0].y
        o_w = args[0].width
        o_h = args[0].height
        o_t = args[1]
        o_a = args[2]
      else
        o_x = args[0]
        o_y = args[1]
        o_w = args[2]
        o_h = args[3]
        o_t = args[4]
        o_a = args[5]
      end
      o_a = 0 if o_a.nil?
      yeyinde_fontaddons_draw_text(o_x + 1, o_y, o_w, o_h, o_t, o_a)
      yeyinde_fontaddons_draw_text(o_x - 1, o_y, o_w, o_h, o_t, o_a)
      yeyinde_fontaddons_draw_text(o_x, o_y + 1, o_w, o_h, o_t, o_a)
      yeyinde_fontaddons_draw_text(o_x, o_y - 1, o_w, o_h, o_t, o_a)
      yeyinde_fontaddons_draw_text(o_x + 1, o_y + 1, o_w, o_h, o_t, o_a)
      yeyinde_fontaddons_draw_text(o_x + 1, o_y - 1, o_w, o_h, o_t, o_a)
      yeyinde_fontaddons_draw_text(o_x - 1, o_y - 1, o_w, o_h, o_t, o_a)
      yeyinde_fontaddons_draw_text(o_x - 1, o_y + 1, o_w, o_h, o_t, o_a)
      self.font.color = orig_color
    end
    yeyinde_fontaddons_draw_text(*args)   
    if font.underline
      u_color = font.color.dup
      if args[0].is_a?(Rect)
        u_x = args[0].x
        u_y = args[0].y + args[0].height / 2 + font.size / 3
        if font.underline_full
          u_width = args[0].width
        else
          u_width = text_size(args[1]).width
          case args[2]
          when 1
            u_x += args[0].width / 2 - u_width / 2
          when 2
            u_x += args[0].width - u_width
          end
        end
      else
        u_x = args[0]
        u_y = args[1] + args[3] / 2 + font.size / 3
        if font.underline_full
          u_width = args[2]
        else
          u_width = text_size(args[4]).width
          case args[5]
          when 1
            u_x += args[2] / 2 - u_width / 2
          when 2
            u_x += args[2] - u_width
          end
        end
      end
      fill_rect(u_x, u_y, u_width, 1, u_color)
    end
    if font.strikethrough
      s_color = font.color.dup
      if args[0].is_a?(Rect)
        s_x = args[0].x
        s_y = args[0].y + args[0].height / 2
        if font.strikethrough_full
          s_width = args[0].width
        else
          s_width = text_size(args[1]).width
          case args[2]
          when 1
            s_x += args[0].width / 2 - s_width / 2
          when 2
            s_x += args[0].width - s_width
          end
        end
      else
        s_x = args[0]
        s_y = args[1] + args[3] / 2
        if font.strikethrough_full
          s_width = args[0].width
        else
          s_width = text_size(args[4]).width
          case args[5]
          when 1
            s_x += args[2] / 2 - s_width / 2
          when 2
            s_x += args[2] - s_width
          end
        end
      end
      fill_rect(s_x, s_y, s_width, 1, s_color)
    end
  end
end
Expand to see the code.
Sorry so long on the reply, haven't been on for a few days.

Just tried it and the font add on stopped the shadow errors. Thank you very much for that part. It still breaks though whenever a monster is added to the listing.

New error message:
Script 'Window_' line 325: NoMethodError occured.
undefined method 'fit_blt' for X

The line it's fingering is:
self.contents.fit_blt(x, y, width, height, bitmap, opacity)
Hand me a demo you seem to be missing some things and I'll fix it for you :-/
sent. Thank you.
Everytime I try to add another description I get a syntax error (line 53 of setup)
How do I add more descriptions?
Also How do I remove the feature that shows you the location of enemies?
(I have a rather large game, the maps are all oddly named because it helps me remember the correct locations of things, I don't want the player to see the names of the maps)
This script seems to be incompatible with the newest version of the MACL (2.1)
will you update this to make it compatible?
I'd like to know this as well, I'd like to use this script.
I see no problems with MACL 2.1

please be more specific

(reminder remember to delete any older MACL addons those are already included in V2.1)

EDIT updated the demo for MACL V2.1
I'm still having difficulty adding descriptions to the database, whenever I add a new entry the previous one disappears (eg: when I add a description for enemy 2 the description for enemy 1 disappears)
show me the script named Setup
hmm...

I replace the old Macl with the new and i put the newest SDK in the Original Demo of this Script.

After defeat the Ghost i see the bestiary and i get this:

http://img170.imageshack.us/img170/452/xdko7.png[/IMG]

And i upload the demo with the demo.

http://rapidshare.com/files/48434748/Tricksters_Bestiary_V1.1.rar.html
Here it is:
=begin
=============================================================================
â–  Bestiary
=============================================================================
Trickster
Version 1.1
3.17.07
=============================================================================
=end

#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Trickster's Bestiary', 'Trickster', 1.1, '3.17.07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1, 2, 3], ['Map Info'])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Trickster's Bestiary')
 
module Bestiary
  #--------------------------------------------------------------------------
  # * Excluded Enemy IDs
  #--------------------------------------------------------------------------
  Excluded_Enemies = []
  #--------------------------------------------------------------------------
  # * Excluded Troop IDs
  #--------------------------------------------------------------------------
  Excluded_Troops = []
  #--------------------------------------------------------------------------
  # * Excluded Map IDs
  #--------------------------------------------------------------------------
  Excluded_Maps = []
  #--------------------------------------------------------------------------
  # * Locations Addition
  #   syntax - enemy_id => [map_ids]
  #--------------------------------------------------------------------------
  Locations = {
  }
  #--------------------------------------------------------------------------
  # * Not Seen Name
  #--------------------------------------------------------------------------
  Not_Seen = '??????'
  #--------------------------------------------------------------------------
  # * Descriptions
  #   syntax - enemy_id => Description
  #--------------------------------------------------------------------------
  Description = {
  1 => 'Boo! A Ghost. Always Encountered in a Demo of one of Trickster's Scripts.'
  }
  Description = {
  2 => 'The second enemy in the database'
  }
  #--------------------------------------------------------------------------
  # * Descriptions Default
  #--------------------------------------------------------------------------
  Description.default = 'No Information'
  #--------------------------------------------------------------------------
  # * Battler Type (Scanning 0: Fit to Size 1: Crop) (Dimensions 176x176)
  #--------------------------------------------------------------------------
  Draw_Type = 0
  #--------------------------------------------------------------------------
  # * Crop (syntax enemy_id => direction 0-8)
  # 0 1 2
  # 3 4 5
  # 6 7 8
  #--------------------------------------------------------------------------
  Crop = {
  }
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Expand to see the code.
[QUOTE=Trickster;234668]Look in the script Window_ and find this code

    # Do 10 times
    10.times do |i|
      # Get X and Y
      x, y = (i % 2) == 0 ? 176 : 328, (i / 2) * 32 + 32
      # Draw Parameter
      draw_parameter(battler, x, y, 80, i)
    end
Expand to see the code.


To make this easier to modify here is the expanded version

draw_parameter(battler, 176, 32, 0)
draw_parameter(battler, 328, 32, 1)
draw_parameter(battler, 176, 64, 2)
draw_parameter(battler, 328, 64, 3)
draw_parameter(battler, 176, 96, 4)
draw_parameter(battler, 328, 96, 5)
draw_parameter(battler, 176, 128, 6)
draw_parameter(battler, 328, 128, 7)
draw_parameter(battler, 176, 160, 8)
draw_parameter(battler, 328, 160, 9)
Expand to see the code.


Now the numbers 0 - 9 mean in that order
atk pdef mdef str dex agi int eva gold exp


Now you should be able to edit it

*Hint* all you need to do is change the last numbers in those method calls

Next you will have to change these two lines
    # Draw Seens
    draw_seens(battler, 328, 192, 80)
    # Draw Kills
    draw_kills(battler, 328, 224, 80)
Expand to see the code.


and that's it[/QUOTE]

Thanks

Sorry for the late reply... I was trying it out and now i finally get it:D
Great script

~Thanks again...
If i use Side view battlers system, how i display the enemys art? because if it took the battler image, it will display all the battler poses!

Darkkurama
Bump, i am having the same problem as iceplosion. Every time i add a new description like this

Description = {
  1 => 'Description of first enemy in database'
  2 => 'Description of second enemy in database'
  }
Expand to see the code.


I get a syntax error
Maybe you need to put a , after the '':

Description = {
  1 => 'Description of first enemy in database',
  2 => 'Description of second enemy in database'
  }
Expand to see the code.
Yeah, that works now. Thanks :D
That's what was wrong?
wow, so many of my sccipting problems seem to have a simple fix recently.

EDIT: I'd like to know how to remove "Location" from the bestiary, how would I do this?
Sorry to bring up this old topic, but I have a problem:

Every time I try to fight an enemy in a demo that I created to test out this script, the beastiary does not update with info on whatever you've seen/fought. Is there a way to fix this?
Hey trickster on your bestiary script it don't let you close like messages when you type em so could you try and sort it out cus your script is awsome
Trickster is no longer here, waby. Sorry.
who gonna fix then thing then anyway wheres he gone

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