Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Script Mix :)

Save-Point

Full Version: Script Mix :)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone :)
Well... i have Demon picture book by Momomo and TRICKSTER'S Steal,Mug v6r2.
Lately Demon book just stopped to work and i can't figure out why. Monsters just stopped to appear in "MonsterBook" and i spent few hours to find any slution without effect. Anyway i get idea that it would be much better when monsters would appear in "MonsterBook" after Character would scan them.
So here is my questions.

1.Is there any command to add monsters manually to the "MonsterBook" (most important)
2.Is there possibility to mix it as i writed above. When i scan monster it appear in MonsterBook(not after i'll beat the monster)

Momomo's Demon picture book
Code:
#==============================================================================
# ** Demon picture book
#------------------------------------------------------------------------------
# by Momomo
#==============================================================================
#
# Information of encounter of the enemy is added, at the time of battle end (the place where experience value and the like is acquired) with.
# Depending, when it escapes from the enemy and with battle defeat and the like in the being defeated event it is not registered to the picture book.
# When we would like to change this timing, each one please rewrite.
# (start_phase5 of class Scene_Battle so adding, it increases.)
#
# In addition, there is a word, here and there "analyzing", but
# Presently, in just this demon dictionary has not done functioning. (Name remainder with our game)
# When DROP_ITEM_NEED_ANALYZE of Window_MonsterBook_Info has become true, because the drop item stops being indicated, usually please make false.
#
# Note
# When you use this way, unless it sets 1st at all of the troop of the database to, error it spits.
# As coping step
# 1.With 1st anything of the troop of the database it sets to gently from calling.
# 2 Game_Enemy_Book "Super (1, 1) the part of the number of the left side of the # dummy" is rewritten to the troop ID which exists.
# It becomes either one.
#
# 2005.2.6 Functional addition
# Adding the display function of degree of picture book completion
# SHOW_COMPLETE_TYPE so it can set.
# With "script" of event command
# $game_party.enemy_book_max - So the number of entire of picture book demons (maximum amount)
# $game_party.enemy_book_now  - So presently of the picture book the number of registers (presently number)
# $game_party.complete_percentage - So completion ratio of the picture book (the decimal point it truncates)
# You can acquire.
#
# 2005.2.17
# complete_percentage - Method name
# enemy_book_complete_percentage - Way modification (you can distinguish with the other picture book)
# It reached the point where acquisition of maximum amount and the like can be shortened with "the script" of event command.
# enemy_book_max - So the number of entire of picture book demons (maximum amount)
# enemy_book_now - So presently of the picture book the number of registers (presently number)
# enemy_book_comp - So completion ratio of the picture book (the decimal point it truncates)
#
# 2005.2.18 - Bug Correction
# complete_percentage - Method name
# enemy_book_complete_percentage - To modifying
# complete_percentage - The example calling, it increased. (It is a mere rewriting leak don't you think?)
#
# 2005.7.4 - Functional addition
# It corresponds to comment function.
# The variety you fumbled entirely.
#
# 2005.7.4 - Bug correction
# Correcting detailed bug.


module Enemy_Book_Config
 # Whether or not in drop item indication analyzing necessity
 DROP_ITEM_NEED_ANALYZE = false
 # Name of evasion correction
 EVA_NAME = "Evade"
 # Method of presentation of picture book completion ratio
 # 0: None   1: present no./maximum no.   2: Indicatory   3: Both
 SHOW_COMPLETE_TYPE = 2
 # Whether or not comment function is used, (main point comment additional script introduction)
 COMMENT_SYSTEM = false
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               # The enemy information which encounters (the for picture book)
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 alias book_info_initialize initialize
 def initialize
   book_info_initialize
   @enemy_info = {}
 end
 #--------------------------------------------------------------------------
 # * Add Enemy Information
 #     type : usual encounter or analyzing?   0: Usual   1: Analyzing  -1: Information deletion
 #     0: Non encounter 1: Encounter end 2: Analyzing end
 #--------------------------------------------------------------------------
 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
 #--------------------------------------------------------------------------
 # * Get Enemy Book Maximum
 #--------------------------------------------------------------------------
 def enemy_book_max
   return $game_temp.enemy_book_data.id_data.size - 1
 end
 #--------------------------------------------------------------------------
 # * Get Enemy Number Now
 #--------------------------------------------------------------------------
 def enemy_book_now
   now_enemy_info = @enemy_info.keys
   # Acquiring the attribute ID of register disregard
   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
 #--------------------------------------------------------------------------
 # * Get Enemy Book Completion Percentage
 #--------------------------------------------------------------------------
 def enemy_book_complete_percentage
   e_max = enemy_book_max.to_f
   e_now = enemy_book_now.to_f
   comp = e_now / e_max * 100
   return comp.truncate
 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
     # If enemy is not hidden
     unless enemy.hidden
       # Add Enemy Encounter Information
       $game_party.add_enemy_info(enemy.id, 0)
     end
   end
   add_enemy_info_start_phase5
 end
end

class Window_Base < Window
 #--------------------------------------------------------------------------
 # * Draw Enemy Drop Item
 #--------------------------------------------------------------------------
 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
   # Under present conditions temporarily only one drawing
   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
 #--------------------------------------------------------------------------
 # * Draw Enemy Book 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
 #--------------------------------------------------------------------------
 # * Draw Enemy Name
 #     enemy : Enemy
 #     x     : window x-coordinate
 #     y     : window y-coordinate
 #--------------------------------------------------------------------------
 def draw_enemy_name(enemy, x, y)
   self.contents.font.color = normal_color
   self.contents.draw_text(x, y, 152, 32, enemy.name)
 end
 #--------------------------------------------------------------------------
 # * Draw Enemy Graphic
 #     enemy : Enemy
 #     x     : window x-coordinate
 #     y     : window y-coordinate
 #--------------------------------------------------------------------------
 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
 #--------------------------------------------------------------------------
 # * Draw Enemy Experience
 #     enemy : Enemy
 #     x     : window x-coordinate
 #     y     : window y-coordinate
 #--------------------------------------------------------------------------
 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
 #--------------------------------------------------------------------------
 # * Draw Enemy Gold
 #     enemy : Enemy
 #     x     : window x-coordinate
 #     y     : window y-coordinate
 #--------------------------------------------------------------------------
 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
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize(enemy_id)
   super(1, 1) # Dummy
   @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
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   @id_data = enemy_book_id_set
 end
 #--------------------------------------------------------------------------
 # * Register disregard attribute acquisition for picture book
 #--------------------------------------------------------------------------
 def no_add_element
   no_add = 0
   # Acquiring the attribute ID of register disregard
   for i in 1...$data_system.elements.size
     if $data_system.elements[i] =~ /図鑑登録無効/
       no_add = i
       break
     end
   end
   return no_add
 end
 #--------------------------------------------------------------------------
 # * Enemy ID setting for picture book
 #--------------------------------------------------------------------------
 def enemy_book_id_set
   data = [0]
   no_add = no_add_element
   # Acquiring the attribute ID of register disregard
   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
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 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
 #--------------------------------------------------------------------------
 # * Data Set
 #--------------------------------------------------------------------------
 def data_set
   data = $game_party.enemy_info.keys
   data.sort!
   newdata = []
   for i in data
     next if $game_party.enemy_info[i] == 0
     # Considering picture book register disregard
     if book_id(i) != nil
       newdata.push(i)
     end
   end
   return newdata
 end
 #--------------------------------------------------------------------------
 # * Show?
 #--------------------------------------------------------------------------
 def show?(id)
   if $game_party.enemy_info[id] == 0 or $game_party.enemy_info[id] == nil
     return false
   else
     return true
   end
 end
 #--------------------------------------------------------------------------
 # * Book ID
 #--------------------------------------------------------------------------
 def book_id(id)
   return @book_data.index(id)
 end
 #--------------------------------------------------------------------------
 # * Enemy Acquisition
 #--------------------------------------------------------------------------
 def item
   return @data[self.index]
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   self.contents = Bitmap.new(width - 32, row_max * 32)
   # If item count is not 0, make a bit map and draw all items
   if @item_max > 0
     for i in 0...@item_max
      draw_item(i)
     end
   end
 end
 #--------------------------------------------------------------------------
 # * Draw Item
 #     index : item number
 #--------------------------------------------------------------------------
 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, "End", 2)
   end
 end
 #--------------------------------------------------------------------------
 # * Decide Enemy Analysis
 #--------------------------------------------------------------------------
 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
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   super(0, 0+64, 640, 480-64)
   self.contents = Bitmap.new(width - 32, height - 32)
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 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
 #--------------------------------------------------------------------------
 # * Decide Enemy Analysis
 #--------------------------------------------------------------------------
 def analyze?(enemy_id)
   if $game_party.enemy_info[enemy_id] == 2
     return true
   else
     return false
   end
 end
