Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Items Book and Bestiary system, System based in DG8
Cold
post Jan 22 2009, 03:07 PM
Post #1



Group Icon

Group: Member
Posts: 4
Type: Scripter
RM Skill: Advanced




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
[Show/Hide] Screnshots






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
#######################################################################
#########
################################################################################
########################### 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 = 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



Credits

Cold Strong (me)

This post has been edited by Cold: Jan 23 2009, 02:55 PM
Attached File(s)
Attached File  Script.txt ( 77.82K ) Number of downloads: 356
 
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
Rafidelis
post Jan 23 2009, 03:22 PM
Post #2


Level 5
Group Icon

Group: Member
Posts: 71
Type: Scripter
RM Skill: Beginner




First, paste this script above the Main, he changes the menu and add the option "Extra," where are the options "Bestiary" and "Items Book"

[Show/Hide] Scene Menu
CODE
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#  Rafidelis EDit
#==============================================================================

class Scene_Menu
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s7 = "Extras"
    s4 = "Status"
    s5 = "Save"
    s6 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3,s7,s4, s5, s6])
    @command_window.index = @menu_index
    @command_window.height = 230
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(4)
    end
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 224
    # Make steps window
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 320
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    @command_window_extra = Window_Command.new(160,["Bestiary","Items Book"])
    @command_window_extra.x = 100
    @command_window_extra.y = 80
    @command_window_extra.visible = false
    @command_window_extra.active = false
    @command_window_extra.z = @command_window.z + 3
    @command_window_extra.opacity = 255
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @command_window_extra.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @steps_window.update
    @gold_window.update
    @status_window.update
    @command_window_extra.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
   if Input.trigger?(Input::C) and @command_window_extra.active
     case @command_window_extra.index
     when 0
      $scene = Scene_Bestiary.new
    when 1
      $scene = Scene_ItemsBook.new
    end
  elsif Input.trigger?(Input::B) and @command_window_extra.active
        @command_window.active = true
        @command_window_extra.visible = false
        @command_window_extra.active = false
      end
    end
  end
  

  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # Extra\o/
        @command_window.active = false
        @command_window_extra.visible = true
        @command_window_extra.active = true
      when 4  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 5  # save
        # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Save.new
      when 6  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end


Then go to the Script Books System, and in line 1847 change this code:

CODE
if Input.trigger?(Input::B)
       $scene = Scene_Map.new
       return
     end


for this:

CODE
if Input.trigger? (Input::B)
      $scene = Scene_Menu.new(3)
       return
     end


And while the script Book System, go to the line in 2162 and modify this code:

CODE
$scene = Scene_Map.new

for this:
CODE
$scene = Scene_Menu.new(3)


I hope I have helped.
See the ScreenShot above:



__________________________
Nothing Special Today!
Go to the top of the page
 
+Quote Post
   

Posts in this topic
- Cold   Items Book and Bestiary system   Jan 22 2009, 03:07 PM
- - he_said   Hey that's a nice script! Can you make it...   Jan 22 2009, 04:37 PM
- - Cold   I don't work with RGSS2, alias i don't hav...   Jan 23 2009, 05:07 AM
- - Rafidelis   Verry Cool Cold Strong =D Braziliam scripters rule...   Jan 23 2009, 06:27 AM
- - Fraöt   Good! That Script did work but... I don't ...   Jan 23 2009, 09:17 AM
|- - Fraöt   QUOTE (Rafidelis @ Jan 23 2009, 03:22 PM)...   Jan 24 2009, 08:12 PM
- - Cold   Ow, perfect Rafidelis...   Jan 23 2009, 04:02 PM
- - UltiHaker   Wow! it's really good! Thanks, it...   Jan 24 2009, 07:12 PM
- - Fraöt   BTW: It didn't work. The "Extras" ca...   Jan 24 2009, 08:47 PM
- - Cold   Well... The script is working, i don´t understand...   Jan 25 2009, 10:35 AM
- - Rafidelis   Well, I made a simple error when writing the scrip...   Jan 25 2009, 03:37 PM
|- - Benvx   I dont quite understand this what do you mean by s...   Feb 19 2009, 08:02 AM
- - Fraöt   WOw, thanx! It worked! I can now choose t...   Jan 28 2009, 02:29 PM
- - kamster94   it's gr8! can anyone write something like ...   Feb 22 2009, 02:33 AM
- - Rigor Mortiis   @ Cold : The script works perfekt, but i have a q...   May 27 2009, 02:32 AM
- - Bigace   What does this mean Would try and fix it my self,...   Jun 6 2009, 06:57 AM
|- - Fishyguyguy   QUOTE (Bigace @ Jun 6 2009, 06:57 AM) Wha...   Aug 9 2009, 11:43 AM
- - Bigace   Really does this guy even come to this sight anymo...   Jun 10 2009, 03:15 PM
- - Zero2505   I got it working fine, but when I added the line f...   Jun 27 2009, 10:06 AM
- - RaidenPrime   Could someone tell me how I can change the text si...   Jul 10 2009, 08:44 PM
- - sournote103   I'm making a detective/mystery game, and I onl...   Jul 12 2009, 04:42 PM
|- - Antilurker77   Is there a way so certain items and monsters don...   Aug 2 2009, 03:50 PM
- - Zaroff90   Hey, i'm using gubid's tactical battle sys...   Oct 29 2009, 10:27 AM
- - dummy1234   Awesome script combo [the book and the extras menu...   Oct 31 2009, 04:59 AM
- - Zaroff90   anyone? can i get any advice on this? i'm usin...   Nov 5 2009, 09:32 AM
- - Pherione   I got a problem with saving. When I open one of bo...   Jan 11 2010, 11:23 PM
- - Pizzajazz   Please help me fast! I've got a little pr...   Apr 5 2012, 03:55 PM
- - Night_Runner   Hey Pizzajazz, You need to have deleted all your ...   Apr 5 2012, 10:08 PM
|- - Pizzajazz   Hey, thanks! It worked.   Apr 7 2012, 09:47 AM
- - Lunajuice-Co   Sweet script. Works like a charm. Definatly going ...   May 6 2012, 08:19 AM


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 12:51 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker