Bestiary Logbook v1.8 - updated 1/21/2014

Is there a way to set it so that the Bestiary isn't accessible from the menu to start with, but can be added to it (or otherwise accessed) later on?
As suggested the first step is to make the menu access false.
Menu_Access = true

Second is to use a menu script such as yanfly's to add a custom command.
This requires several parts so ask and we can assist.
Ruby:
    CUSTOM_COMMANDS ={
    # :command => ["Display Name", EnableSwitch, ShowSwitch, Handler Method],
      :debug   => [       "Debug",            0,          0, :command_debug],
      :shop    => [        "Shop",           12,          0,  :command_shop],
      :gogototori => ["Synthesis",            0,        0,  :command_totori],
      :bestiary => ["Bestiary",            10,        10,  :command_bestiary],
    } # Do not remove this.
Ruby:
  #--------------------------------------------------------------------------
  # new method: command_debug
  #--------------------------------------------------------------------------
  def command_debug
    SceneManager.call(Scene_Debug)
  end
 
  #--------------------------------------------------------------------------
  # new method: command_bestiary
  #--------------------------------------------------------------------------
  def command_bestiary
    SceneManager.call(Scene_Bestiary)
  end
  #--------------------------------------------------------------------------
  # new method: command_shop
  #--------------------------------------------------------------------------
  def command_shop
    goods = []
    SceneManager.call(Scene_Shop)
    SceneManager.scene.prepare(goods, false)
  end
 
  #--------------------------------------------------------------------------
  # new method: command_totori
  #--------------------------------------------------------------------------
  def command_totori
    return unless $imported['KRX-AlchemicSynthesis']
    SceneManager.call(Scene_Alchemy)
  end
So I imported all of the scripts to my game modification-free, added a scanning skill and actor quotes for all the troops, yet every time I scan an enemy, I receive no actor quotes. It just causes a "Failed" to bounce off of the enemy I scanned. This happens for every enemy, and I don't get what I'm doing wrong. I have the right actor and inputted everything correctly, so why isn't it showing up?
Remember how to fix that? I'm having the same problem..
Unless you have a script conflict it should work fine.
Do you have the quotes added to the enemy note box?
<quote: 1, Eric hates slimes>
Unless you have a script conflict it should work fine.
Do you have the quotes added to the enemy note box?
<quote: 1, Eric hates slimes>
If you're talking to me, yes. I have the demo and my project open in two separate windows so I can go back and forth to make sure everything is set right.

The problem is the scan skill/item won't stop failing to scan the enemies. I even copied and pasted the Bat enemy from this demo, added Eric back into the party, set the luck skill to 999, and still it fails to scan the enemy.
The problem is the scan skill/item won't stop failing to scan the enemies. I even copied and pasted the Bat enemy from this demo, added Eric back into the party, set the luck skill to 999, and still it fails to scan the enemy.
That suggest an issue somewhere in your project. (shocking I know).
When such issues happened to me in the past, it was because of something that I did to my project that caused the issue. Weather it was changing the default attack skill or state to having conflicting scripts.

I would maybe suggest making a copy of the bestiary demo and copying one of your pieces over and testing, then the next and find where it breaks.
For instance copy over skills.rvdata2 file. (maybe configure the scripts for the scan skill)
That suggest an issue somewhere in your project. (shocking I know).
When such issues happened to me in the past, it was because of something that I did to my project that caused the issue. Weather it was changing the default attack skill or state to having conflicting scripts.

I would maybe suggest making a copy of the bestiary demo and copying one of your pieces over and testing, then the next and find where it breaks.
For instance copy over skills.rvdata2 file. (maybe configure the scripts for the scan skill)
Didn't help at all. I imported the enemy from my protect into the demo here and at first I thought I figured it out, having to place him under the Bestiary Enemy/Troop, and while it scans in the demo it still fails in my project.

Everything appears to be the same. I don't know what else is wrong. I'll just link a zip of my project (unplayable since I have to remove a tileset I paid to download, can't let people get that for free on the creator's behalf) and let me know if you can spot the problem.


Just walk up and talk to the red headed character named Sally, and ignore Ant_Scan in the scripts under Antione. Right now he and Sonic are both using the default Scan and no, it's not the problem because I only just began scripting Ant_Scan in this morning.
Everything appears to be the same. I don't know what else is wrong. I'll just link a zip of my project (unplayable since I have to remove a tileset I paid to download, can't let people get that for free on the creator's behalf) and let me know if you can spot the problem.
Initial test, this is not compatible with @TheoAllen TSBS scripts.
I placed the bestiary script in one of his games and it does the same thing.
I don't know if I can figure out what the problem is, but if Theoallen can pop in and look, then we may have an answer fairly quick.

