The RPG Maker Resource Kit

RMRK RPG Maker Creation => XP => XP Scripts Database => Topic started by: Cold on January 23, 2009, 12:09:05 AM

Title: [RMXP] Items Book and Bestiary
Post by: Cold on January 23, 2009, 12:09:05 AM
Bestiary and Items Book
by Cold

If you use this script, it’s essential that you give the credits to the creator.

Characteristics

This script creates a Bestiary and Items Book that is possible to see information of monsters and items. It have also a system the monsters drop limitless items. And also a system of treasures.

Screenshots
Spoiler for Screnshots:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg407.imageshack.us%2Fimg407%2F2420%2Fss1ur2.jpg&hash=76de97efb0d17ecabd8b64683867c0afd8c90715) (http://"http://img407.imageshack.us/img407/2420/ss1ur2.jpg")
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg175.imageshack.us%2Fimg175%2F1975%2Fss2gy8.jpg&hash=7b412ca6dfdaa28d844f63f1d026d2307a05ac6c) (http://"http://img175.imageshack.us/img175/1975/ss2gy8.jpg")
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg299.imageshack.us%2Fimg299%2F4484%2Fss3rt7.jpg&hash=8d9f66ea262ace340ad2d212c80de253793598f2) (http://"http://img299.imageshack.us/img299/4484/ss3rt7.jpg")
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg90.imageshack.us%2Fimg90%2F5267%2Fss4pm2.jpg&hash=e3b2f914a13b978238f37ce477403d29d2316441) (http://"http://img90.imageshack.us/img90/5267/ss4pm2.jpg")
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg88.imageshack.us%2Fimg88%2F1185%2Fss5ch0.jpg&hash=23ddd9841161fa6aabd908e6c7ed353a910f6cd4) (http://"http://img88.imageshack.us/img88/1185/ss5ch0.jpg")
Instructions

Customization in Script. Like too has the system of treasure, to the item to be considered a treasure, it must have a attribute called treasure. (Customizable in Script)

Scripts

Insert this Script above main (Cold Module):
Code: [Select]
################################################################################
################################################################################
########################### Cold Module ########################################
################################################################################
################################################################################
#===============================================================================
# By Cold Strong
#===============================================================================
# Cold Module
#-------------------------------------------------------------------------------
# This script count some functions used by my scripts
# Obs: It is some imcomplete...
#===============================================================================

class Customs_Data
 
  attr_accessor   :actors       
  attr_accessor   :classes     
  attr_accessor   :skills       
  attr_accessor   :items         
  attr_accessor   :weapons       
  attr_accessor   :armors       
  attr_accessor   :enemies       
  attr_accessor   :troops       
  attr_accessor   :states       
  attr_accessor   :animations   
  attr_accessor   :tilesets     
  attr_accessor   :common_events
  attr_accessor   :system
  attr_accessor   :map_infos
  attr_accessor   :maps
 
  def initialize
    @actors        = load_data("Data/Actors.rxdata")
    @classes       = load_data("Data/Classes.rxdata")
    @skills        = load_data("Data/Skills.rxdata")
    @items         = load_data("Data/Items.rxdata")
    @weapons       = load_data("Data/Weapons.rxdata")
    @armors        = load_data("Data/Armors.rxdata")
    @enemies       = load_data("Data/Enemies.rxdata")
    @troops        = load_data("Data/Troops.rxdata")
    @states        = load_data("Data/States.rxdata")
    @animations    = load_data("Data/Animations.rxdata")
    @tilesets      = load_data("Data/Tilesets.rxdata")
    @common_events = load_data("Data/CommonEvents.rxdata")
    @system        = load_data("Data/System.rxdata")
    @maps = {}
    for i in 1..999
      number = sprintf("%03d", i)
      if FileTest.exist?("Data/Map#{number}.rxdata")
        @maps[i] = load_data("Data/Map#{number}.rxdata")
      else
        break
      end
    end
    @map_infos     = load_data("Data/MapInfos.rxdata")
  end
 
  def [](str)
    return @customs_data[str]
  end
 
end

module Cold
   
  $data = Customs_Data.new
 
end

class Window_Base < Window
 
 
  #--------------------------------------------------------------------------
  # - Desenhar Gráfico
  #
  #     t     : Texto a ser feita as linhas
  #     width : Largura máxima da linha
  #     
  #     - Ele retorna uma array, em que cada elemento é uma string
  #       com a largura desejada.
  #--------------------------------------------------------------------------
 
  def lines(t, width)
    text = t.clone
    x = self.contents.text_size(text).width / width
    x += 1 if self.contents.text_size(text).width % width > 0
    texts = []
    for i in 0...x
      texts.push("")
    end
    for i in 0...texts.size
      words = text.split(" ")
      return_text = ""
      for w in 0...words.size
        word = words[w]
        x = "!@$%¨&*()"
        return_text += word + x + " "
        return_text2 = return_text.gsub(x,"")
        t_width = self.contents.text_size(return_text2).width
        if t_width > width
          texts[i] = return_text.gsub(" "+word+x, "")
          text.gsub!(texts[i], "")
          break
        elsif w == words.size - 1
          texts[i] = return_text.gsub(x+" ", "")
          text.gsub!(texts[i], "")
          break
        else
          return_text.gsub!(word+x, word)
        end
      end
    end
    return texts
  end
 
  def draw_text_in_lines(x, y_initial, width, height, text)
    lines = lines(text, width)
    y = y_initial
    for text_line in lines
      self.contents.draw_text(x, y, width, height, text_line)
      y += height
    end
  end
   
end

After, insert this other script above main and below previous script:
Script is Attachments cause it's very big

How to use:

To call the Items Menu:
    $scene = Scene_ItemsBook.new

To call the Bestiary Menu:
    $scene = Bestiary.new

Obs.: It's necessary a picture in the directory Graphics/Pictures to be a background of menus. To change the name of picture, go to the line 42 of Script.

Demo

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg88.imageshack.us%2Fimg88%2F9967%2Fbuttoncq5.png&hash=690017537791322104feeeb6252bc9af60578c5a) (http://"http://www.4shared.com/file/81997938/b987790a/Cold_Books_System__English_.html?dirPwdVerified=ef69743a")

Credits

Cold Strong (me)
Title: Re: [RMXP] Items Book and Bestiary
Post by: Deadly Alince on February 24, 2009, 11:29:35 PM
Kool script i love it!
but i cant download the demo error in finding link  :-\
Title: Re: [RMXP] Items Book and Bestiary
Post by: Revo on February 24, 2009, 11:47:12 PM
He used the URL tags incorrectly.

Link: http://www.4shared.com/file/81997938/b987790a/Cold_Books_System__English_.html?dirPwdVerified=ef69743a
Title: Re: [RMXP] Items Book and Bestiary
Post by: Deadly Alince on February 25, 2009, 12:23:42 AM
Thx  ;D

Title: Re: [RMXP] Items Book and Bestiary
Post by: Sagal on April 19, 2009, 09:43:41 AM
I got small problem with bestiary part...
Items book works good but I get this error when trying Bestiary:
NameError occurred while running script

uninitialized constant Interpreter::Bestiary

Help please!
Title: Re: [RMXP] Items Book and Bestiary
Post by: appleslinky on June 08, 2009, 07:32:59 AM
I got small problem with bestiary part...
Items book works good but I get this error when trying Bestiary:
NameError occurred while running script

uninitialized constant Interpreter::Bestiary

Help please!

I get that problem aswell... Cold, can you help please? Thanks in advance  :)
Title: Re: [RMXP] Items Book and Bestiary
Post by: eps5000 on September 15, 2009, 09:09:38 PM
Yes, I get an error with the beastiary too, it keep throwing up an error at line 51, something about an "undefined method" did anyone else have this issue?
Title: Re: [RMXP] Items Book and Bestiary
Post by: cozziekuns on September 29, 2009, 08:40:39 AM
I got small problem with bestiary part...
Items book works good but I get this error when trying Bestiary:
NameError occurred while running script

uninitialized constant Interpreter::Bestiary

Help please!

I get that problem aswell... Cold, can you help please? Thanks in advance  :)
Instead of writing $scene = Bestiary.new, write $scene = Scene_Bestiary.new. I think that should fix up the problem. It worked for me!
Yes, I get an error with the beastiary too, it keep throwing up an error at line 51, something about an "undefined method" did anyone else have this issue?
Before you place the bestiary in, place the add on of the bestiary on top of the main bestiary class. That should fix it up.
Title: Re: [RMXP] Items Book and Bestiary
Post by: BrokenMessiah on February 03, 2011, 03:52:31 AM
Sorry for necroing, can someone reupload this script?
Title: Re: [RMXP] Items Book and Bestiary
Post by: pacdiggity on February 03, 2011, 04:10:08 AM
This thread is a zombie! :zombie:
If you follow this link (http://www.4shared.com/file/81997938/b987790a/Cold_Books_System__English_.html?dirPwdVerified=ef69743a) for the demo, you will find that "The file link that you requested is not valid.", but if you just click on the attachment that will work. You don't really need the demo anyway, it's quite self-explanatory (even though I work with VX.).