The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX Ace => VXA Scripts Database => Topic started by: modern algebra on February 05, 2012, 12:49:04 AM

Title: [VXA] Monster Catalogue
Post by: modern algebra on February 05, 2012, 12:49:04 AM
Monster Catalogue
Version: 1.1
Author: modern algebra
Date: March 24, 2012

Version History



Description


This script creates a scene that you can call which shows data on any and all monsters you have collected. You can change the exact point at which data will show up. By default, the script will show only ?????? for any monsters not yet fought, but once they are first encountered by the player then the monster's name, battler, and stats will show up. There are options to change that though. For instance, you could make it so that only the monster's name and battler will show up when the monster is encountered, and to show the stats you will need to use a special analyze item, which you can set up in the database by simply putting \analyze in an item or skill's notebox.

Additionally, you can give the enemies species and use different categories to separate them.

Features


Screenshots


(http://img837.imageshack.us/img837/2416/monstercat3.png)
You can select which stats to show and you can also categorize enemies.

Spoiler for More Screenshots:
(http://img259.imageshack.us/img259/4837/monstercat2.png)
A basic setup to show a bat.

(http://img705.imageshack.us/img705/1968/monstercat4.png)
This samples the silhouette feature and the fact that you can remove the description window if you don't want it.

(http://img710.imageshack.us/img710/802/monstercat1.png)
Analyzing a monster during battle.

Instructions

Paste this script into its own slot in the Script Editor, below Materials but above Main.

Please read the header of the script and the comments in the Editable Region for further instructions.

Script


The script is too long to post here. Get it from Pastebin (http://pastebin.com/a7avTgWM).

Addons

DrDhoom has created some neat add-ons to this script which you can find here: http://drd-workshop.blogspot.com/2015/01/modern-algebra-monster-catalogue-add-on.html

All credit for the add-ons should go to DrDhoom.

Credit



Thanks


Support


Please post in this topic at RMRK.net if you need any assistance.

Known Compatibility Issues

Spoiler for Yanfly's Doppelganger[/spoiler:
The scripts are incompatible because Yanfly's script overwrites the class method of Game_Enemy. To fix it, paste the following script into its own slot in the Script Editor, still above Main but below Monster Catalogue.

Code: [Select]
#==============================================================================
#    MA Monster Catalogue + Yanfly's Doppelganger
#      Compatibility Patch
#    Version: 1.0.0
#    Author: modern algebra (rmrk.net)
#    Date: July 25, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Descriptions:
#
#    This fixes an incompatibility between Yanfly's Doppelganger script and
#   my Monster Catalogue.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Paste this script into its own slot in the Script Editor, above Main but
#   below the Monster Catalogue script.
#==============================================================================

#==============================================================================
# ** Window_MonsterCard
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    overwritten method - shown_stats
#==============================================================================

class Window_MonsterCard 
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Showable Stats
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def shown_stats
    stats = (monster.nil? || !show_data?) ? [] : MAMC_CONFIG[:shown_stats].keys
    stats.keep_if { |stat| Game_Enemy.method_defined?(stat) }
    stats
  end
end
Title: Re: Monster Catalogue
Post by: Seiryuki on February 05, 2012, 03:56:06 AM
YES!!!  :gracie: Thank you modern algebra! This is one of the most important scripts I've been waiting patiently for. All that's left for me to get is the Quest Journal.
My game will have hunting as a main side-quest and this script will be a vital aid to the player. I hope this script can handle over 200 monsters in its list ;).

Btw, the silhouette feature is pretty cool.
Title: Re: Monster Catalogue
Post by: pacdiggity on February 05, 2012, 04:08:23 AM
This script can handle any number of monsters ._.
Because it's amazing. Great job, MA.

Out of curiosity, no catalogue base?
Title: Re: Monster Catalogue
Post by: modern algebra on February 05, 2012, 04:59:08 AM
@Seiryuki - I am glad you like it. As Pacman noted, it should work with as many monsters as you like, though depending on how many are in any one category the player may experience a little lag when first entering the scene or switching between categories. If you are getting up to 200, then you might want to make use of the categories to make it easier to navigate.

And thanks for the comment on the silhouette feature; I think it looks kind of pretty too. For large battlers though, make sure to manually make the silhouette graphics you want to show and add them through notetage; it could get pretty laggy otherwise.

@Pacman - Nah, I decided against the Catalogue_Base. Substantively, there isn't a lot necessarily in common between catalogues - it is really only graphical: the scene layout, the category windows, and the list window. However, with the way scenes are designed in VX Ace, I didn't think there was a lot of added value - all it would really do is put artificial limitations on the graphical design of the other scripts. At least, that's what I told myself. I was probably just being lazy.
Title: Re: Monster Catalogue
Post by: pacdiggity on February 05, 2012, 05:18:29 AM
I understand completely.
There were only like two or three VX catalogue scripts though, so it wasn't all that important anyway. But VXA opens up a lot of new opportunities for much easier catalogue scripts, as pretty much everything in the database is a child of RPG::BaseItem. So you could have things like Actor and Class catalogues. Yay!
Title: Re: Monster Catalogue
Post by: AlexArmstrong on February 06, 2012, 01:46:54 PM
Bestiary! I like this type of scripts. And I am very picky about this, actually.
I really like species, categories and silhouette features!)
What about item drop? Element/State efficiency? Habitat (maps names, where monster can be encountered)? I think, it's most important then even stats, because some (lesser part?) players don't want to look at numeric values other then HP/MP and, maybe, CRI/EVA (well, in this script stats has good customization).
I don't test description part very well yet... It looks short >< I like big descriptions. Anyway, there is also possibly to write elements/habitat/drops in description page...
Oh, sorry, too much babble. First reason I came here:
Monster Catalogue, string 436
NoMethodError undefined method '[]' for nil:NilClass
It's with # Species Icon. I have 8 species. #8 is Insects.
:show_monster_icon => true
:inherit_species_icon => true
In Enemy notetag I place \species[8] (oh, in comment on string 199 \species_id[n] it's wrong and not works).
Well, somehow species icon always come from next species! Example: if enemy notetag \species[7] (Aquatic) then in catalogue it show icon for 8 (Insects). I have only 8 species, and if \species[8], I have an error...
Title: Re: Monster Catalogue
Post by: modern algebra on February 06, 2012, 09:23:16 PM
Ah, thanks for reporting that error. To fix it, go to the identified line and you will see:

Code: [Select]
def icon_index(*args, &block)
    if !@mamc_icon_index
      @mamc_icon_index = super(*args, &block)
      if note[/\\ICON\[\s*(\d+)\s*\]/i]
        @mamc_icon_index = $1.to_i
      elsif MAMC_CONFIG[:inherit_species_icon]
        # Species Icon
        @mamc_icon_index = MAMC_CONFIG[:species][species_id][0]
      end
      @mamc_icon_index = 0 unless @mamc_icon_index.is_a?(Integer)
    end
    @mamc_icon_index
  end

Change it to:

Code: [Select]
def icon_index(*args, &block)
    if !@mamc_icon_index
      @mamc_icon_index = super(*args, &block)
      if note[/\\ICON\[\s*(\d+)\s*\]/i]
        @mamc_icon_index = $1.to_i
      elsif MAMC_CONFIG[:inherit_species_icon]
        # Species Icon
        @mamc_icon_index = MAMC_CONFIG[:species][species_id - 1][0]
      end
      @mamc_icon_index = 0 unless @mamc_icon_index.is_a?(Integer)
    end
    @mamc_icon_index
  end

Additionally, you will need to go down to around line 1100, where you will see this:

Code: [Select]
  def draw_species(x, y)
    return if monster.enemy.species_id < 1
    return if MAMC_CONFIG[:species][monster.enemy.species_id].nil?
    icon_index, species_name = *MAMC_CONFIG[:species][monster.enemy.species_id - 1]
    draw_icon(icon_index, x, y)
    change_color(text_color(MAMC_CONFIG[:species_colour]))
    draw_text(x + 24, y, contents_width - x*2, line_height, species_name)
  end

Change it to:

Code: [Select]
  def draw_species(x, y)
    return if monster.enemy.species_id < 1
    return if MAMC_CONFIG[:species][monster.enemy.species_id - 1].nil?
    icon_index, species_name = *MAMC_CONFIG[:species][monster.enemy.species_id - 1]
    draw_icon(icon_index, x, y)
    change_color(text_color(MAMC_CONFIG[:species_colour]))
    draw_text(x + 24, y, contents_width - x*2, line_height, species_name)
  end


As for the suggested features: I don't disagree that they would be cool, but my intention with this script was to keep it basic; there is not a whole lot of room to draw data on the window. Just to add the Item Drops would be another 4 lines, and then there would be compatibility issues with scripts like my Item Drop Ranks (http://rmrk.net/index.php/topic,44931.0.html) or Drop Options (http://rmrk.net/index.php/topic,44618.0.html). Additionally, as you mentioned, you can always put that data in the Description window as well, though that is not really ideal since it would look weird.

As for the description window, however, you can change its size by going to around line 270, where you will see:

Code: [Select]
  # :desc_window_lines - This allows you to choose how many lines will fit in
  #    the help window. If set to 0, there will be no help window to show
  #    description.
  :desc_window_lines => 2,

Just change the 2 to however many lines you want, and the window will grow accordingly. Additionally, it might be worth noting that a number of the default codes that work in messages, such as \c[n] or \v[n] will also work in the description window. If you use my ATS: SMC (http://rmrk.net/index.php/topic,44527.0.html), then most of those special message codes will also work.
Title: Re: Monster Catalogue
Post by: modern algebra on February 08, 2012, 02:19:05 AM
This script is updated as there was another bug. Thanks to protractor for discovering it and bringing it to my attention.
Title: Re: Monster Catalogue
Post by: Woogimember on February 17, 2012, 10:44:21 PM
Thanks for making this, it's awesome.
P.S. I'm new here.
Title: Re: Monster Catalogue
Post by: AlexArmstrong on February 19, 2012, 11:07:32 AM
I think, I found another bug. Hidden enemies again.
When party run away (Escape) from battle, hidden enemies suddenly appear, and after that you can see them in Monster Catalogue. After victory in battle, even if hidden enemy didn't show up, you also can see it in Monster Catalogue as "encountered".
Title: Re: Monster Catalogue
Post by: modern algebra on February 19, 2012, 02:45:50 PM
The enemy appearing when escaping happens with or without the monster catalogue and has nothing to do with this script. I can write a fix for it, but I wouldn't connect it with this script.

However, I can modify the script so that hidden enemies at the end of battle are not added to the encounter array. That's done - you can get the new script either from the .rb document attached at the bottom of the first post or from Pastebin.
Title: Re: Monster Catalogue
Post by: AlexArmstrong on February 19, 2012, 05:25:14 PM
Sorry, I didn't know about that until today. Usually, I place hidden monsters in boss battles, and player can't escape from the boss battle.
Thanks a lot!
Title: Re: Monster Catalogue
Post by: modern algebra on February 19, 2012, 05:33:19 PM
Thanks for the bug report.
Title: Re: Monster Catalogue
Post by: Understatement on March 18, 2012, 10:17:39 AM
I hope I'm not breaking any rules posting in this (necro post?), I don't know where to add in Monster descriptions.. I know it's \desc but where to put/type it? Also I know it's monsters, but if you feel like making like a character catalogue (like info on protagonists, antagonists, npcs you meet), would it work in the same way with some configuration? Thankyou.
Title: Re: Monster Catalogue
Post by: pacdiggity on March 18, 2012, 11:39:39 AM
It goes in the enemy's notebox, in the lower-left hand corner of the enemy's tab in the database.
Title: Re: Monster Catalogue
Post by: zhein04 on March 23, 2012, 02:20:12 PM
Is it possible to add a feature which shows what the monster drops?

Hi,
 zhein04
Title: Re: Monster Catalogue
Post by: modern algebra on March 24, 2012, 02:38:31 PM
It would be possible, but I do not intend to add it. This is meant to be a very basic representation of enemies.
Title: Re: Monster Catalogue
Post by: Tenbed on March 28, 2012, 09:39:17 PM
I've tried adding a description to monsters and I'm not sure I'm doing this right. The instructions state that I need to put \desc into the notes section of the monster tab. I've tried and it doesn't seem to be coming up. I've tried to enter it as:

\desc {Slime is weak}
\desc [Slime is weak]
\desc Slime is weak

None show anything in the catalog window. There's something I'm doing wrong, I just don't know what it is.
Title: Re: Monster Catalogue
Post by: pacdiggity on March 28, 2012, 09:44:08 PM
Without looking at the script, and considering how predictable MA's REGEXP's are (:P) I'd assume that the problem is that there should be no space between \desc and [.
\desc[Slime is weak]
Title: Re: Monster Catalogue
Post by: Tenbed on March 28, 2012, 09:51:07 PM
That did it. Thank you. I'll have to remember that little detail.
Title: Re: Monster Catalogue
Post by: Trihan on April 03, 2012, 08:19:53 PM
Modern Algebra, first of all congratulations on an awesome script. I have a question about it if you don't mind.

I was looking at your code to improve my own understanding of RGSS3, because I was planning on doing something similar (a dynamic bestiary that estimates enemy stats as you fight them) and wanted to see how other people implemented this sort of system.

Now I know roughly what *args and &block are for in a Ruby context, but considering your script works without those parts I'm not sure why you added them. Can you explain their function to me please?

Edit: Upon closer inspection, "super" calls the closest inherited method with the same name. However, in your "description" and "icon_index" methods, there is literally no other inherited method with that name. Am I wrong in thinking that the arguments and call to super for those two don't actually do anything?
Title: Re: Monster Catalogue
Post by: modern algebra on April 03, 2012, 10:44:50 PM
I use *args and &block on methods that expect neither arguments nor a block as a compatibility measure. It is a paranoid way to accomodate for unexpected alterations to the method that change what a method expects. Take, for instance, the following default method in Window_Gold:

Code: [Select]
  def initialize
    super(0, 0, window_width, fitting_height(1))
    refresh
  end

Let's say someone else comes along and says that for her scene, she actually wants Window_Gold to be in the bottom right corner, not the upper left. Naturally, she could do this in smarter ways, but she decides that to do it, she will simply change the initialize method of Window_Gold to accept x and y as arguments. She does so like this:

Code: [Select]
class Window_Gold
  alias she_newscene_init_2ak1 initialize
  def initialize(x = 0, y = 0)
    she_newscene_init_2ak1
    self.x = x
    self.y = y
  end
end

Then, in her scene, she simply creates the window with:

Code: [Select]
  @gold_window = Window_Gold.new(Graphics.width - 160, Graphics.height - 48)


OK, that's all fine - there will be no errors and her edit will work for her scene.

Now, let's say I come along and decide that for whatever reason, I am adding an instance variable to Window_Gold and I want to give it an initial value in the initialize method. So I do this:

Code: [Select]
class Window_Gold
  alias ma_myvariable_init_8jh2 initialize
  def initialize
    ma_myvariable_init_8jh2
    @my_variable = 0
  end
end

Let's now say someone wants to use both our scripts and he places my script below her script. What's going to happen? When he opens her scene, he's going to get an argument error at her line:

Code: [Select]
  @gold_window = Window_Gold.new(Graphics.width - 160, Graphics.height - 48)

He's going to get that error because my script overwrites the initialize method so that it does not expect any arguments, and her script is trying to pass arguments to a method which doesn't expect them.

If I had done this instead:

Code: [Select]
class Window_Gold
  attr_accessor :my_variable
  alias ma_myvariable_init_8jh2 initialize
  def initialize(*args)
    ma_myvariable_init_8jh2(*args)
    @my_variable = 0
  end
end

then our scripts would be immediately compatible.

Naturally, that error also would not have happened if my script had been above hers, but it is wrong to expect script users to intuit script order and, in any case, I usually instruct people to put my scripts below other custom scripts since I do alias and I know other scripters do not.

It also would not have happened if the other scripter had chosen to accomplish her goal through means which did not involve passing arguments to the initialize method, but I don't think it's a good idea to rely on the other scripter for compatibility and do nothing yourself.

I use &block for the same reason, though I must admit that while I have seen people change the expected arguments for incomprehensible reasons, I have never seen someone modify a method so that it requires a block. Still, I am a slave to paranoia, and I think that's a prudent approach when you consider the patchwork nature by which RM users collect their scripts.

For compatibility reasons then, I always use (*args, &block). I also don't think it's a good idea to change the expected input or output of a default method as my hypothetical counterpart did, but I know that some scripters do that. There might be some occasions where it's necessary or helpful, but I can't think of any off the top of my head.


With respect to your other question, there are indeed inherited methods with that name. RPG::Enemy is a subclass of RPG::BaseItem. You are right that they don't do anything by default, but they do do something if RPG::BaseItem is modified in such a way that something besides the expected "" and 0 are yielded.

The reason was

For added compatibility, I probably should have aliased those methods as well instead of relying on super as I would that way capture any other scripts which changed those methods inside RPG::Enemy itself.

Alternatively, I shouldn't have used them at all since it could lead to incompatibility if description yielded anything other than a "" or icon_index yielded anything other than 0. If they were the wrong type of object altogether, then I would get errors when I tried to draw them, and if they were such that they would only make sense in the subclasses of RPG::BaseItem that use those variables by default then they might seem out of place.

Aliasing would probably have been better than a straight overwrite and either one of those would likely have been smarter than simply calling the super method, but hey, live and learn. In answer to your question though, they are inherited methods and I did it for compatibility reasons, just not well thought out ones.
Title: Re: Monster Catalogue
Post by: Lethrface on April 03, 2012, 10:47:22 PM
lmao you accomplished something with this that i tried to accomplish previously myself.  I'm slightly jealous :P  good job lol
Title: Re: Monster Catalogue
Post by: modern algebra on April 03, 2012, 11:04:23 PM
Without looking at the script, and considering how predictable MA's REGEXP's are (:P) I'd assume that the problem is that there should be no space between \desc and [.
\desc[Slime is weak]

\desc{Slime is weak} actually, in order to accomodate for message codes. Who's predictable now biatch!

I like that style though - mimics the default message codes more closely. Sadly, Yanfly-style < : > notetags seem to have won the Great Notetag War of '09, but I like my way better.

lmao you accomplished something with this that i tried to accomplish previously myself.  I'm slightly jealous :P  good job lol

Thanks!
Title: Re: Monster Catalogue
Post by: Lethrface on April 03, 2012, 11:21:46 PM
I've gotta admit, Yanfly's seems to make it seem more organized on occasions but I do like the old message style tags.  It requires less finger movement and feels more natural for me, especially since when I started learning to type, I've always used the right shift key out of habit.  Considering the brackets are all on the same side as the shift key I use, it makes it easier to do things like the classic message code style.
Title: Re: Monster Catalogue
Post by: Trihan on April 03, 2012, 11:22:15 PM
Thanks for the explanation! That's actually kind of what I thought it was there for, so it's good to know I'm not completely insane. I actually completely follow your logic for doing that, as it's true that different scripters have different approaches.

While I have your attention, could you possibly point me in the right direction on something I'm trying to do for my own bestiary?

Being dynamic, the entries for stats will be approximated based on actions taken in battle. I will, therefore, obviously have to have an approximate counterpart for each stat that will be displayed unless an enemy is "scanned".

Say I decide to store said stats in Game_System::Bestiary::Entry.

In the initialize method for Game_System::Bestiary, could I do something along the lines of

$data_enemies.each { |enemy| $data_bestiary[enemy.id] = Game_System::Bestiary::Entry.new }

Would that work or am I barking up entirely the wrong tree?
Title: Re: Monster Catalogue
Post by: modern algebra on April 03, 2012, 11:41:51 PM
No, not really. Even assuming that $data_bestiary was a hash and you saved $data_bestiary to the save file, using enemy objects as your keys would be unwise since they are created anew each time and so the enemy object for enemy 1 will be different the next time you open the game. As such, it couldn't serve as a reference to your class. Plus it uses a lot more memory than is necessary. It would be smarter just to use an array and use enemy.id, though you would naturally need to exclude the nil element of $data_enemies when setting it.

Additionally, I think that it might be more prudent to simply create a wrapper class for the array (like Game_Variables) and lazily instantiate the bestiary entries when appropriate, rather than creating them all once. It will save memory and is better for testing since it won't be corrupted every time you edit the enemies tab.

You could make it an instance variable of Game_System or some other Game_ class if you did not want to have to get into DataManager, but I think this is something where it would be appropriate to give it its own global variable. However, I wouldn't call your global variable $data_bestiary, since $data_ variables are all saved as .rv2 files and initialized anew whenever the game is started. Your variable needs to be saved in the save file. The name has no inherent value, naturally, but your variable is unlike every other $data_ variable and so it makes your code confusing to a reader.

Secondly, I don't know if there's much utility to placing your Bestiary module or class inside Game_System, and I would advise removing it as it is also a confusing class structure.

Entry could be a Struct.

That's probably a fairly obtuse block of text, but I can show you what I mean in code if you want.
Title: Re: Monster Catalogue
Post by: Trihan on April 03, 2012, 11:47:48 PM
I got a friend to help me out with the structure and took your suggestions on board; this is what I came up with.

class Game_Bestiary
  def initialize
    @entries = []
    $data_enemies.each { |enemy|
      @entries.push(Game_Bestiary::Entry.new($data_enemies.index(enemy));
    }
  end
end

class Game_Bestiary::Entry
  def initialize(enemy_id)
    @enemy_id = enemy_id
    @param = Array.new(8, {:HIGH => 0, :LOW => 0})
  end
  def set_low_param(param_id, value = 0)
    @param[param_id][:LOW] = value
  end
  def set_high_param(param_id, value = 0)
    @param[param_id][:HIGH] = value
  end
 
  def low_param(param_id)
    @param[param_id][:LOW]
  end
  def high_param(param_id)
    @param[param_id][:HIGH]
  end
end

Then I would overload DataManager to create a $game_bestiary global variable.
Title: Re: Monster Catalogue
Post by: modern algebra on April 04, 2012, 12:11:02 AM
That looks fine and should work.

Code: [Select]
    for i in 0...$data_enemies.size do @entries.push(Entry.new(i)) end

That's fine (though it doesn't look like you have a way to access @entries from outside the class?), but what I was talking about when I said wrapper was:

Code: [Select]
class Game_Bestiary
  def initialize
    @data = []
  end
  def [](enemy_id)
    @data[enemy_id] = Entry.new if !@data[enemy_id]
    @data[enemy_id]
  end
  def []=(enemy_id, value)
    @data[enemy_id] = value if value.is_a?(Entry)
    self[enemy_id]
  end
end

Also, I generally don't like embedding classes within classes, but it is sensible enough in this circumstance. I might have used a Struct for Entry and probably just used ranges (http://www.ruby-doc.org/core-1.9.3/Range.html) instead of the hashes, but those are mostly just preference and convenience. You likely wouldn't need many of the methods in Range anyway.
Title: Re: Monster Catalogue
Post by: Trihan on April 04, 2012, 10:20:57 AM
Okay, I've got the data structure implemented and working...the only hurdle I have left is that I can't quite figure out how to link up the monster card window and the list. I didn't implement the plethora of options you included (not yet at least) so I'm having some trouble following the path of your code. :P

Edit: Never mind, think I've got it sussed. :D

Edit 2: Sort of. I've implemented the Entry structure I mentioned, but when I do $game_bestiary[id].set_low_param(parameter id, value) for some reason it changes the value of every element in the array.

Edit 3: Fixed! The way the hash was set up it was only creating one instance of the object. Making it a Hash.new outside of the array made it work.
Title: Re: Monster Catalogue
Post by: pacdiggity on April 11, 2012, 03:07:54 PM
MA, I don't mean to bother you with such menial trivialities, but this is one of the most complicated scripts I've ever seen, and I've seen some... pretty strange ones. There are a lot of techniques you've used in this script that I'm not used to, and can't read into quite as clearly. Would you be so kind as to tell me the simplest way to tell if an enemy has been scanned, or just confirm my suspicion that it's in Game_System#mamc_analyze_ary ?
Thanks in advance.
Title: Re: Monster Catalogue
Post by: Trihan on April 11, 2012, 03:13:33 PM
Hope you don't mind me fielding this one MA, but you're right Pacman; mamc_analyze_ary is the array that contains which monsters you've scanned.

Edit: I was also quite confused by his method...method, but on reflection it's actually an incredibly clever way to avoid doubling up on code for methods that do pretty much the same thing but need to be separated.
Title: Re: Monster Catalogue
Post by: pacdiggity on April 11, 2012, 03:15:18 PM
Thank you for confirming that. Would I check this by using:
Code: [Select]
if $game_system.mamc_analyze_ary[enemy.id]
  # do stuff that happens when only the enemy is scanned
else
  # do other stuff
end

Thank you again.
Title: Re: Monster Catalogue
Post by: Trihan on April 11, 2012, 03:30:23 PM
Just to be on the safe side I'd use

Code: [Select]
if $game_system.mamc_analyze_ary.include?(enemy.id)
  # do stuff that happens when only the enemy is scanned
else
  # do other stuff
end

But other than that, spot on.
Title: Re: Monster Catalogue
Post by: Trihan on April 11, 2012, 04:40:59 PM
While I think about it, you've just reminded me of something.

MA, you didn't specify a terms of use agreement in your script comments, and I've been borrowing pretty heavily from this system for my own dynamic bestiary (though I haven't really outright stolen anything it's been a big inspiration and I think I'd be remiss if I didn't include the species/category options). Is my project alright with you or would you prefer I didn't modify anything directly from this script?

Edit: I should point out that I know the general terms of use but I'd intended to publish my bestiary separately when I finish it, crediting you for the inspiration and for anything I use directly that I didn't edit or repurpose.
Title: Re: Monster Catalogue
Post by: modern algebra on April 11, 2012, 05:34:33 PM
Yeah, I just rely on the General Terms of Use. And yes, it's totally fine with me if you release your bestiary publically.

And yeah, Trihan is right Pacman. The way that array works is that the IDs of any analyzed monsters are added to it, so it would be something like [1, 3, 7] if monster 1, 3, and 7 are analyzed. So, checking array[7] wouldn't reveal whether monster 7 is analyzed - you need to check whether the ID is included in the array.

An alternative way to do it would be:

Code: [Select]
$game_system.mamc_data_conditions_met?(:analyze, enemy_id)

But that's just an indirect way of doing the same thing.

Sorry that my coding is hard to understand :(
Title: Re: Monster Catalogue
Post by: Trihan on April 11, 2012, 06:12:01 PM
I was going to suggest using conditions_met? but thought it relied on a constant. I didn't notice that you supply the condition as a parameter. XD derp!

Also, thanks for confirming that you're cool with me releasing my bestiary. I'm super happy with how it's coming along so far!

So happy in fact, that I'd like you to have this complimentary screenshot.
(http://rpgmaker.net/media/content/users/96/locker/bestiary4.png)
Title: Re: Monster Catalogue
Post by: pacdiggity on April 12, 2012, 02:15:11 AM
Sorry that my coding is hard to understand :(
Not your fault, I should've realised that.
Title: Re: Monster Catalogue
Post by: jwei44 on April 28, 2012, 01:39:43 AM
Is it just me, or does this script crash battle test?
Title: Re: Monster Catalogue
Post by: modern algebra on April 28, 2012, 01:48:27 AM
It doesn't crash during battle test to me, so I don't know.

If you could recreate the error in a new project and send it to me though, I would be happy to take a look.
Title: Re: Monster Catalogue
Post by: jwei44 on April 28, 2012, 01:53:44 AM
It doesn't crash during battle test to me, so I don't know.

If you could recreate the error in a new project and send it to me though, I would be happy to take a look.

Alright, no crash here. I'll try and find a conflicting script. In the mean time, this is the error:
(http://i50.tinypic.com/bc0p1.png)


Found the conflicting script: Yanfly Engine Doppelganger  (http://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/enemy-levels/doppelganger/)
Title: Re: Monster Catalogue
Post by: modern algebra on April 28, 2012, 02:47:39 AM
Alright, I know what is causing the error. All Objects have a class method which normally returns the class of the object. So the class method of an instance of Game_Enemy would normally return Game_Enemy, and that is what I expected to be returned when I did that check. Yanfly's script overwrites the class method in Game_Enemy and has it instead return the database class of the doppelganger actor.

The easiest fix would just be to go into my script at line 1355 and change:

Code: [Select]

        if enemy.class.method_defined?(:mamc_analyze_now) && enemy.mamc_analyze_now

to:

Code: [Select]

        if enemy.is_a?(Game_Enemy) && enemy.mamc_analyze_now
Title: Re: Monster Catalogue
Post by: jwei44 on April 28, 2012, 02:54:37 AM
Alright, I know what is causing the error...

Alright, thanks! Hopefully soon I understand what you said as I am in the process of learning Ruby.
Title: Re: Monster Catalogue
Post by: Acezon on May 08, 2012, 03:27:46 AM
Is it possible to put the monster's sprite beside its illustration? Or just the sprite? I can't seem to find that part in the script, sorry. :)
Title: Re: Monster Catalogue
Post by: modern algebra on May 08, 2012, 04:49:46 AM
No, since monsters don't have sprites by default in RMVXA. How would you want to be able to specify what sprite to show?
Title: Re: Monster Catalogue
Post by: Acezon on May 08, 2012, 11:16:52 AM
No, since monsters don't have sprites by default in RMVXA. How would you want to be able to specify what sprite to show?

I think I'll just use its front pose as the battler. That way the script shows the sprite. Thanks for the help!
Title: Re: Monster Catalogue
Post by: Wiimeiser on June 14, 2012, 03:48:27 AM
Do you know what's causing this error? If it's not the same as before than I assume it's JP or something (hence the filename...)

If it helps, it happens when I highlight an enemy I've seen...
Title: Re: Monster Catalogue
Post by: modern algebra on June 16, 2012, 12:17:01 AM
What other scripts are you using? Would it be possible for you to recreate the error in a new project and show me?
Title: Re: Monster Catalogue
Post by: Wiimeiser on June 16, 2012, 07:54:23 AM
I'm assuming it's a conflict with enemy levels or doppelganger as before, or else the result of a new stat being added...
I'll probably upload a test project when I get around to it.
Title: Re: Monster Catalogue
Post by: Wiimeiser on June 19, 2012, 03:42:40 AM
Okay, here's a project. Fiddle around a bit. Seems to occur when displaying the stats, not the battler.
Title: Re: Monster Catalogue
Post by: pacdiggity on June 21, 2012, 07:48:24 AM
Great Notetag War of '09

Had I been around I would've been with you every step of the way. \thing[numbers] always seems to be easier to me, and I find it easier to write out /\\thing\[(\d+)\]/i than... I can't even remember how to do Yanfly-style tags. MA-style has always made more sense to me  ;D
Title: Re: Monster Catalogue
Post by: whitedahlia on June 22, 2012, 11:15:15 PM
Is there anyway to show the description when you analyze them in battle?
Title: Re: Monster Catalogue
Post by: Wiimeiser on June 28, 2012, 05:27:10 AM
Still waiting on feedback regarding the test project I uploaded. You might want to add scrolling between levels/difficulties.
Title: Re: Monster Catalogue
Post by: Wiimeiser on July 04, 2012, 01:56:03 AM
Still waiting...
Title: Re: Monster Catalogue
Post by: Wiimeiser on July 05, 2012, 12:10:42 PM
Should I just remove Yanfly's two scripts and use an overly complex series of events to achieve a similar but less satisfying result? Or should I remove this script and use Scan for YEA- Show Target Info or just remove the skill entirely?(Not actually remove, but make Rayna unable to learn it)
Title: Re: Monster Catalogue
Post by: modern algebra on July 05, 2012, 12:54:57 PM
I'll try to get to look at it today or tomorrow.
Title: Re: Monster Catalogue
Post by: Wiimeiser on July 15, 2012, 04:08:06 AM
So, how's progress? I noticed you were offline for sometime...
Title: Re: Monster Catalogue
Post by: Wiimeiser on July 25, 2012, 07:42:22 AM
Since I haven't been getting much help with this I've decided to remove this script from my game. I will, by extension, remove the three script calls using it (two in the test room and one in a library) and dummy out the "Scan" skill that would've analysed monsters. I'm not doing it tonight, I'll do it when I get around to it.

In hindsight, maybe I shouldn't have made the test project's default font Wingdings...


EDIT: Dummied the script out (it's there but inaccessible) and the skill. Also made a new test project and uploaded two versions, with and without Doppelganger. I haven't tested them yet but I doubt anything will be different.
Title: Re: Monster Catalogue
Post by: modern algebra on July 25, 2012, 01:46:02 PM
OK, well normally there is a class method which returns the class of an object in Ruby. Borrowing from the way the default scripts setup actors, Yanfly overwrites the class method of Game_Enemy to instead return the RPG::Class object of a monster, which would be nil for a regular monster and the actor's class for a doppleganger. This was a problem because I was using monster.class instead of simply Game_Enemy to account for the possibility that another script could make enemies of a different (RGSS3) class.

Anyway, paste the following into a new slot anywhere above Main and below the Monster Catalogue and it should fix the problem:

Code: [Select]
#==============================================================================
#    MA Monster Catalogue + Yanfly's Doppelganger
#      Compatibility Patch
#    Version: 1.0.0
#    Author: modern algebra (rmrk.net)
#    Date: July 25, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Descriptions:
#
#    This fixes an incompatibility between Yanfly's Doppelganger script and
#   my Monster Catalogue.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Paste this script into its own slot in the Script Editor, above Main but
#   below the Monster Catalogue script.
#==============================================================================

#==============================================================================
# ** Window_MonsterCard
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    overwritten method - shown_stats
#==============================================================================

class Window_MonsterCard 
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Showable Stats
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def shown_stats
    stats = (monster.nil? || !show_data?) ? [] : MAMC_CONFIG[:shown_stats].keys
    stats.keep_if { |stat| Game_Enemy.method_defined?(stat) }
    stats
  end
end

Sorry that I took such a long time to look into it. I was really uninterested in RM for the past few months and only just recently decided to return to it.
Title: Re: Monster Catalogue
Post by: Wiimeiser on July 26, 2012, 02:18:57 AM
Thanks, that worked. I had to reinstate Scan's functionality (but all I did was delete the notebox data) and the script call in the test room (I only deleted one). I'll use the one in the library for something else, like analyzing past bosses or something (like the bin in Paper Mario: The Thousand Year Door)
Title: Re: Monster Catalogue
Post by: lostboyrufio on July 26, 2012, 09:57:49 AM
Hi MA, I've come across a bug recently and I'm not sure as to why. I tried using your script on my current project as well as on a clean one with no other scripts. I get a syntax error in line 1076 on both projects:

unexpected tLBRACK, expecting ')'
[:frame_shadow_colour]))

I've tried going through to see if there was a typo anywhere within the few lines surrounding this one, or if there was a missing ) after a line but I couldn't find anything. I tried commenting the line out but then the error just continues to move downwards. I copied the script directly from your Pastebin link. If you could help it would be much appreciated.
Title: Re: Monster Catalogue
Post by: modern algebra on July 26, 2012, 03:40:18 PM
I am not receiving that error, sorry. Also, that's not line 1076 in the pastebin script. Are you sure you correctly copied the script off pastebin? Try downloading it off pastebin and then select all in the txt file that is produced.

If that doesn't work, I will need you to share a demo with the error since I cannot reproduce the error.
Title: Re: Monster Catalogue
Post by: lostboyrufio on July 27, 2012, 05:05:25 AM
Aha! Of course it would end up being something as simple as clicking the pasteboard icon to copy it. I just copied it straight from the doc at the bottom of the page before. Now I feel stupid, but thanks for pointing out the obvious!
Title: Re: Monster Catalogue
Post by: Chansel on August 24, 2012, 01:43:47 PM
Hi there!
This script does almost exactly what I want, with one small detail missing: would it be possible to show the 'rates' (Element Rate, Debuff Rate, State Rate, State Resist) if the enemy has any? Perhaps in a second screen that you get by pressing the action button a second time?
If not (which I would understand, because I feel like this is a rather large request), would it be possible to show the description when using the 'analyze' skill? That way it's possible to write the rates there :)
Title: Re: Monster Catalogue
Post by: WCouillard on November 28, 2012, 10:01:23 PM
Awesome script. A few issues and questions, though.

I use this script ONLY for the \analyze aspect of using a skill or item to scan an enemy.

The only error I've come across is when changing what stats are shown. In my project, the Luck stat represents the Level of the enemy, so when I changed "Vocab.param(7)", to "Level", the script would crash citing an uninitialized constant. Not a big deal, I just made it so the Level (Luck) wasn't shown. But if there could be a fix for that, it'd be awesome.

Is there a way to completely remove the border around the text in the window when using an analyze skill. The information is already contained within a window, so it looks kind of weird to me.

For species, I think it should be possible to add more than one species to an enemy, for when you have enemies that are, let's say, made of fire and can fly.

Then you could have something like:

Fire Demon
Flying

Letting the player know to use weapons or skills that have increased effectiveness against flying enemies, etc. Currently, the script only displays one species for an enemy.

That's all for now. Great work on this script!
Title: Re: Monster Catalogue
Post by: modern algebra on November 29, 2012, 01:17:52 AM
Well, for the LUK crash, you need to remove the colon. So, currently it is:

Code: [Select]
    :luk  => :"Vocab.param(7)",

What you did is change it to:

Code: [Select]
    :luk  => :"Level",

But that is wrong. You need to delete the colon before "Level", so that it is this:

Code: [Select]
    :luk  => "Level",

Alternately, you could have just changed the term for Luck in the database.

As for multiple species, you are right that would be a good feature to add and it wouldn't be overly difficult to do, but I don't intend to return to this script at this time. I don't have much time for RM these days, and I have several prior commitments.
Title: Re: Monster Catalogue
Post by: Lord Arkausey on December 01, 2012, 04:56:17 PM
How can I add this to the PAC Main Menu Ace script? When I use this script with Pacman's it gives me an error. It would be nice if I could add the monster catalogue to his menu.

PS: I'm also using Pacman's Menu Compact Display Addon.
Title: Re: Monster Catalogue
Post by: bluntsword on December 01, 2012, 05:11:16 PM
If you can show him what the error message is or looks like, he may be able to give you a little more help bud.
Title: Re: Monster Catalogue
Post by: Lord Arkausey on December 01, 2012, 05:54:30 PM
Here:
(http://img86.xooimage.com/files/e/8/a/error_pacmenu-3a040b5.png)

I hope you can help  :)

Bye
Title: Re: Monster Catalogue
Post by: pacdiggity on December 01, 2012, 10:49:29 PM
Can you show me your setup for the main menu?

Also I was definitely about to say what Modern Algebra says in the next post.
Title: Re: Monster Catalogue
Post by: modern algebra on December 01, 2012, 11:41:08 PM
I think the problem is with the way my script automatically inserts commands into the menu. It is intended to bypass any custom scripts and add it directly, but it runs into a problem where your script relies on there being an entry in your COMMANDS array to show an icon. As such, he needs to turn off the automatic adding in my script, but once he does that there is no longer any method to call the scene, since that method relies on it going into an array in my script.

Anyway, what you need to do is all of the following. First, go into my script. Around line 211, you should see:

Code: [Select]
  # :menu_access - This value determines whether the Bestiary is accessible
  #    from a command in the menu. If true, then it is. If false, it isn't.
  :menu_access => true,

Change that to false:

Code: [Select]
  # :menu_access - This value determines whether the Bestiary is accessible
  #    from a command in the menu. If true, then it is. If false, it isn't.
  :menu_access => false,

Next, insert the following code into its own slot above Main but below Materials:

Code: [Select]
#==============================================================================
# ** Scene_Menu
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method -
#==============================================================================

class Scene_Menu
  def mamcpmm_bestiary_command
    SceneManager.call(Scene_MonsterCatalogue)
  end
end

Next, you need to add the following setup in the PAC Main Menu configuration, wherever you want it to show up:

Code: [Select]
  #----------
    ["Bestiary",
    'mamcpmm_bestiary_command',
    335,
    'true'],

You can name it whatever you want and change the icon as well, naturally.
Title: Re: Monster Catalogue
Post by: Lord Arkausey on December 02, 2012, 08:31:34 AM
Thank you, MA! It works perfectly!

But can I do the same thing with your Quest Log?
Title: Re: Monster Catalogue
Post by: modern algebra on December 02, 2012, 01:48:27 PM
Yeah, pretty well. You will need to add a different method to Scene_Menu, like this:

Code: [Select]

  def maqjpmm_quest_command
    SceneManager.call(Scene_Quest)
  end

And in Pacman's configuration you would need to use that method name. Otherwise it's the same once you turn off :menu_access in the Quest Journal.
Title: Re: Monster Catalogue
Post by: Lord Arkausey on December 09, 2012, 09:42:55 AM
Thanks a lot, MA! It works! :D
Title: Re: Monster Catalogue
Post by: schmacht on December 23, 2012, 11:35:10 AM
Hi all,
first of all: sorry for bad english ;-)

I want to use your script in my game. When I open the window from menu, everything works.
But when I start a battle, and your script should caputre the monster information, i become the follow error:
Quote
Script 'Monster Catalogue 1.1' line 1354: NoMethodError occured.
undefined method 'method_defined?' for nil:NilClass

HELP PLEASE ;-)
Title: Re: Monster Catalogue
Post by: modern algebra on December 24, 2012, 03:37:18 PM
It's an incompatibility with another script - a Yanfly script I believe and probably one that has something to do with classes. It can be fixed by going to that line and replacing:

Code: [Select]
       if enemy.class.method_defined?(:mamc_analyze_now) && enemy.mamc_analyze_now

with:

Code: [Select]
       if Game_Enemy.method_defined?(:mamc_analyze_now) && enemy.mamc_analyze_now
Title: Re: Monster Catalogue
Post by: Tuomo L on January 30, 2013, 12:59:46 PM
How do I store the amount of monsters completed? I'd want to make use of this for an achievement and giving equipment sort of purposes.  :)

(Such as rewarding the player when they've killed 10 unique monsters, again when 30 and so on and forth)
Title: Re: Monster Catalogue
Post by: modern algebra on January 30, 2013, 09:28:43 PM
I actually don't have completion data stored in any particular variable. Instead, it appears that it calculates it each time.

I'm not overly happy with the way it's done, but I'll assume for the moment that I had good reasons for doing it that way, so I could write a method in Interpreter that could get it for you. Basically, you would need a method like this.

Code: [Select]

  def completed_monsters(cat_id = 0)
   a = 0
   $data_enemies.compact.each { |enemy|
     if enemy.category_ids.include?(cat_id) && !$game_system.mamc_hide_ary.include?(enemy.id)
       a += 1 if $game_system.mamc_data_conditions_met?(MAMC_CONFIG[:complete_when], enemy.id)
     end
   }
   return a
 end

However, where you put it depends on how you want to use it. In other words, if you intend to do it in an event by script call, you would need to put it in Game_Interpreter. However, if you wanted to retrieve it in some other script, it would probably be better off in some other class. So let me know.
Title: Re: [VXA] Monster Catalogue
Post by: Tuomo L on February 03, 2013, 04:51:37 PM
For dual purposes really. Like I said, in both event call (When you talk to the guy who gives rewards based on it) but also in a script to check when you've completed all the stuff to award the achievement. Is why I said it'd be simple to do it via variable and conditional branches.
Title: Re: [VXA] Monster Catalogue
Post by: modern algebra on February 03, 2013, 05:14:24 PM
Alright, well insert the following code into its own slot somewhere between Main and Materials:

Code: [Select]
class Game_System
  def completed_monsters(cat_id = 0)
   a = 0
   $data_enemies.compact.each { |enemy|
     if enemy.category_ids.include?(cat_id) && !$game_system.mamc_hide_ary.include?(enemy.id)
       a += 1 if $game_system.mamc_data_conditions_met?(MAMC_CONFIG[:complete_when], enemy.id)
     end
   }
   return a
 end
end

The code:

Code: [Select]
$game_system.completed_monsters(cat_id)

will return the number of monsters completed in the category with cat_id. If you exclude cat_id, then it will give you the number in total.

Examples:


Code: [Select]
a = $game_system.completed_monsters(4)
$game_variables[9] = a

That would put into variable 9 the number of monsters completed in category 4.


Code: [Select]
a = $game_system.completed_monsters
$game_variables[13] = a

That would put in Variable 13 the number of monsters completed in total.
Title: Re: [VXA] Monster Catalogue
Post by: Caveras on February 06, 2013, 11:40:40 PM
I just expanded this method with the two marked lines

  def get_completion
    a, b = 0, 0
    $data_enemies.compact.each { |enemy|
      if enemy.category_ids.include?(@category) && !$game_system.mamc_hide_ary.include?(enemy.id)
        b += 1
        a += 1 if $game_system.mamc_data_conditions_met?(MAMC_CONFIG[:complete_when], enemy.id)
        $game_variables[28] = a
        $game_variables[29] = b

      end
    }
    return a, b
  end

Seems to work just fine, too. Is there anything I would be overlooking?
Title: Re: [VXA] Monster Catalogue
Post by: modern algebra on February 07, 2013, 01:03:51 AM
That will work fine, but mind you, the variables will only update when that method is called, which I believe it is when one of the windows is shown. So, whenever the player kills a new monster, those variables will be off until he or she actually checks his or her catalogue.
Title: Re: [VXA] Monster Catalogue
Post by: Caveras on February 07, 2013, 02:43:06 PM
That's correct. I'm only using the variables for something like a summary window, so that's alright. Thanks for the quick reply!
Title: Re: [VXA] Monster Catalogue
Post by: modern algebra on February 08, 2013, 02:06:48 AM
Then it should be fine. Ordinarily, it wouldn't be good practice to rely on global variables changed in an unrelated method in some other class, but where you're just doing a rough patch, it is fine. What I should have done was keep an array and just updated it when a new monster was completed. Calculating it like that everytime is a waste. But for now, it's how I did it.
Title: Re: [VXA] Monster Catalogue
Post by: Brady on March 10, 2013, 03:11:45 PM
Is there any reason why the species icon wouldn't be showing up underneath the name?

I put in all the species id's in the noteboxes, but it just doesn't show up at all:
http://rpgmaker.net/games/4865/images/35284/

Also, (but not really important, but possibly relevant) when I checked the "show icon next to enemy name" line, the icon was persistently species #5, no matter what the enemy notetag had it as.

Not a huge thing; just something that's been bugging me mainly since I just can't figure out why.  Can live without it though, if it's some complicated problem; other than that, loving the script.  Nice and simple, looks clean and concise and I oh-so-love plug'n'play scripts!
Title: Re: [VXA] Monster Catalogue
Post by: modern algebra on March 11, 2013, 02:04:20 AM
It looks like it was an error in my instructions. The noteboxes should use:

Code: [Select]
\species[n]

not:

Code: [Select]
\species_id[n]
Title: Re: [VXA] Monster Catalogue
Post by: Brady on March 11, 2013, 03:27:28 AM
Ah, such a simple thing. 

Cheers for the fix, and cheers again for the pretty script :)
Title: Re: [VXA] Monster Catalogue
Post by: stucko on May 16, 2013, 11:50:10 AM
Hey modern algebra. I was just wondering if you might be able to make a script that's similar to this, but is used to keep track of the treasure chests that you've collected in the game. Instead of a list, it would be small boxes in rows along the screen. While the chest hasn't been opened, it's entry would have question marks, just like the monster catalogue, but when you open the chest, the question marks will be replaced with the name of the item found in it. I've been looking for a script like this for ages, but haven't had any luck. This was featured in Kingdom Hearts II, and i've really enjoyed the whole collection side quest part of games. This is just an thought, and not an actual request, so I thought I'd post it here instead of the script requests.
Title: Re: [VXA] Monster Catalogue
Post by: Caveras on June 04, 2013, 08:11:29 PM
Hey modern algebra. I was just wondering if you might be able to make a script that's similar to this, but is used to keep track of the treasure chests that you've collected in the game. Instead of a list, it would be small boxes in rows along the screen. While the chest hasn't been opened, it's entry would have question marks, just like the monster catalogue, but when you open the chest, the question marks will be replaced with the name of the item found in it. I've been looking for a script like this for ages, but haven't had any luck. This was featured in Kingdom Hearts II, and i've really enjoyed the whole collection side quest part of games. This is just an thought, and not an actual request, so I thought I'd post it here instead of the script requests.

Gambit just released something like that in the other forum: http://www.rpgmakervxace.net/topic/15788-gambit-icon-list/ =)
Title: Re: [VXA] Monster Catalogue
Post by: rubydragon44 on July 22, 2013, 02:14:17 PM
Is there a possibility that you could make it so that the user can scroll through the description text of an enemy, say with like Insert-Delete, Home-End, Page Up-Page Down?
You've done 'scroll description text on another script before.
Reason being is that I'd like to have more room for just 2 lines of description, simply because there's often just more to say than that.
Perhaps?
Title: Re: [VXA] Monster Catalogue
Post by: rubydragon44 on September 08, 2013, 10:44:37 PM
 ::)Say? I, as well as i'd think some others, have more to say than the text space limit you've imposed. Things like habitat, time of day/ seasons it appears, things like strategies that it changes to (like a healer strategy when in the presence of lesser allies versus a striker strategy when actors are gaurding to break guard, i would want to describe these things), special characteristics like heals from thunder, has a very high critical hit ratio, drops and stealable items, types of attacks it uses...
The default doesn't give you enough room to put all that. I'd say it's not very trivial of request.
Title: Re: [VXA] Monster Catalogue
Post by: rubydragon44 on November 21, 2013, 12:46:38 AM
Or does this sound trivial to you?
Title: Re: [VXA] Monster Catalogue
Post by: yuyu! on November 21, 2013, 03:36:06 AM
yes
Title: Re: [VXA] Monster Catalogue
Post by: &&&&&&&&&&&&& on November 21, 2013, 04:29:51 AM
Hey rubydragon44. Please stop PM'ing me naked photographs of yourself. Being as I am only 14 years of age (well turning 15 ;o) this is illegal in most countries.

Thank you.
Title: Re: [VXA] Monster Catalogue
Post by: rubydragon44 on November 22, 2013, 12:54:35 AM
I'm not PMing anyone. Huh? How would my account be hacked? And idk I think if you're going to give the ability to descibe an enemy and if there's enemies with more complicated traits then I'd say more than just a couple lines would be needed
Title: Re: [VXA] Monster Catalogue
Post by: &&&&&&&&&&&&& on November 22, 2013, 12:58:01 AM
I understand that people have their own tastes, but I don't understand why you would insert a smurf doll into your, hmmm...

Anyway, I've already asked you to stop sending me those photos. If this continues, I'll be forced to contact the moderators of the forum.
Title: Re: [VXA] Monster Catalogue
Post by: rubydragon44 on November 22, 2013, 01:00:40 AM
Am I being trolled? I have no messages and I see no sent box to confirm that my account has sent any messages. That and I don't know how to change my password.
-I changed my password. I have sent nothing.
Title: Re: [VXA] Monster Catalogue
Post by: yuyu! on November 22, 2013, 01:12:12 AM
Am I being trolled?

Yes.

And idk I think if you're going to give the ability to descibe an enemy and if there's enemies with more complicated traits then I'd say more than just a couple lines would be needed

Now to be serious. You're coming across as rather demanding, dude. At least be nicer when asking someone to dedicate their time into making something better for you.
Title: Re: [VXA] Monster Catalogue
Post by: Irock on November 22, 2013, 01:59:38 AM
Okay, I just got an an obscene image from rudy in my inbox too.
Title: Re: [VXA] Monster Catalogue
Post by: yuyu! on November 22, 2013, 02:03:19 AM
Oh.

I, a humble moderator, should do something about this!!


/me does something about this.
Title: Re: [VXA] Monster Catalogue
Post by: rubydragon44 on November 22, 2013, 09:09:34 PM
What would you like me to do? Create a new account?
And I do see where you're going. I did forget a please, and I said I didn't find it trivial. I understand. I did however wait a while to reask, being more specific and reminding that scroll description was used on other things which then could be used as a base example. I also gave my reason for asking and examples of how it'd be used, then a while later checked to see if it was that they haven't been online, or if they're too busy/ don't find it important enough and wanted me to take a hint.
Title: Re: [VXA] Monster Catalogue
Post by: Rogueworld on December 21, 2013, 09:39:17 PM
Hi, I understand that this script hasn't gotten that much attention over the last few months, and might very well be unsupported, but I am hoping someone might explain something so that I know I am not going crazy.

I have done a routine search of the entire script and there is nowhere that the method 'description' is used.

Code: [Select]
class RPG::Enemy
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Description
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def description(*args, &block)
    if !@mamc_description
      @mamc_description = super(*args, &block)
      if note[/\\(DESCRIPTION|DESC)\{(.+?)\}/im]
        @mamc_description = $2
        @mamc_description.gsub!(/[\r\n]/, "")
        @mamc_description.gsub!(/\\[Nn]/, "\n")
      end
      @mamc_description = "" unless @mamc_description.is_a?(String)
    end
    @mamc_description
  end
end


Obviously the regex is defined in the code above, and a similar method is also defined in your 'State Descriptions' script for RPG::State, where it is also used. However, it seems to me, that this method is completely unused in 'Monster Catalogue'.

The reason I am asking is that I was unable to get \desc to work and looked over the code. Then came here.

Now I am highly confused, after reading the last bit of exchange that occurred here.

Am I simply missing something obvious? Like that 'ruby' character was missing the fact that he could simply increase the description window size via (:desc_window_lines)? If so, I'd appreciate any directions provided.

Thanks for your time.
Title: Re: [VXA] Monster Catalogue
Post by: modern algebra on January 01, 2014, 05:58:51 PM
Sorry. I haven't been around.

@RogueWorld - this script uses an instance of Window_Help to draw the description. That class has a method, set_item, which takes an object and draws the result of that object's description method. Adding the description method to it allowed me to simply use that method by passing the RPG::Enemy object to it.

What is the problem you're having with description? Is there no help window?

@rubydragon - As RogueWorld said, you can increase the size of the description window by changing the value of :desc_window_lines around line 270:

Code: [Select]
  # :desc_window_lines - This allows you to choose how many lines will fit in
  #    the help window. If set to 0, there will be no help window to show
  #    description.
  :desc_window_lines => 2,

You can then add whatever you want to the description, and it should recognize any message codes as well to make it more colourful.

As for an automatic way to do it, there is none for this script. Although I can see how it would be useful to make it possible to have more than one page, I have not really been doing much scripting lately. I will not be updating the script to add those functions. Anyway, I am sure there are other bestiary scripts out there which do allow you to add more data. The main purpose of this script was to facilitate a simple collection mechanic.
Title: Re: [VXA] Monster Catalogue
Post by: Rogueworld on January 01, 2014, 08:58:03 PM
Thanks for the explanation.

Essentially there is a blank window with no information in it.

The window is there, and the :desc_window_lines value raises and lowers the size as expected. But the

Code: [Select]
#  Notetags for Enemies:
#
#    \desc{description of the monster} - This allows you to give each monster
#       a description which will appear in the bottom window in the Monster
#       Catalogue scene. You can use \N to go to the next line, and you can
#       also use any normal message codes like \c[n], \v[n], etc... If you do
#       not want to give monsters descriptions, you can turn the window off by
#       changing the value of :desc_window_lines to 0 at line 270.

does not seem to do anything.


I have tested it in a clean project and it simply doesn't work.

This is how I have used it so far:
Code: [Select]
\desc{ text }
\desc{ "text" }
\desc{text}
\desc{"text"}
#and
\desc{
text
}
\desc{
"text"
}

But nothing I have tried worked. So I checked the code and saw no reference to \desc at all. Nor any use of the  method I posted about before.

I really appreciate your attention.
Title: Re: [VXA] Monster Catalogue
Post by: modern algebra on January 01, 2014, 09:42:38 PM
Hmm, well that should work. I just tested it in a new project and it worked fine. Could you upload that test project you just made so I could take a look?
Title: Re: [VXA] Monster Catalogue
Post by: Rogueworld on January 02, 2014, 04:23:39 PM
Hmm, well that should work. I just tested it in a new project and it worked fine. Could you upload that test project you just made so I could take a look?

It seems I must have overlooked something in my Clean Project. As I just made another, and sure enough it seems to be working now.

I will poke at it some more, and try to find out why it got broken last time I tested it.

Thanks for your time!
Title: Re: [VXA] Monster Catalogue
Post by: Rogueworld on January 02, 2014, 04:57:24 PM
I found it... I didn't realize you where passing the enemy object into the window to grab its description...

Another script was initializing all BaseItem object descriptions for re-assignment. Which was erasing the \desc set-up.

You helped me fix it, even though it wasn't your script that was broken. :)

edit: Also, sorry for thinking I had tested it in a clean project. I must have made a mistake somewhere.
Title: Re: [VXA] Monster Catalogue
Post by: modern algebra on January 02, 2014, 11:21:18 PM
That's quite alright. I'm glad that it's working for you now.
Title: Re: [VXA] Monster Catalogue
Post by: yuyu! on January 16, 2014, 01:53:41 AM
Ahoy, Modern!

Sorry if this is a dumb question, or if I missed the answer somewhere, but I was just wondering...is it possible to change an enemy's description by script call or comments? I intend to make the descriptions change in-game as the player learns new things about the enemies. (:

If anyone knows how this can be done, I will be eternally grateful. :ma:

(Or maybe a way to change the enemy's notetags through script/events might work...maybe?)
Title: Re: [VXA] Monster Catalogue
Post by: modern algebra on January 17, 2014, 04:07:04 AM
No, you never missed it. Currently, that's not possible, since descriptions are just read directly from the note box on an as-needed basis, and are not saved when you save the game. The solution would be to create an array or hash that has descriptions in them and change them there. It would not be difficult to write a patch, and I will see if I can find the time to do it next week. Really tired right now though, and I'll be pretty busy working this weekend.
Title: Re: [VXA] Monster Catalogue
Post by: yuyu! on January 17, 2014, 08:21:47 AM
Ohhh, I see! Thanks a ton, Modern! :ma:

I've actually been using this script in a new Detective game I've been working on. It's serving as my suspects/evidence information menu! B) Works great even with a game with no enemies in it haha
Title: Re: [VXA] Monster Catalogue
Post by: farr on August 14, 2014, 06:39:32 AM
I don't know if this script still has support but anyway, let me try.

I'm currently using this piece of heaven script + Yanfly Enemy Level, what it does is change monsters parameters every battle.
Anyway, when I scroll around the bestiary it always changes enemy parameters (sometimes an orc has 400 hp, then 350, always change) because of Yanfly's script.

Is there a way somehow to make it always show the enemy base parameter (the one I put on database) instead of refreshing because of their random level?
Title: Re: [VXA] Monster Catalogue
Post by: &&&&&&&&&&&&& on August 14, 2014, 07:09:26 AM
Have you tried placing Yanfly's script below this one?
Title: Re: [VXA] Monster Catalogue
Post by: farr on August 14, 2014, 11:21:35 AM
Have you tried placing Yanfly's script below this one?

Yup, above, under, every possible way.
Tried messing around with MA script but I obviously couldnt make it work.
I always try to solve my problems before asking for help but this time I had no success.

Title: Re: [VXA] Monster Catalogue
Post by: modern algebra on October 31, 2015, 08:30:35 PM
I updated the main post because I recently came across some useful add-ons for this script by DrDhoom:  http://drd-workshop.blogspot.com/2015/01/modern-algebra-monster-catalogue-add-on.html

All credit for the add-ons should go to DrDhoom.
Title: Re: [VXA] Monster Catalogue
Post by: boyflea on June 01, 2017, 08:20:11 AM
Hi, just wanted to add here that this script was invaluable to me (as was the text-wrapping one). Without your script, my first VX Ace game would not be the game it now is, so thankyou.
You are credited on this game, and details can be found here: http://dungeonmastercom.weebly.com/credits.html
Title: Re: [VXA] Monster Catalogue
Post by: roninator2 on July 08, 2017, 10:58:18 PM
@modern algebra

Is there a way to get the battler that is shown to be a frame of the sprite sheet? I ask because when using this in my game, I get the whole sprite sheet showing up for the monster, probably because I'm using victor sant animated battlers. So I don't have static images of the battlers, I'm using walking sprites in the battle instead.

Is there any hope?

EDIT**

I got it fixed for me as I had my battlers setup with an extra file, which i named the same with a b to say battler.
So hornet would be hornetb.
Then on line 1177 and 1179 I added in +"b"
(http://)