Shadowmaster Fantasy Bestiary is, but doesn't have a battle window.
Modern Algebra does but so far I can't get the battle window to show data.
I just had to change the script config and add a species tag to see the battle window
Go with Modern Algebra Monster Catalogue
but if Theoallen can pop in and look, then we may have an answer fairly quick.
Sure.

----
I use a completely different method for applying items on the scene level.
Venka aliased that particular method, named "apply_item_effects" while I use "tsbs_invoke_item".
However, I still use vanilla "Game_Battler > item_apply". To make this work together, we just need to alias a different method.

Ruby:
class Game_Battler
  alias venka_scan_skill_used item_apply
  def item_apply(user, item)
    if self.is_a?(Game_Enemy)
      enemy = $data_enemies[self.enemy_id]
      $game_party.reveal_resist(enemy.id, false) if item.scan
      attack_element = item.damage.element_id
      Venka::Bestiary::Elements.size.times do |i|
        if Venka::Bestiary::Elements[i][0] == attack_element
          $game_party.bestiary.each do |entry|
            entry.elements[i] = true if entry.enemy_id == enemy.shown_id
          end
        end
      end
      if item.scan
        $game_party.bestiary.each do |entry|
          entry.scanned = true if entry.enemy_id == enemy.shown_id
        end
        SceneManager.scene.show_enemy_info(self.enemy_id)
      end
    end
    venka_scan_skill_used(user, item)
  end
end
we just need to alias a different method.
Would I be wrong to say that the alias call at the bottom needs to be user not target
Would I be wrong to say that the alias call at the bottom needs to be user not target
You were right. Normally it should throw an undefined variable error, but there's a function named "target" so it missed.
Sure.

----
I use a completely different method for applying items on the scene level.
Venka aliased that particular method, named "apply_item_effects" while I use "tsbs_invoke_item".
However, I still use vanilla "Game_Battler > item_apply". To make this work together, we just need to alias a different method.

Ruby:
class Game_Battler
  alias venka_scan_skill_used item_apply
  def item_apply(user, item)
    if self.is_a?(Game_Enemy)
      enemy = $data_enemies[self.enemy_id]
      $game_party.reveal_resist(enemy.id, false) if item.scan
      attack_element = item.damage.element_id
      Venka::Bestiary::Elements.size.times do |i|
        if Venka::Bestiary::Elements[i][0] == attack_element
          $game_party.bestiary.each do |entry|
            entry.elements[i] = true if entry.enemy_id == enemy.shown_id
          end
        end
      end
      if item.scan
        $game_party.bestiary.each do |entry|
          entry.scanned = true if entry.enemy_id == enemy.shown_id
        end
        SceneManager.scene.show_enemy_info(self.enemy_id)
      end
    end
    venka_scan_skill_used(user, item)
  end
end
I know this'll make me sound like a complete new comer but which one of your scripts do I place this in? And I assume this'll also work for the Scan Skill as well as the Scan Item?

I'm mostly asking this here so other people having this problem can read the solution for themselves if they're like me and not a good scripter.
I know this'll make me sound like a complete new comer but which one of your scripts do I place this in? And I assume this'll also work for the Scan Skill as well as the Scan Item?
The order of my battle system script and Venka script shouldn't matter (I haven't checked deeper), however, this patch specifically should be below both scripts.

Items and skills are treated the same. Should work for both.
The order of my battle system script and Venka script shouldn't matter (I haven't checked deeper), however, this patch specifically should be below both scripts.

Items and skills are treated the same. Should work for both.
And it works! To be honest I would never had thought to place this patch under the two scripts. As I said I'm not that smart of a scripter. ^^; But thank you both for helping me out. Now if anyone else runs into this problem they can read your comments and save hours of time.

Next thing to do is adding another Scan Skill so I can user Theo's script to give each character with the Skill to have their own animation for it.

EDIT: Now I have a new problem. Whenever scanning is successful (still shows the fail text but window pops up) only Sonic says the Actor Quote for the enemy, even thought Antoine was the one to scan the enemy. I kinda wished there was another example for these other than just "<bestiary_say: 1, Test info about Slimes1.>".

How exactly do these Actor Quotes work? Here are a couple screenshots.

Spoiler: Screenshots
1663265203015.png
1663265226064.png
1663265244132.png

I'm mostly confused on the 'slime1/sime2' you see in the demo but as 'Motorbug1/Motorbug2' in my project.
Double posting here as the issue I edited into my post from yesterday is still an issue. I was able to copy and paste this,

Actor/Class Quotes when scan used
<quote: 1, Eric says some random stuff about slimey slimes... like.. they're blue!>
<quote: 1, Eric |hates |slimes>

