Simple Beastary!
#1
Simple Beastary!
by bchimself
Jul 1 2007

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


My First Script!

This is a very simple beastary I made wich pulls monsters from the list. You can change where the list starts and ends. In this version it shows mobs Max HP, Max SP, and EXP!

All you have to do to show this is make an event and put the following in scripts (page3):
Code:
$scene=Beastary_Scene.new


Insert this above main.
Code:
#==============================================================================
# Beastary Version 1.0
# Date 5/1/07
# Made by BChimself
#------------------------------------------------------------------------------
# PLEASE READ! The beastary draws monster IDs from ingame variable # 1
# It is important that you set all variables in this script to a blank
# variable ingame for this use. If you get a WARNING message this may be
# the variables are crossed! I have marked what will need to be changed
# if you need to change the variables! Infact Every that you may want
# to or need to change is marked in a comment to the right!
# Enjoy!~ =p
#==============================================================================
class Beastary_Scene
  
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  
  def main
    @mobs_max = 33 #IMPORTANT TO CHANGE THIS!!!!
    @mobs_min = 1 #Where the list starts. Doesnt have to be 1!
    $game_variables[1] = @mobs_min #Change the [1] to your variable!
    @window_b1=Beastary_Window_1.new
    @window_b1.update(false)
    @window_b1.x=200
    @window_b1.y=60
    @window_b3=Beastary_Window_3.new
    @window_b3.update(" ")
    
    s1= "Next"
    s2= "Previous"
    s3= "Exit"
    @window_b2=Window_Command.new(200, [s1,s2,s3])
    @window_b2.y=60
    @window_b2.height=420
    @window_b2.index=@menu_index
    
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    
    Graphics.freeze
    @window_b1.dispose
    @window_b2.dispose
    @window_b3.dispose
  end
  
  def update
      
    @window_b2.update
    case @window_b2.index
      when 0
        @window_b3.update("Select the next monster?")
      when 1
        @window_b3.update("Select the preivious monster?")
      when 2
        @window_b3.update("Do you wish to exit?")
    end
    
    if Input.trigger?(Input::C) #ENTER
    case @window_b2.index
      when 0
        nexts #like this for a reason!
      when 1
        previous
      when 2
        exit
    end
  end
  
  if Input.trigger?(Input::B) #ESC
    $game_system.se_play($data_system.cancel_se)
    $scene=Scene_Map.new
    $game_map.autoplay
  end
end
#------------------------------------------------------------------------------
  def nexts
    if $game_variables[1] < @mobs_max
      $game_system.se_play($data_system.decision_se)
      $game_variables[1] += 1
      @window_b1.update(" ")
    else
      $game_system.se_play($data_system.buzzer_se)
    end
  end
    
  def previous
    if $game_variables[1] > @mobs_min
      $game_system.se_play($data_system.decision_se)
      $game_variables[1] -= 1
      @window_b1.update(" ")
    else
      $game_system.se_play($data_system.buzzer_se)
    end
  end
  
  def exit
    $game_system.se_play($data_system.cancel_se)
    $scene=Scene_Map.new
    $game_map.autoplay
  end
#==============================================================================
#                      Window 1 will show enemy data.
#                You will also need to change the variable
#                here if the its already in use. Just Creat
#                A new variable with in the game and name it
#               Monster ID or what ever. Change where it says.
#==============================================================================
class Beastary_Window_1 < Window_Base
  
  def initialize
    if $game_variables[1] <= 0 #Change the [1] to your variable!
      print "WARNING: Game will crash due to variables not set properly!"
    end
    if $game_variables[1] >= 1 #Change the [1] to your variable!
      super(0,0,440,420)
      self.contents = Bitmap.new(width-32,height-32)
      self.contents.font.name = "Arial" #This is the font used. I wouldn't change this.
      self.contents.font.size = 24
    end
    
    def update(content)
      @mob_id = $data_enemies[$game_variables[1]].name #Change the [1] to your variable!
      @mob_maxhp = $data_enemies[$game_variables[1]].maxhp #Change the [1] to your variable!
      @mob_maxsp = $data_enemies[$game_variables[1]].maxsp #Change the [1] to your variable!
      @mob_exp = $data_enemies[$game_variables[1]].exp #Change the [1] to your variable!
      self.contents.clear
      self.contents.font.color = text_color(0) #This will change text color. Its red by default. Use the numbers 0-7.
      self.contents.draw_text(0,0,300,32, @mob_id)
      self.contents.font.color = text_color(2) #This will change text color. Its red by default. Use the numbers 0-7.
      self.contents.draw_text(0,30,300,32,"HP("+@mob_maxhp.to_s+")/SP("+@mob_maxsp.to_s+")/EXP("+@mob_exp.to_s+")")
    end
              
  end
end
#==============================================================================
# Window 3 Help menu
#==============================================================================
class Beastary_Window_3 < Window_Base
  
  def initialize
    
    super(0,0,640,60)
    self.contents=Bitmap.new(width-32,height-32)
    self.contents.font.name = "Arial"
    self.contents.font.size = 24
    
  end
  
  def update(help_text)
    self.contents.clear
    self.contents.draw_text(0,0,440,32, help_text)
  end
end
end
}


Messages In This Thread
Simple Beastary! - by bchimself - 07-01-2007, 01:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple Sell Shop Leon Blade 0 2,416 12-16-2006, 01:00 PM
Last Post: Leon Blade



Users browsing this thread: 1 Guest(s)