Bestiary Script V1.1

I don't suppose you know why, when I copy the script to my game and fight something, it says "Seen 1 Killed 2" in the bestiary, do you? It's got me beat.
Hmm how many states do you have that are associated with the hp being zero that is probably the bug with that
Aha, yes that is indeed the problem, you're epic y'know. Thanks :)
Ok a temporary fix until I update the script

Find the section in class edits that looks similiar to this piece of code and replace it with the code below

class Game_Enemy
  #--------------------------------------------------------------------------
  # * Set Hp
  #--------------------------------------------------------------------------
  alias_method :trick_bestiary_enemy_hp=, :hp=
  def hp=(hp)
    # The Usual
    self.trick_bestiary_enemy_hp = hp
    # If Dead Add +1 to kill count
    $game_system.killed[id] += 1 if dead? and hp <= 0
  end
end
Expand to see the code.


or replace that whole section (Class Edits) with this one below
Content Hidden Spoiler
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Trickster\'s Bestiary')
 
class Game_System
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :seen
  attr_reader :killed
  attr_reader :enemies
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias_method :trick_bestiary_system_initialize, :initialize
  def initialize
    # The Usual
    trick_bestiary_system_initialize
    # Setup Enemies
    @enemies = (1...$data_enemies.size).to_a - Bestiary::Excluded_Enemies
    # Setup Variables
    @seen, @killed = Hash.new(0), Hash.new(0)
  end
end

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Main Troopdata
  #--------------------------------------------------------------------------
  alias_method :trick_bestiary_battle_main_troopdata, :main_troopdata
  def main_troopdata
    # The Usual
    trick_bestiary_battle_main_troopdata
    # Run Through Enemies
    $game_troop.enemies.each {|enemy| $game_system.seen[enemy.id] += 1}
  end
end

class Game_Enemy
  #--------------------------------------------------------------------------
  # * Set Hp
  #--------------------------------------------------------------------------
  alias_method :trick_bestiary_enemy_hp=, :hp=
  def hp=(hp)
    # The Usual
    self.trick_bestiary_enemy_hp = hp
    # If Dead Add +1 to kill count
    $game_system.killed[id] += 1 if dead? and hp <= 0
  end
end
 
class RPG::Enemy
  #-------------------------------------------------------------------------
  # * Name:      Element Test
  #   Info:      Returns Element Effiency Value
  #   Author:    Trickster
  #   Call Info: One Argument Element_Id the element Id to test
  #   Returns:   AN Integer 1-6 representing the effiency
  #-------------------------------------------------------------------------
  def element_test(element_id)
    # Get a numerical value corresponding to element effectiveness
    return [0,6,5,4,3,2,1][element_ranks[element_id]]
  end
  #-------------------------------------------------------------------------
  # * Name:      Weaknesses
  #   Info:      Returns Enemy Weaknesses
  #   Author:    Trickster
  #   Call Info: None
  #   Returns:   An Array of Element Ids for which an A or B effiency
  #-------------------------------------------------------------------------
  def weaknesses
    weak = []
    Game_Enemy::Real_Elements.each do |element_id|
      weak << element_id if [6,5].include?(element_test(element_id))
    end
    return weak
  end
  #-------------------------------------------------------------------------
  # * Name:      Resistance
  #   Info:      Returns Enemy Resistance
  #   Author:    Trickster
  #   Call Info: None
  #   Returns:   An Array of Element Ids for which an F or E effiency
  #-------------------------------------------------------------------------
  def resistance
    resists = []
    Game_Enemy::Real_Elements.each do |element_id|
      resists << element_id if [1,2].include?(self.element_test(element_id))
    end
    return resists
  end
end

class RPG::Troop
  #--------------------------------------------------------------------------
  # * Has Enemy?
  #--------------------------------------------------------------------------
  def has_enemy?(enemy_id)
    # Run through each member and return true if included
    self.members.each {|member| return true if member.enemy_id == enemy_id}
    # Not In Troop
    return false
  end
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Expand to see the code.
That's excellent, thanks a bunch (Y)
no, thank you for bringing that to my attention
Heh, I just noticed something else. If you use this in conjunction with the multi-attack script, say for example if I use the octo-slash on a ghost, the Bestiary will say something along the lines of "Seen 1 Killed 7", I guess depending on how much health the Ghost has.
Do the fix above and replace the same method with this one