and by changing the 1 to the ID of Antoine, whose ID is 7, it showed Antoine's portrait for both quotes. Thought that fixed it, so I changed the former quote to ID 6, which is Sonic's ID, and now the game skips over that quote entirely.

So what exactly am I'm not understanding with this? I'm sorry for asking for help so often. >_> But I'm just at a lost on what I'm doing wrong.
So what exactly am I'm not understanding with this? I'm sorry for asking for help so often. _ But I'm just at a lost on what I'm doing wrong.
I'm not sure, but in the demo you provided the sonic character class has something wrong with it.
I copied the class 8 onto it and then sonic was able to hit enemies, before he always missed.

As for the quotes, I did some print testing and the quotes were not coming up for me at all.
The system was not finding the quotes in the enemy notebox to match the script settings. Yet if I test it on Rubular it works fine.
I also got mixed up for a while as I was making changes to enemy 3 Motobot, but the battle uses enemy 10 Motobot.
I had come up with this which was getting the quotes and saving it to the enemy quotes, but I didn't see the output until I used the correct enemy.
You can try this and see if it works for you.
You have to restructure the quotes in each enemy
I don't know if this is because of TSBS, because without it it still doesn't do the quotes, so something else is wrong, but this works.
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Fix Quote Scan for Bestiary  ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║   Correct failed scan for quotes    ╠════════════════════╣
# ║   with Venka Bestiary issue         ║    17 Sep 2022     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║                                                          ║
# ║ Restructure quotes on enemies to be like this:           ║
# ║                                                          ║
# ║ <quote: 5>                                               ║
# ║ whatever text and as many lines as you want              ║
# ║ <\quote>                                                 ║
# ║                                                          ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Free for all uses in RPG Maker      ║
# ╚═════════════════════════════════════╝

module Venka::Notetag
  Bestiary_Quotes_on = /<quote:\s*(\d+)>/i
  Bestiary_Quotes_off = /<\\quote>/i
end

#==============================================================================
# ■ RPG::Enemy
#==============================================================================
class RPG::Enemy
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_accessor :actor_quotes
  #----------------------------------------------------------------------------
  # ○ new method: load_actor_talk
  #----------------------------------------------------------------------------
  def load_actor_talk
    @quotes = false
    @actor_quotes = []
    @act_id = nil
    self.note.split(/[\r\n]+/).each do |line|
      case line
      when Venka::Notetag::Bestiary_Quotes_on
        @quotes = true
        @act_id = $1.to_i
      when Venka::Notetag::Bestiary_Quotes_off
        @quotes = false
        @act_id = nil
      else
        if @quotes == true
          @actor_quotes[@act_id] ||= []
          @actor_quotes[@act_id] << line
        end
      end
    end
  end
end
I'm not sure, but in the demo you provided the sonic character class has something wrong with it.
I copied the class 8 onto it and then sonic was able to hit enemies, before he always missed.

As for the quotes, I did some print testing and the quotes were not coming up for me at all.
The system was not finding the quotes in the enemy notebox to match the script settings. Yet if I test it on Rubular it works fine.
I also got mixed up for a while as I was making changes to enemy 3 Motobot, but the battle uses enemy 10 Motobot.
I had come up with this which was getting the quotes and saving it to the enemy quotes, but I didn't see the output until I used the correct enemy.
You can try this and see if it works for you.
You have to restructure the quotes in each enemy
I don't know if this is because of TSBS, because without it it still doesn't do the quotes, so something else is wrong, but this works.
I made a copy of Motobug to see rather or not if I made a mistake in the quotes, and as you saw it wasn't the problem. I'll see if I can get this script to work..

One hour and 45 minutes later..

Nope. Not working at all. But, and I can't believe I am about to say this, IT'S WORKING NOW! I figured it out but adding your script into the demo, it didn't work, so I removed it and kept messing around the note tags till I had this (and copied it over into my project).

Spoiler: Screenshots
1663442292319.png
1663442326817.png

It appears that the two quotes are shown randomly, but I was am to get both to show after 3 scans. So now the question is, what exactly is it about the note tags that was giving the mistake? As I said I wished the demo had another actor besides just Eric to show us how they work, as Eric being the sole actor to have quotes isn't enough.

As a side note I noticed that after the first scan, the window appears blank until you press a button and also the game still says Fail after said window closes.

EDIT: The 34 in Bestiary_Say is the Motobug's ID over in the demo, but appearntly it doesn't matter so what is Bestiary_Say even supposed to do in the Actor's note tag?
what is Bestiary_Say even supposed to do
I can't find any reference to that in the script anywhere. It may be the first iteration that Venka was doing when making the script, but it's not used anymore.
IT'S WORKING NOW! I figured it out but adding your script into the demo, it didn't work, so I removed it
It's interesting how we get so different results. I figured out why sonic 6 did not do any damage, his attack is wind based.

