RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Comment Function for Momo's Beastiary: I Figured it Out!

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 88
It's kind of awesome.
I don't know how I did it, but with a combination of DerVVulfman's help, and Babelfish, I managed to figure out Momo's comment function for his beastiary, or Demon Book. If anyone wants it, here it be!

This script adds a function to Momo's Demon Book wherein you can create comments on the monsters in your game that can be viewed by the player.

Note: I DID NOT MAKE THIS SCRIPT! Ahem. Sorry. Momo made this script, not me. Please don't ask me about how it works, I don't know. I figured this out by a combination of beginner's and dumb luck. If you want to know HOW to use it, ask me. That I may be able to help with :D .

This is the main Beastiary. Put this above main, yada yada.
Code: [Select]
#????
#
#????????????????(???????????)????????
#?????????????????????????????
#???????????
#??????????????????????????
#(class Scene_Battle ? start_phase5 ????????)
#
#????????????????????????
#???????????????????????(????????)
#Window_MonsterBook_Info ? DROP_ITEM_NEED_ANALYZE ? true ???????
#????????????????????????? false ??????????
#
#??
#????????????????????1??
#???????????????????
#???????
#1.???????????????1??????????????
#2.Game_Enemy_Book ? ?super(1, 0)#???? ??????????
#  ????????ID???????
#???????????
#
#2005.2.6 ????
#?????????????
#SHOW_COMPLETE_TYPE ????????
#?????????????????
#$game_party.enemy_book_max ????????(???)
#$game_party.enemy_book_now ?????????(???)
#$game_party.complete_percentage ???????(??????)
#????????
#
#2005.2.17
#complete_percentage???????
#enemy_book_complete_percentage???(?????????????)
#???????????????????????????????????????
#enemy_book_max ????????(???)
#enemy_book_now ?????????(???)
#enemy_book_comp???????(??????)
#
#2005.2.18 ????
#complete_percentage???????
#enemy_book_complete_percentage???????
#complete_percentage???????????(????????????)
#
#2005.7.4 ????
#??????????
#?????????????
#
#2005.7.4 ????
#?????????


module Enemy_Book_Config
  #???????????????????????
  DROP_ITEM_NEED_ANALYZE = false
  #???????
  EVA_NAME = "??"             
  #??????????
  #0:???? 1:???/??? 2:??? 3:??
  SHOW_COMPLETE_TYPE = 3         
  #?????????????(???????????????)
  COMMENT_SYSTEM = true
end

class Game_Temp
  attr_accessor :enemy_book_data
  alias temp_enemy_book_data_initialize initialize
  def initialize
    temp_enemy_book_data_initialize
    @enemy_book_data = Data_MonsterBook.new
  end
end

class Game_Party
  attr_accessor :enemy_info               # ???????(???)
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  alias book_info_initialize initialize
  def initialize
    book_info_initialize
    @enemy_info = {}
  end
  #--------------------------------------------------------------------------
  # ? ?????????(???)
  #     type : ??????????? 0:?? 1:????? -1:????
  #     0:??? 1:??? 2:??????
  #--------------------------------------------------------------------------
  def add_enemy_info(enemy_id, type = 0)
    case type
    when 0
      if @enemy_info[enemy_id] == 2
        return false
      end
      @enemy_info[enemy_id] = 1
    when 1
      @enemy_info[enemy_id] = 2
    when -1
      @enemy_info[enemy_id] = 0
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #--------------------------------------------------------------------------
  def enemy_book_max
    return $game_temp.enemy_book_data.id_data.size - 1
  end
  #--------------------------------------------------------------------------
  # ? ?????????????
  #--------------------------------------------------------------------------
  def enemy_book_now
    now_enemy_info = @enemy_info.keys
    # ???????ID???
    no_add = $game_temp.enemy_book_data.no_add_element
    new_enemy_info = []
    for i in now_enemy_info
      enemy = $data_enemies[i]
      next if enemy.name == ""
      if enemy.element_ranks[no_add] == 1
        next
      end
      new_enemy_info.push(enemy.id)
    end
    return new_enemy_info.size
  end
  #--------------------------------------------------------------------------
  # ? ???????????
end