class Game_Enemy
  #--------------------------------------------------------------------------
  # * Set Hp
  #--------------------------------------------------------------------------
  alias_method :trick_bestiary_enemy_hp=, :hp=
  def hp=(hp)
    # Get Last Hp
    last_hp = self.hp
    # The Usual
    self.trick_bestiary_enemy_hp = hp
    # If Dead Add +1 to kill count
    $game_system.killed[id] += 1 if dead? and self.hp <= 0 and last_hp != self.hp
  end
end
Expand to see the code.


Sorry about that
Excellent, nice one.
Can you mirror the download, the server for the downloads is down...
I get an error saying:
Script 'Setup' line 53: SyntaxError Occurred.
Expand to see the code.


and at line 53:
  2 => '(Description)'
Expand to see the code.

That is for the second slot of the information.

EDIT: What I was trying to do was to add descriptions for all of the other enemies, but using their IDs, like it showed in the first example, but it doesn't work, I just get an error
Show me the whole setup that you have.
=begin
=============================================================================
â–  Bestiary
=============================================================================
Trickster
Version 1.1
3.17.07
=============================================================================
=end

#--------------------------------------------------------------------------
# * Begin SDK Log
#--------------------------------------------------------------------------
SDK.log('Trickster's Bestiary', 'Trickster', 1.1, '3.17.07')
#--------------------------------------------------------------------------
# Begin SDK Requirement Check
#--------------------------------------------------------------------------
SDK.check_requirements(2.0, [1, 2, 3], ['Map Info'])
#--------------------------------------------------------------------------
# * Begin SDK Enable Test
#--------------------------------------------------------------------------
if SDK.enabled?('Trickster's Bestiary')
 
module Bestiary
  #--------------------------------------------------------------------------
  # * Excluded Enemy IDs
  #--------------------------------------------------------------------------
  Excluded_Enemies = [6,7]
  #--------------------------------------------------------------------------
  # * Excluded Troop IDs
  #--------------------------------------------------------------------------
  Excluded_Troops = []
  #--------------------------------------------------------------------------
  # * Excluded Map IDs
  #--------------------------------------------------------------------------
  Excluded_Maps = ["TEST"]
  #--------------------------------------------------------------------------
  # * Locations Addition
  #   syntax - enemy_id = [map_ids]
  #--------------------------------------------------------------------------
  Locations = {
  }
  #--------------------------------------------------------------------------
  # * Not Seen Name
  #--------------------------------------------------------------------------
  Not_Seen = '??????'
  #--------------------------------------------------------------------------
  # * Descriptions
  #   syntax - enemy_id = Description
  #--------------------------------------------------------------------------
  Description = {
  1 => 'The first slot description.'
  2 => 'The second slot description.'
  }
  #--------------------------------------------------------------------------
  # * Descriptions Default
  #--------------------------------------------------------------------------
  Description.default = 'No Information'
  #--------------------------------------------------------------------------
  # * Battler Type (Scanning 0: Fit to Size 1: Crop) (Dimensions 176x176)
  #--------------------------------------------------------------------------
  Draw_Type = 0
  #--------------------------------------------------------------------------
  # * Crop (syntax enemy_id = direction 0-8)
  # 0 1 2
  # 3 4 5
  # 6 7 8
  #--------------------------------------------------------------------------
  Crop = {
  }
end
#--------------------------------------------------------------------------
# * End SDK Enable Test
#--------------------------------------------------------------------------
end
Expand to see the code.


This is taking longer than expected...
I tried dozens of things. and none of them work.
and you know what I realized.

When you add " 2 => 'description' " on the demo that you gave, it doesn't work, so there is something wrong with the scripts. you can't add another slot in the bestiary. I am just tell you that now. Also, I tried add "002" as the ID and it still doesn't work... Here I'll how you the codes I tried to work with(I don't know anything about this code style, so I was playing around)
002 =>
02 =>
2 =
2 ==
002 ==
2 =<
{2 => "..."}
ETC...
Oh sorry I had forum trouble *glares at shadow16*

But the problem is that you missed a , when separating entries in a hash

  Description = {
  1 => 'The first slot description.'[B],[/B]
  2 => 'The second slot description.'
  }
Expand to see the code.


notice the bolded ,

If you were to add another entry it would be
  Description = {
  1 => 'The first slot description.'[B],[/B]
  2 => 'The second slot description.'[B],[/B]
  3 => 'The third slot description.'
  }
Expand to see the code.


Also
  Excluded_Maps = ["TEST"]
Expand to see the code.


In that array there should be the map ids in which the map locations are excluded again the entries in an array are separated by commas.
OMG
..
..
It was so fricken simple! I can't believe it!
I feel like such an idiot! It was right in front of my face!
lol, Thanks a lot :)

I found another problem. I don't know if your Bestiary script is the problem, but since I added your bestiary script its been messed up. Anyways the problem is that when I bring up a text window, and I press the action key to make it dissapear it doesn't go away, and instead it keep repeating the same process(Appear then going away for a second and appearing again.)
I am using the normal default text system...
You are welcome also your bug is caused by either the version of SDK in the demo being outdated, please get the latest version from the SDK topic (the one in my demo is not the current version)
I see...
Thank you.

EDIT: Now, the Bestiary won't update anymore. My guess is that I need to edit certain parts of the Codes to catch up with the SDK 2.2... am I right? actually, I'm positive I am right..
And what do you mean by it won't update anymore?

Also note that it is finals in college for me so please be patient, I'll get to your questions when I get the chance so there is no need to bump (as it is against the rules to bump topics in the Submitted Scripts forum anyway)
I am sorry.

But anyways, after I fight them or encounter them, and I go to the bestiary script, then the information isn't entered...
Care to send me a demo

(btw it is Finals week for me so that is why my response times are slow)
Hey Trickster. Love the bestiary... it gave me incentive to do my own script editing for the very first time so as to put the Bestiary in the main menu. Not exactly epic, but it's a start. =)

I was just wondering... would it be possible to make it so that a creature doesn't go into the bestiary unless you use Scan on it? In conjunction with your excellent Steal/Mug/Scan script, the bestiary makes scanning less useful as of right now. Requiring it to add to the bestiary would be a nice touch.

Thanks for all the great work!
The text isn't visible in your demo.
wth is this family thing about?
other than this good script though it's pointless in making us download the demo and waste space.
Uh, if you don't want to waste your space, then don't download the Demo. Simple as that. Demos are made to further explain how the script works, and other aspects of the script.
The demo are for so you seeing on the first hand how the Scripts are working. They're often not very big for the reason because they don't require to be showing you how the Scripts are working.

I still am curious how to make the text visible when I use the Scripts. I have tried with and also without SDK and I have tried search for use of "font" but I am wondering if perhaps variables are being improperly references in referring to texts, which does not seem to be the likely case to me. For the reason because I see no indication that this doesn't work for other people.
There's a funny story about the families... it's an inside joke (not that I'm actually in on it, but a little research turned it up.) But basically, I think Trickster requires you to download the demo because it ensures you're using a legal version of RMXP.
[QUOTE=GreenBanana;231721]The demo are for so you seeing on the first hand how the Scripts are working. They're often not very big for the reason because they don't require to be showing you how the Scripts are working.

I still am curious how to make the text visible when I use the Scripts. I have tried with and also without SDK and I have tried search for use of "font" but I am wondering if perhaps variables are being improperly references in referring to texts, which does not seem to be the likely case to me. For the reason because I see no indication that this doesn't work for other people.[/QUOTE]

This can be caused by many reasons

1) You have the illegal version of the maker
2) There is a font error, reinstall your font
3) you set the default font to one you don't have
Is there any way to make all the attributes on the right and make all the stats on the left... here... this is what i mean...