Everything I did to get that script was because it was not pulling in the quote data at all.
This part of the script
Ruby:
class RPG::Enemy
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_accessor :actor_quotes
  #----------------------------------------------------------------------------
  # ○ new method: load_actor_talk
  #----------------------------------------------------------------------------
  def load_actor_talk
    @actor_quotes = []
    self.note.split(/[\r\n]+/).each do |line|
      case line
      when Venka::Notetag::Bestiary_Quotes
        i = $1.to_i;        quote = $2
        @actor_quotes[i] ||= []
        @actor_quotes[i] << quote
      end
    end
  end
end
when I put inside a print statement for $1 and $2, the console screen was empty.
Which means that all of the lines in the enemy note box did not match the Bestiary_Quote regex line.

So that's why I rewrote it.
But it may not have worked when you added it in if you did not change the note tags like how I described.

Using the demo you provided, it works fine. but the default did not.

Most of this tells me that you have something wrong with your project somewhere.
Corrupted data in the actors or classes or something.

Short of remaking (not copying) all the data in a new project, I can't be sure.
I can't find any reference to that in the script anywhere. It may be the first iteration that Venka was doing when making the script, but it's not used anymore.

It's interesting how we get so different results. I figured out why sonic 6 did not do any damage, his attack is wind based.

Everything I did to get that script was because it was not pulling in the quote data at all.
This part of the script
Ruby:
class RPG::Enemy
  #----------------------------------------------------------------------------
  # ♦ Public Instance Variables
  #----------------------------------------------------------------------------
  attr_accessor :actor_quotes
  #----------------------------------------------------------------------------
  # ○ new method: load_actor_talk
  #----------------------------------------------------------------------------
  def load_actor_talk
    @actor_quotes = []
    self.note.split(/[\r\n]+/).each do |line|
      case line
      when Venka::Notetag::Bestiary_Quotes
        i = $1.to_i;        quote = $2
        @actor_quotes[i] ||= []
        @actor_quotes[i] << quote
      end
    end
  end
end
when I put inside a print statement for $1 and $2, the console screen was empty.
Which means that all of the lines in the enemy note box did not match the Bestiary_Quote regex line.

So that's why I rewrote it.
But it may not have worked when you added it in if you did not change the note tags like how I described.

Using the demo you provided, it works fine. but the default did not.

Most of this tells me that you have something wrong with your project somewhere.
Corrupted data in the actors or classes or something.

Short of remaking (not copying) all the data in a new project, I can't be sure.

Makes sense I suppose. It's very easy to forget to remove or add certain things when there's already so much to do. Speaking of which would it be a good idea, as Theo suggested once, to post another topic with these fixes so people having these problems wont have to read 12 plus pages just to see them?

Wind base? Do you mean Sonic Wind? That should be his only wind based skill so far.

As I said I'm not good at reading or writing scripts, so figuring it out is trail and error. I did make the mistake once to close my laptop while PRG Maker was still opened, which resulted in a crash. Some files were corrupted but I was able to restore everything one at a time.

I'll try your script one more time and see if I can get it to work.

Five minutes later

Good news, I got it to work in the demo. Although 4 scans and only the second quote pops up, so it's either at random or I made a mistake. I'll screenshot the note tag.

Spoiler
1663524234917.png
1663524804658.png

It is in my project, I created a new enemy to test it out and no quotes. I'll have to create a backup and slowly test out every single thing to try and see what's wrong. Thankfully the game is only at %2 ready, so it's not a big lost to start from scratch if it comes to it.

I'm sorry for being such a handful with this, but just know I really do apprentice you helping me.

Quick question. What did you mean by the $1/$2 console screen being empty? If you meant the window with the enemy info, it's only blank for me after the first scan but pressing a button fixes that.
post another topic with these fixes so people having these problems wont have to read 12 plus pages just to see them?
In my opinion it should have been a script support request post. Not tagged onto this thread.
Quick question. What did you mean by the $1/$2 console screen being empty? If you meant the window with the enemy info, it's only blank for me after the first scan but pressing a button fixes that.
If you have the console window open when you play then you can do print statement to see the data as the game processes.
I did print statement for the code that is pulled from the note tags. the default did not show anything.
Mods I tried editing the post above, but when I clicked reply it went to the bottom new entry, didn't catch it.
I'll screenshot the note tag.
Your not using the right script. You changed the code to the other code.
Just use the script posted above not the one below it. That is the default.

Example of console output
New
1663532558421.png

Old
1663532657192.png

Original thread: https://forums.rpgmakerweb.com/threads/bestiary-logbook-v1-8-updated-1-21-2014.32231/