class Interpreter
  def enemy_book_max
    return $game_party.enemy_book_max
  end
  def enemy_book_now
    return $game_party.enemy_book_now
  end
  def enemy_book_comp
    return $game_party.enemy_book_complete_percentage
  end
end

class Scene_Battle
  alias add_enemy_info_start_phase5 start_phase5
  def start_phase5
    for enemy in $game_troop.enemies
      # ??????????????
      unless enemy.hidden
        # ???????
        $game_party.add_enemy_info(enemy.id, 0)
      end
    end
    add_enemy_info_start_phase5
  end
end

class Window_Base < Window
  #--------------------------------------------------------------------------
  # ? ?????????????????
  #--------------------------------------------------------------------------
  def draw_enemy_drop_item(enemy, x, y)
    self.contents.font.color = normal_color
    treasures = []
    if enemy.item_id > 0
      treasures.push($data_items[enemy.item_id])
    end
    if enemy.weapon_id > 0
      treasures.push($data_weapons[enemy.weapon_id])
    end
    if enemy.armor_id > 0
      treasures.push($data_armors[enemy.armor_id])
    end
    # ?????????1?????
    if treasures.size > 0
      item = treasures[0]
      bitmap = RPG::Cache.icon(item.icon_name)
      opacity = 255
      self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
      name = treasures[0].name
    else
      self.contents.font.color = disabled_color
      name = "No Item"
    end
    self.contents.draw_text(x+28, y, 212, 32, name)
  end
  #--------------------------------------------------------------------------
  # ? ???????ID???
  #--------------------------------------------------------------------------
  def draw_enemy_book_id(enemy, x, y)
    self.contents.font.color = normal_color
    id = $game_temp.enemy_book_data.id_data.index(enemy.id)
    self.contents.draw_text(x, y, 32, 32, id.to_s)
  end
  #--------------------------------------------------------------------------
  # ? ??????????
  #     enemy : ????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_enemy_name(enemy, x, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(x, y, 152, 32, enemy.name)
  end
  #--------------------------------------------------------------------------
  # ? ?????????????(?????)
  #     enemy : ????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_enemy_graphic(enemy, x, y, opacity = 255)
    bitmap = RPG::Cache.battler(enemy.battler_name, enemy.battler_hue)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    x = x + (cw / 2 - x) if cw / 2 > x
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
  end
  #--------------------------------------------------------------------------
  # ? ???????EXP???
  #     enemy : ????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_enemy_exp(enemy, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, 32, "EXP")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 120, y, 36, 32, enemy.exp.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # ? ???????GOLD???
  #     enemy : ????
  #     x     : ??? X ??
  #     y     : ??? Y ??
  #--------------------------------------------------------------------------
  def draw_enemy_gold(enemy, x, y)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 120, 32, $data_system.words.gold)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 120, y, 36, 32, enemy.gold.to_s, 2)
  end
end

class Game_Enemy_Book < Game_Enemy
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def initialize(enemy_id)
    super(1, 0)#???
    @enemy_id = enemy_id
    enemy = $data_enemies[@enemy_id]
    @battler_name = enemy.battler_name
    @battler_hue = enemy.battler_hue
    @hp = maxhp
    @sp = maxsp
  end
end

class Data_MonsterBook
  attr_reader :id_data
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def initialize
    @id_data = enemy_book_id_set
  end
  #--------------------------------------------------------------------------
  # ? ???????????
  #--------------------------------------------------------------------------
  def no_add_element
    no_add = 0
    # ???????ID???
    for i in 1...$data_system.elements.size
      if $data_system.elements[i] =~ /??????/
        no_add = i
        break
      end
    end
    return no_add
  end
  #--------------------------------------------------------------------------
  # ? ????ID??
  #--------------------------------------------------------------------------
  def enemy_book_id_set
    data = [0]
    no_add = no_add_element
    # ???????ID???
    for i in 1...$data_enemies.size
      enemy = $data_enemies[i]
      next if enemy.name == ""
      if enemy.element_ranks[no_add] == 1
        next
      end
      data.push(enemy.id)
    end
    return data
  end
end