end


class Scene_MonsterBook
 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   $game_temp.enemy_book_data = Data_MonsterBook.new
   # Draw the window
   @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, "Demon Picture Book", 0)
   if Enemy_Book_Config::SHOW_COMPLETE_TYPE != 0
     case Enemy_Book_Config::SHOW_COMPLETE_TYPE
     when 1
       e_now = $game_party.enemy_book_now
       e_max = $game_party.enemy_book_max
       text = e_now.to_s + "/" + e_max.to_s
     when 2
       comp = $game_party.enemy_book_complete_percentage
       text = comp.to_s + "%"
     when 3
       e_now = $game_party.enemy_book_now
       e_max = $game_party.enemy_book_max
       comp = $game_party.enemy_book_complete_percentage
       text = e_now.to_s + "/" + e_max.to_s + " " + comp.to_s + "%"
     end
     if text != nil
       @title_window.contents.draw_text(320, 0, 288, 32,  text, 2)
     end
   end
   @main_window = Window_MonsterBook.new
   @main_window.active = true
   # Information window compilation (invisibility non actively setting)
   @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 compilation (invisibility non actively setting)
     @comment_window = Window_Monster_Book_Comment.new
     @comment_window.z = 120
     @comment_window.visible = false
     @comment_on = false # Comment flag
   end
   # 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
   @main_window.dispose
   @info_window.dispose
   @title_window.dispose
   @comment_window.dispose if @comment_window != nil
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # Update windows
   @main_window.update
   @info_window.update
   if @info_window.active
     update_info
     return
   end
   # If main  window is active: call update_main
   if @main_window.active
     update_main
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Update Main
 #--------------------------------------------------------------------------
 def update_main
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     $scene = Scene_Map.new
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     if @main_window.item == nil or @main_window.show?(@main_window.item) == false
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Play decision 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
 #--------------------------------------------------------------------------
 # * Frame renewal (when information window is active)
 #--------------------------------------------------------------------------
 def update_info
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel 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
   # If C button was pressed
   if Input.trigger?(Input::C)
     if @comment_window != nil
       # Play decision 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)
     # Play decision 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)
     # Play decision 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

Actually scripts are in this thread: (In Demo)
http://save-point.org/thread-2660.html
Well, Trickster has his OWN bestiary. But I understand going with the basics. You get to adapt a great many things to systems that start out primitive. Aren't you fortunate though. Not only did I support RTAB, but I just recently worked with Momomo's system.

Go into the Steal System (New) and find this lcode on line 964:
Code:
@scan_window = Scan_Window.new(targets[0]) if not targets.empty?

Below that, add the following:
Code:
$game_party.add_enemy_info(targets[0].id, 0) if not targets.empty?

The script call of
Code:
$game_party.add_enemy_info(Enemy_ID, 0)
is your magic statement that adds enemies, using their ID value from the database.
I know DerVVulfman :) I was hoping you will help me with that :)
When You helping me its like magic xD I was trying to do that for hours without any effect.
Of course i dont know much about programming.
Anyway - thank You very much. Everything is working perfectlny right now :)

PS I couldnt find Trickste'r Bestiaty :)