Left Side: Right Side:
Hp : 520 STR : 41
Sp : 419 DEX : 39
ATK : 100 AGI : 41
PDEF : 95 INT : 41
MDEF : 95 Eva : 0
Gold : 16 EXP : 2
Seen : 2
Killed : 2

i hope that helps... I just want all the attributes to be on the right side and all the stats on the left. Well they could both be stats. So just please could someone make that edit for me... Thanks in advance. I have no clue on how to script that but ill learn someday...
I'm getting an error.
Quote:
Script 'Window_' Line 384: NoMethodError Occured.
undefined method 'includes_any?' for nil:NilClass

It happens after I've encountered a monster and I call the bestiary. If I haven't had an encounter and the bestiary is empty, there's no problem. I'm calling the Bestiary from an item used from the menu using the "$scene = Scene_Bestiary.new" command. I have not edited the Bestiary script yet, I was just doing an intial test.

I'm running:
SDK Parts I, II, III, IV and Upgrade Patch
Moghunter's Menus (Main, item, skill, status so far)
Trickster's Steal, Mug, Scan 6.3
and a lot of other stuff which I DON'T think would affect it, but I can list everything if necessary.

Oh and as kind of a sidenote: Two questions:
1) is there a way to change the font and/or windowskin when it's pulled up?
2) can partial entries be added or full entries be added by an event instead of encountering the monster (example: Bob reads about Gryphons in a book. He knows what they look like and their weakensses, but he's never actually fought one)
Mustardy85;234387 wrote:
Is there any way to make all the attributes on the right and make all the stats on the left... here... this is what i mean...

Left Side: Right Side:
Hp : 520 STR : 41
Sp : 419 DEX : 39
ATK : 100 AGI : 41
PDEF : 95 INT : 41
MDEF : 95 Eva : 0
Gold : 16 EXP : 2
Seen : 2
Killed : 2

i hope that helps... I just want all the attributes to be on the right side and all the stats on the left. Well they could both be stats. So just please could someone make that edit for me... Thanks in advance. I have no clue on how to script that but ill learn someday...


Look in the script Window_ and find this code

    # Do 10 times
    10.times do |i|
      # Get X and Y
      x, y = (i % 2) == 0 ? 176 : 328, (i / 2) * 32 + 32
      # Draw Parameter
      draw_parameter(battler, x, y, 80, i)
    end
Expand to see the code.


To make this easier to modify here is the expanded version

draw_parameter(battler, 176, 32, 0)
draw_parameter(battler, 328, 32, 1)
draw_parameter(battler, 176, 64, 2)
draw_parameter(battler, 328, 64, 3)
draw_parameter(battler, 176, 96, 4)
draw_parameter(battler, 328, 96, 5)
draw_parameter(battler, 176, 128, 6)
draw_parameter(battler, 328, 128, 7)
draw_parameter(battler, 176, 160, 8)
draw_parameter(battler, 328, 160, 9)
Expand to see the code.


Now the numbers 0 - 9 mean in that order
atk pdef mdef str dex agi int eva gold exp


Now you should be able to edit it

*Hint* all you need to do is change the last numbers in those method calls

Next you will have to change these two lines
    # Draw Seens
    draw_seens(battler, 328, 192, 80)
    # Draw Kills
    draw_kills(battler, 328, 224, 80)
Expand to see the code.


and that's it


Mea;234516 wrote:
I'm getting an error.

It happens after I've encountered a monster and I call the bestiary. If I haven't had an encounter and the bestiary is empty, there's no problem. I'm calling the Bestiary from an item used from the menu using the "$scene = Scene_Bestiary.new" command. I have not edited the Bestiary script yet, I was just doing an intial test.

I'm running:
SDK Parts I, II, III, IV and Upgrade Patch
Moghunter's Menus (Main, item, skill, status so far)
Trickster's Steal, Mug, Scan 6.3
and a lot of other stuff which I DON'T think would affect it, but I can list everything if necessary.

Oh and as kind of a sidenote: Two questions:
1) is there a way to change the font and/or windowskin when it's pulled up?
2) can partial entries be added or full entries be added by an event instead of encountering the monster (example: Bob reads about Gryphons in a book. He knows what they look like and their weakensses, but he's never actually fought one)


I'll take a look at it when I get the chance (sleepy now)

To change the font you will have to add this line

self.contents.font.name = "FONT HERE"
Expand to see the code.


after this

    self.contents = Bitmap.new(width - 32, height - 32)
Expand to see the code.


to change the windowskin do this

self.windowskin = RPG::Cache.windowskin(@windowskin_name)
Expand to see the code.


somewhere in the initialize method

also I will consider adding partial info for the next version of the bestiary

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=17461