class Window_MonsterBook < Window_Selectable
  attr_reader   :data
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def initialize(index=0)
    super(0, 64, 640, 416)
    @column_max = 2
    @book_data = $game_temp.enemy_book_data
    @data = @book_data.id_data.dup
    @data.shift
    #@data.sort!
    @item_max = @data.size
    self.index = 0
    refresh if @item_max > 0
  end
  #--------------------------------------------------------------------------
  # ? ????????
  #--------------------------------------------------------------------------
  def data_set
    data = $game_party.enemy_info.keys
    data.sort!
    newdata = []
    for i in data
      next if $game_party.enemy_info[i] == 0
      # ?????????
      if book_id(i) != nil
        newdata.push(i)
      end
    end
    return newdata
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def show?(id)
    if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
      return false
    else
      return true
    end
  end
  #--------------------------------------------------------------------------
  # ? ???ID??
  #--------------------------------------------------------------------------
  def book_id(id)
    return @book_data.index(id)
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    self.contents = Bitmap.new(width - 32, row_max * 32)
    #???? 0 ??????????????????????
    if @item_max > 0
      for i in 0...@item_max
       draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #     index : ????
  #--------------------------------------------------------------------------
  def draw_item(index)
    enemy = $data_enemies[@data[index]]
    return if enemy == nil
    x = 4 + index % 2 * (288 + 32)
    y = index / 2 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.font.color = normal_color
    draw_enemy_book_id(enemy, x, y)
    if show?(enemy.id)
      self.contents.draw_text(x + 28+16, y, 212, 32, enemy.name, 0)
    else
      self.contents.draw_text(x + 28+16, y, 212, 32, "?????", 0)
      return
    end
    if analyze?(@data[index])
      self.contents.font.color = text_color(3)
      self.contents.draw_text(x + 256, y, 24, 32, "?", 2)
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????????
  #--------------------------------------------------------------------------
  def analyze?(enemy_id)
    if $game_party.enemy_info[enemy_id] == 2
      return true
    else
      return false
    end
  end
end


class Window_MonsterBook_Info < Window_Base
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0+64, 640, 480-64)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def refresh(enemy_id)
    self.contents.clear
    self.contents.font.size = 22
    enemy = Game_Enemy_Book.new(enemy_id)
    draw_enemy_graphic(enemy, 96, 240+48+64, 200)
    draw_enemy_book_id(enemy, 4, 0)
    draw_enemy_name(enemy, 48, 0)
    draw_actor_hp(enemy, 288, 0)
    draw_actor_sp(enemy, 288+160, 0)
    draw_actor_parameter(enemy, 288    ,  32, 0)
    self.contents.font.color = system_color
    self.contents.draw_text(288+160, 32, 120, 32, Enemy_Book_Config::EVA_NAME)
    self.contents.font.color = normal_color
    self.contents.draw_text(288+160 + 120, 32, 36, 32, enemy.eva.to_s, 2)
    draw_actor_parameter(enemy, 288    ,  64, 3)
    draw_actor_parameter(enemy, 288+160,  64, 4)
    draw_actor_parameter(enemy, 288    ,  96, 5)
    draw_actor_parameter(enemy, 288+160,  96, 6)
    draw_actor_parameter(enemy, 288    , 128, 1)
    draw_actor_parameter(enemy, 288+160, 128, 2)
    draw_enemy_exp(enemy, 288, 160)
    draw_enemy_gold(enemy, 288+160, 160)
    if analyze?(enemy.id) or !Enemy_Book_Config::DROP_ITEM_NEED_ANALYZE
      self.contents.draw_text(288, 192, 96, 32, "Drop Item")
      draw_enemy_drop_item(enemy, 288+96+4, 192)
      self.contents.font.color = normal_color
      #draw_element_guard(enemy, 320-32, 160-16+96)
    end
  end
  #--------------------------------------------------------------------------
  # ? ??????????
  #--------------------------------------------------------------------------
  def analyze?(enemy_id)
    if $game_party.enemy_info[enemy_id] == 2
      return true
    else
      return false
    end
  end
end


class Scene_MonsterBook
  #--------------------------------------------------------------------------
  # ? ?????
  #--------------------------------------------------------------------------
  def main
    $game_temp.enemy_book_data = Data_MonsterBook.new
    # ????????
    @title_window = Window_Base.new(0, 0, 640, 64)
    @title_window.contents = Bitmap.new(640 - 32, 64 - 32)
    @title_window.contents.draw_text(4, 0, 320, 32, "Monster Information", 0)
    @main_window = Window_MonsterBook.new
    @main_window.active = true
    # ???????????? (?????????????)
    @info_window = Window_MonsterBook_Info.new
    @info_window.z = 110
    @info_window.visible = false
    @info_window.active = false
    @visible_index = 0
    if Enemy_Book_Config::COMMENT_SYSTEM
      # ???????????? (?????????????)
      @comment_window = Window_Monster_Book_Comment.new
      @comment_window.z = 120
      @comment_window.visible = false
      @comment_on = false # ???????
    end
    # ?????????
    Graphics.transition
    # ??????
    loop do
      # ????????
      Graphics.update
      # ???????
      Input.update
      # ??????
      update
      # ????????????????
      if $scene != self
        break
      end
    end
    # ?????????
    Graphics.freeze
    # ????????
    @main_window.dispose
    @info_window.dispose
    @title_window.dispose
    @comment_window.dispose if @comment_window != nil
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def update
    # ????????
    @main_window.update
    @info_window.update
    if @info_window.active
      update_info
      return
    end
    # ?????????????????: update_target ???
    if @main_window.active
      update_main
      return
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????? (?????????????????)
  #--------------------------------------------------------------------------
  def update_main
    # B ??????????
    if Input.trigger?(Input::B)
      # ????? SE ???
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    # C ??????????
    if Input.trigger?(Input::C)
      if @main_window.item == nil or @main_window.show?(@main_window.item) == false
        # ??? SE ???
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # ?? SE ???
      $game_system.se_play($data_system.decision_se)
      @main_window.active = false
      @info_window.active = true
      @info_window.visible = true
      @visible_index = @main_window.index
      @info_window.refresh(@main_window.item)
      if @comment_window != nil
        @comment_window.refresh(@main_window.item)
        if @comment_on
          @comment_window.visible = true
        else
          @comment_window.visible = false
        end
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????? (??????????????????)
  #--------------------------------------------------------------------------
  def update_info
    # B ??????????
    if Input.trigger?(Input::B)
      # ????? SE ???
      $game_system.se_play($data_system.cancel_se)
      @main_window.active = true
      @info_window.active = false
      @info_window.visible = false
      @comment_window.visible = false if @comment_window != nil
      return
    end
    # C ??????????
    if Input.trigger?(Input::C)
      if @comment_window != nil
        # ?? SE ???
        $game_system.se_play($data_system.decision_se)
        if @comment_on
          @comment_on = false
          @comment_window.visible = false
        else
          @comment_on = true
          @comment_window.visible = true
        end
        return
      end
    end
    if Input.trigger?(Input::L)
      # ?? SE ???
      $game_system.se_play($data_system.decision_se)
      loop_end = false
      while loop_end == false
        if @visible_index != 0
          @visible_index -= 1
        else
          @visible_index = @main_window.data.size - 1
        end
        loop_end = true if @main_window.show?(@main_window.data[@visible_index])
      end
      id = @main_window.data[@visible_index]
      @info_window.refresh(id)
      @comment_window.refresh(id) if @comment_window != nil
      return
    end
    if Input.trigger?(Input::R)
      # ?? SE ???
      $game_system.se_play($data_system.decision_se)
      loop_end = false
      while loop_end == false
        if @visible_index != @main_window.data.size - 1
          @visible_index += 1
        else
          @visible_index = 0
        end
        loop_end = true if @main_window.show?(@main_window.data[@visible_index])
      end
      id = @main_window.data[@visible_index]
      @info_window.refresh(id)
      @comment_window.refresh(id) if @comment_window != nil
      return
    end
  end
end

This is the Book Comment function itself.
Code: [Select]
# ??????????(??)
#
# ?????????????????????
#
# 2005.9.19
# ??????????????????????????

class Window_Book_Comment < Window_Base
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = self.window_opa
    self.contents.font.name = self.font_name
    self.contents.font.color = self.font_color
  end
  #--------------------------------------------------------------------------
  # ? ?????
  #--------------------------------------------------------------------------
  def transfer(str)
    text = str.clone
    # ??????
    begin
    text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
    end
    text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
      $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
    end
    # ????"\\\\" ? "\000" ???
    text.gsub!(/\\\\/) { "\000" }
    # "\\C" ? "\001" ??"\\G" ? "\002" ???
    text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
    text.gsub!(/\\[Gg]/) { "\002" }
    # ????
    text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\200[#{$1}]" }
    # ?????
    text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\201[#{$1}]" }
    # ??
    text.gsub!(/\\[Rr]\[(.+?),(.+?)\]/) { "\202[#{$1},#{$2}]" }
    # ??????
    text.gsub!(/\\[Pp]ic\[([0-9]+),([0-9]+),([^,\]]+)\]/) { "\250[#{$1},#{$2},#{$3}]" }
    # ??????
    text.gsub!(/\\[Bb]at\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+)\]/) { "\251[#{$1},#{$2},#{$3},#{$4}]" }
    # ???????????
    text.gsub!(/\\[Cc]ha\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+),([0-9]+),([0-9]+)\]/) { "\252[#{$1},#{$2},#{$3},#{$4},#{$5},#{$6}]" }
   
    return text
  end
  #--------------------------------------------------------------------------
  # ? ??????????
  #--------------------------------------------------------------------------
  def draw_ex_text(ox, oy, str, align=0)
    text = str.clone
    x = 0
    y = 0
    # c ? 1 ????? (????????????????)
    while ((c = text.slice!(/./m)) != nil)
      # \\ ???
      if c == "\000"
        # ????????
        c = "\\"
      end
      # \C[n] ???
      if c == "\001"
        # ??????
        text.sub!(/\[([0-9]+)\]/, "")
        color = $1.to_i
        if color >= 0 and color <= 7
          self.contents.font.color = text_color(color)
        end
        # ?????
        next
      end
      # \G ???
      if c == "\002"
        # ?????????
        c = $game_party.gold.to_s
        # ?????
        self.contents.draw_text(ox+4+x, oy+4+ 32 * y, self.contents.text_size(c).width, 32, c)
        # x ????????????
        x += self.contents.text_size(c).width
        # ?????
        next
      end
     
      # \O ???
      if c == "\200"
        text.sub!(/\[([0-9]+)\]/, "")
        opacity = $1.to_i
        temp = self.contents.font.color
        self.contents.font.color = Color.new(temp.red, temp.green, temp.blue, opacity)
        # ?????
        next
      end
      # \H ???
      if c == "\201"
        text.sub!(/\[([0-9]+)\]/, "")
        self.contents.font.size = [[$1.to_i, 6].max, 32].min
        # ?????
        next
      end
      # \R ???
      if c == "\202"
        text.sub!(/\[(.+?),(.+?)\]/, "")
        x += ruby_set(ox+x,oy+(y*32),$1,$2)
        # ?????
        next
      end
      # \Pic ???
      if c == "\250"
        text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+)\]/, "")
        ope = self.contents.font.color.alpha
        set_picture($1.to_i, $2.to_i, $3, ope)
        # ?????
        next
      end
      # \Bat ???
      if c == "\251"
        text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+)\]/, "")
        ope = self.contents.font.color.alpha
        set_battler($1.to_i, $2.to_i, $3, $4.to_i, ope)
        # ?????
        next
      end
      # \Cha ???
      if c == "\252"
        text.sub!(/\[([0-9]+),([0-9]+),([^,\]]+),([0-9]+),([0-9]+),([0-9]+)\]/, "")
        ope = self.contents.font.color.alpha
        set_character($1.to_i, $2.to_i, $3, $4.to_i, $5.to_i, $6.to_i, ope)
        # ?????
        next
      end
      # ???????
      if c == "\n"
        # y ? 1 ???
        y += 1
        x = 0
        # ?????
        next
      end
      # ?????
      self.contents.draw_text(ox+4+x, 4+oy+ 32 * y, 40, 32, c)
      # x ????????????
      x += self.contents.text_size(c).width
    end
  end
  #--------------------------------------------------------------------------
  # ? ????
  #--------------------------------------------------------------------------
  def ruby_set(x,y,str,ruby)
    text_w = self.contents.text_size(str).width
    text_h = self.contents.text_size(str).height
    f_size_back = self.contents.font.size
    ruby_size = 10
    self.contents.font.size = ruby_size
    ruby_w = self.contents.text_size(ruby).width
    self.contents.draw_text(4+x, 4+4+y-ruby_size+1, text_w, ruby_size, ruby, 1)
    self.contents.font.size = f_size_back
    self.contents.draw_text(4+x, 4+4+y, text_w, text_h, str)
    return text_w
  end
  #--------------------------------------------------------------------------
  # ? ???????
  #--------------------------------------------------------------------------
  def set_picture(x, y, filename, opacity=255)
    bitmap = RPG::Cache.picture(filename)
    self.contents.blt(x, y, bitmap, bitmap.rect, opacity)
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def set_battler(x, y, filename, hue, opacity=255)
    bitmap =RPG::Cache.battler(filename, hue)
    self.contents.blt(x, y, bitmap, bitmap.rect, opacity)
  end
  #--------------------------------------------------------------------------
  # ? ????????
  #--------------------------------------------------------------------------
  def set_character(x, y, filename, hue, dir, pat, opacity=255)
    bitmap = RPG::Cache.character(filename, hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    cy = ch * (dir / 2 - 1)
    cx = cw * (pat - 1)
    src_rect = Rect.new(cx, cy, cw, ch)
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
  end
  def window_opa
  end
  def font_name
  end
  def font_color
  end
end

This is where you put your comments for monsters. Change
Code: [Select]
# ??????????(????)
#
# ??????????????????????????
# ?????????????????
#
# 2005.9.19
# ??????????????????????????

module MoMo_M_Book_Comment
  # ????????????
  C_WINDOW_WIDTH = 640
  # ????????????
  C_WINDOW_HEIGHT = 128
  # ??????????X??
  C_WINDOW_X = 0
  # ??????????Y??
  C_WINDOW_Y = 352
  # ??????????????
  C_WINDOW_OPA = 255
  # ?????????(???????????????)
  C_WINDOW_FONT_NAME = ["Tahoma"]
  # ???????
  # Color.new(???, ???, ???, ????) ?0?255??
  C_WINDOW_FONT_COLOR = Color.new(255, 255, 255, 255)
end

class Window_Monster_Book_Comment < Window_Book_Comment
  def initialize
    x = MoMo_M_Book_Comment::C_WINDOW_X
    y = MoMo_M_Book_Comment::C_WINDOW_Y
    width = MoMo_M_Book_Comment::C_WINDOW_WIDTH
    height = MoMo_M_Book_Comment::C_WINDOW_HEIGHT
    super(x, y, width, height)
  end
  def draw_comment(id)
    self.contents.clear
    comment = get_comment(id)
    draw_ex_text(0, 0, transfer(comment))
  end
  def get_comment(id)
    return comment_set[0] if comment_set[id] == nil
    return comment_set[id]
  end
  def comment_set
    return MoMo_M_Book_Comment::M_BOOK_COMMENT
  end
  def refresh(id)
    draw_comment(id)
  end
  def window_opa
    return MoMo_M_Book_Comment::C_WINDOW_OPA
  end
  def font_name
    return MoMo_M_Book_Comment::C_WINDOW_FONT_NAME
  end
  def font_color
    return MoMo_M_Book_Comment::C_WINDOW_FONT_COLOR
  end
end

module MoMo_M_Book_Comment
  str = []
    # str[????ID]
    str[0] = <<-EOS #???(??????????????????)
????????
    EOS
    str[1] = <<-EOS #????
Put your monster comment here!
    EOS
    str[2] = <<-EOS #????
Put your next monster comment here!
    EOS

    M_BOOK_COMMENT = str
end

See? Each number next to "str" is your monster's number in the database. To call the beastiary, use this in an event:

Code: [Select]
$scene = Scene_MonsterBook.new

Also, to change the name of the Beastiary, just go to Line 468 in the first script, and change the words in quotes to whatever you want.

That's about it! You can post questions on this here! I must have some kind of coding angel or something, cause I can't script for beans, and I figured out this thing! Even I don't know how I did it! If I forgot anything, I'm sorry. This is the first script I've posted.
My games in progress:

Super Smash Bros. The Cosmic Offensive
 Current Stage: Planning

My Completed Games:
   Paper Mario Pocket (2006)
     https://sourceforge.net/project/platformdownload.php?group_id=240896
   Paper Mario Pocket 2: Future Shock! (2009)
     https://sourceforge.net/project/platformdownload.php?group_id=240896