SES Bestiary v1.2 (Now with Demiurge plugin!)

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Enelvon, Jul 5, 2014.

  1. Enelvon

    Enelvon Slumbering Goddess Veteran

    Messages:
    240
    Likes Received:
    134
    Location:
    Dreamland
    First Language:
    English
    SES Bestiary v1.2
    by Enelvon


    [​IMG]

    Introduction
    This script is intended to provide an extremely customizable bestiary for use in a variety of situations. Every aspect of the layout can be altered by the developer, including the number of pages and types of information displayed. Future updates are likely to contain new fields and bugfixes rather than large overhauls of the system, unless the general public finds the customization to be unreasonably difficult (something that I find unlikely, as none of my non-scripter beta testers had difficulty with it). I included almost all of the major features that I could think of in this first release, so I would appreciate it if users would suggest ideas for improvements and new features!

    Screenshots

    [​IMG]
    [​IMG]
    Usage
    This script has a large number of configuration options, all of which are detailed in the SES::Bestiary module. They will not be described in this section, as I despise redundancy on that scale. What this section will cover is the series of note tags that this script adds to Enemies. It will also discuss the series of script calls that can be used to add data to the bestiary (only relevant if you set things to require discovery in the configuration). I will begin by explaining the two ways to open the bestiary, though.
    This script may be supplemented by the snippet found here.

    The first addon has been released! With the BGM addon, you can give enemies unique themes that will play both in battle and on their bestiary pages. Enemies without unique battle BGM defined will play the default battle theme when viewed. You can find it here. Setup instructions can be found in the script header.

    Opening the Bestiary:

    There are two ways to open the bestiary: the first allows you to open it to a specific page and allow the user to scroll through it from there, while the second allows you to open a list of enemies and allow the user to select enemies from there.

    Option One: Opening the Bestiary as a Book

    This can be accomplished with a simple show_book call:

    show_book(Bestiary.new(ID, Turnable))Simply replace ID with the ID of the enemy whose page you would like to begin on. Turnable should be true or false, depending on whether or not you would like the pages to be turnable.

    Option Two: Opening the Bestiary as a Scene

    This is accomplished in the same way that you would access any other scene:

    SceneManager.call(Scene_Bestiary)
    Enemy Note Tags:

    The bestiary now has an addon for the Demiurge Notes Editor, available here! I highly recommend using it rather than manual notes tagging.

    <Bestiary X Offset: !X!>Place this in a Notes box to alter the draw X of the enemy's image in the bestiary.

    Replacements:

    !X! with the number of pixels by which to move the enemy's image. Positive values will move it towards the right while negative values will move it towards the left.

    <Bestiary Y Offset: !Y!>Place this in a Notes box to alter the draw Y of the enemy's image in the bestiary.

    Replacements:

    !Y! with the number of pixels by which to move the enemy's image. Positive values will move it towards the bottom while negative values will move it towards the top.

    <Bestiary Hide !Type!>Place this in a Notes box to prevent part of an enemy's data from being displayed. This is useful for bosses.

    Replacements:

    !Type! with the type of data you would like to hide. This can be Skills, Elements, or States.

    <Bestiary Hide Skill: !ID!>Place this in a Notes box to prevent a given skill from appearing in the list of an enemy's skills.

    Replacements:

    !ID! with the ID of the skill you would like to hide. This tag can hold more than one ID, formatted like this: <Bestiary Hide Skill: 1, 2>

    It can contain an unlimited number of IDs - just don't press Enter until you've closed the tag. The automatic wrapping in the Notes box doesn't actually introduce a new line.

    <Bestiary Parameter !Name!: !Value!>Place this in a Notes box to change the value of a given method or variable for the purposes of display in the bestiary (and only the purposes of display in the bestiary - this affects nothing else). This can also be used to create 'fake' variables that are only used in custom bestiary fields - they can be accessed via the name you give them within bestiary configuration.

    Replacements:

    !Name! with the name of the variable or method whose content you are altering or creating.

    !Value! with the value it should hold. This can be anything, as it will be treated as a String (display only and all that).

    <Bestiary Hide All (Stats|Parameters|Params)>Place this in a Notes box to have all of an enemy's basic stats (HP, MP, ATK, and so on) drawn as ???. A convenience method for bosses and other special enemies.

    Replacements:

    None - just choose one of the three names in the parentheses of the tag. Only use one - multiple possibilities are included due to variance in the preferences of developers.

    <Bestiary Description>...TEXT......TEXT...</Bestiary Description>Place this in a Notes box to determine what will be drawn for an enemy's description. Everything between the opening and closing tags will be considered part of the description. Text will be automatically wrapped to fit, and any line breaks manually inserted with Enter will drop to a new line regardless of position when the description is drawn.

    Replacements:

    None - just make sure to include a description. If this tag is absent from an enemy, an empty description will be drawn.
    Script Calls:

    These can be used in events or within your own scripts, as they are all calls to $game_party.

    $game_party.reveal_bestiary_enemy(ID)Replace ID with the ID of the enemy that you would like to reveal. This call causes all of the enemy's data to be marked as known.

    $game_party.add_bestiary_enemy(ID, Defeated)Replace ID with the ID of the enemy that you would like to add and Defeated with either true (the counter for the number of defeated enemies should be incremented) or false (it should not). This will only make the page visible -- it will not mark any individual pieces of data as known.

    $game_party.add_bestiary_data(ID, Type, Data)This is the most complicated of the calls. Replace ID with the ID of the enemy whose data you are updating. Type should be :dro for Drops, :ele for Elements, :sta for States, or :ski for Skills. Data varies depending on the Type. For :ele, :sta, and :ski, it should be the ID of an Element, State, or Skill. For :dro, it should be a string in the format "Kind-ID". Kind should be 1 (for Items), 2 (for Weapons), or 3 (for Armors). ID is the Database ID of the item in question.
    Script
    This script is available from SES VX Ace.

    Installation
    Place this script below the SES Core (v2.2) and Window_Book (v3.0).

    Credit and Thanks

    • Enelvon
    Author's Notes
    This script is made available under the terms of the MIT Expat license. View this page for more information.
     
    Last edited by a moderator: Jun 3, 2015
    #1
  2. Kane Hart

    Kane Hart Elmlor.com Veteran

    Messages:
    656
    Likes Received:
    165
    Location:
    Barrie, Ontario, Canada
    First Language:
    English
    wow this is amazing. I will have to test this out when I get up!
     
    #2
  3. captainproton

    captainproton Dangerously Nifty Veteran

    Messages:
    1,281
    Likes Received:
    579
    Location:
    Missouri
    First Language:
    english
    This looks great! I can't wait to use it!

    And I always knew pyxies were BAMF.
     
    #3
  4. Kane Hart

    Kane Hart Elmlor.com Veteran

    Messages:
    656
    Likes Received:
    165
    Location:
    Barrie, Ontario, Canada
    First Language:
    English
    Anyone have a script to add it to the main menu since I don't really know how to do that yet. 
     
    #4
  5. Enelvon

    Enelvon Slumbering Goddess Veteran

    Messages:
    240
    Likes Received:
    134
    Location:
    Dreamland
    First Language:
    English
    v1.1 is now up! This version includes a bugfix for RPG::Enemy#bestiary_parameter and adds the ability to prevent enemies from appearing in the bestiary.

    And Kane, sorry for taking so long to get back to you! You can add it to the menu by following these steps:

    Create a new script slot. Make sure that this is above *all* custom scripts. Please note that I'm assuming that you're using the default menu scene - if you're using some other script, let me know and I'll give you steps for that.

    Place this in the slot:

    class Window_MenuCommand < Window_Command  def make_command_list    add_main_commands    add_formation_command    add_original_commands    add_save_command    add_game_end_command  endendAdd this at any point inside of make_command_list (the exact spot is going to depend on where you want it to appear):

    add_command('Bestiary', :bestiary)Now add this below the final end from the previous bit of code:

    class Scene_Menu < Scene_MenuBase  alias en_be_sm_ccw create_command_window  def create_command_window    en_be_sm_ccw    @command_window.set_handler:)bestiary, method:)open_bestiary))  end   def open_bestiary() SceneManager.call(Scene_Bestiary) endendAnd you're done! It will end up looking something like this:

    Code:
    class Window_MenuCommand < Window_Command  def make_command_list    add_command('Bestiary', :bestiary)    add_main_commands    add_formation_command    add_original_commands    add_save_command    add_game_end_command  endendclass Scene_Menu < Scene_MenuBase  alias en_be_sm_ccw create_command_window  def create_command_window    en_be_sm_ccw    @command_window.set_handler(:bestiary, method(:open_bestiary))  end   def open_bestiary() SceneManager.call(Scene_Bestiary) endend
     
    Last edited by a moderator: Jul 14, 2014
    #5
  6. Sixth

    Sixth Veteran Veteran

    Messages:
    2,122
    Likes Received:
    792
    First Language:
    Hungarian
    Primarily Uses:
    RMVXA
    Looks pretty solid!

    Gonna test it tomorrow.

    With a quick watch on the script, I kinda miss 2 things:

    1. Hidden Elements

    There are hidden enemies, states and skills, why not elements? 

    2. Separate categories for specific enemy types.

    For example, a "Soldier" would appear only in the "Humanoid" Category, a "Wolf" would only appear in the "Animals" category, and so on. An "All" category should be present too.

    So, when you first open the Scene (not the Book), you would select a category first, than the actual enemy.

    The best and most informative way would be just like Modern Algebra did with his Bestiary script, in my opinion.

    Combining that Scene layout with this many information from your script would be awesome! *-*

    Anyway, I will probably post some other suggestions after I properly tested your script.
     
    #6
  7. Enelvon

    Enelvon Slumbering Goddess Veteran

    Messages:
    240
    Likes Received:
    134
    Location:
    Dreamland
    First Language:
    English
    1) This was already present... I thought. Looking at it now, I forgot to include the instructions in the header, ooops. Setting an element's icon to nil or 0 in the array will disable its display... was the plan, but it seems that I forgot to update index handling. The element won't display, but there will be an unsightly gap where it would have been. This will be corrected in 1.2, which will probably be released by some point on Saturday.

    2) This may or may not make an appearance. The scene is meant to be a simple wrapper - the bestiary itself can be easily called in various situations, and it would be trivial for other scripters to create various scenes around it. That said, I do realize that this is impractical for an average end-user, so I will look into writing an easily configured scene. If I deem it feasible, it will make an appearance and the script will be bumped up to v2.0. Please understand - I would love to make this possible, but I don't want to sacrifice the simplicity of the script itself, or its general applications. Not everyone will want to make use of such a setup, after all. If a flexible scene ends up proving problematic, it is likely that I will provide a few addons in the form of alternate scene layouts.

    Thank you for taking the time to make suggestions! I will of course be looking forward to all further feedback.
     
    #7
  8. SpacemanFive

    SpacemanFive Meteor Mage Veteran

    Messages:
    191
    Likes Received:
    23
    Location:
    Canada
    First Language:
    English
    This script looks fantastic!

    I'm thinking of using it in some of my projects, but I have a question. Would there be any way to make this compatible with animated/sprite-based enemies? The games I'm currently working on use sprite-based enemies, so I'd like to be able to display those in the bestiary in some of them, either on their own or alongside an unmoving image.
     
    #8
  9. Enelvon

    Enelvon Slumbering Goddess Veteran

    Messages:
    240
    Likes Received:
    134
    Location:
    Dreamland
    First Language:
    English
    v1.2 is up! Added the ability to hide enemies with the Bestiary Hide tag as well as the HiddenEnemies array. Also added instructions and provided a bugfix for hiding elements.

    SpaceManFive - in theory it could indeed be made compatible with such a thing. It is unlikely to ever make an appearance in the basic script (as there are many different battle systems that use different kinds of animated battlers), but if you provide me with information about the type of animation in question - and, if possible, a battler in the desired style - I would be willing to write a patch.
     
    #9
  10. Enelvon

    Enelvon Slumbering Goddess Veteran

    Messages:
    240
    Likes Received:
    134
    Location:
    Dreamland
    First Language:
    English
    The first addon has been released! With the BGM addon, you can give enemies unique themes that will play both in battle and on their bestiary pages. Enemies without unique battle BGM defined will play the default battle theme when viewed. You can find it here. Setup instructions can be found in the script header.
     
    #10
  11. aliensalmon

    aliensalmon Veteran Veteran

    Messages:
    111
    Likes Received:
    13
    Location:
    United States
    First Language:
    English
    Hello,

    Thank you for this script! I will use it for my non-commercial projects and I'll be sure to credit both you and Solistra. i do have a problem, though. I keep getting an error which causes the game to crash. The error is at line 1149 of the Bestiary script. I wonder what the problem is, though.

    Thanks.
     
    #11
  12. Enelvon

    Enelvon Slumbering Goddess Veteran

    Messages:
    240
    Likes Received:
    134
    Location:
    Dreamland
    First Language:
    English
    As much as I would like to help you with your error, I can't. I need more information in order to do anything. Please check what line 1149 is for you and give me a screenshot of the error message - the contents of the line will vary from setup to setup due to the configuration section. The default line 1149 is something that should never cause problems, honestly.
     
    Last edited by a moderator: Aug 25, 2014
    #12
  13. aliensalmon

    aliensalmon Veteran Veteran

    Messages:
    111
    Likes Received:
    13
    Location:
    United States
    First Language:
    English
    Here is the details on my problem.

    When I try to open the Bestiary, the Line 1149 error occurs.

    Line1149BestiaryError.png

    BestiaryScript.png
    When I attempt to fight any enemy, a Line 752 error occurs.

    Line752BestiaryError.png

    BestiaryScriptLine752.png
    Hope this helps when diagnosing the problem. And thank you for your response!
     
    #13
  14. Enelvon

    Enelvon Slumbering Goddess Veteran

    Messages:
    240
    Likes Received:
    134
    Location:
    Dreamland
    First Language:
    English
    Are you loading from a save file that was created before you added the bestiary script? If not, are you using any scripts that overwrite (rather than alias) Game_Party's initialize method?
     
    #14
    aliensalmon likes this.
  15. aliensalmon

    aliensalmon Veteran Veteran

    Messages:
    111
    Likes Received:
    13
    Location:
    United States
    First Language:
    English
    Yes, I am loading from a previously created save file. I guess I should test it out with a new save file.
     
    #15
  16. Enelvon

    Enelvon Slumbering Goddess Veteran

    Messages:
    240
    Likes Received:
    134
    Location:
    Dreamland
    First Language:
    English
    Yes, that would be a good idea. The problem is occurring because you're loading an instance of Game_Party from the file rather than allowing a new one to be created. As a result, the variable that contains the bestiary's information is never initialized and the problem you reported occurs. This is a common problem with scripts - in many cases, old save files will be broken if they modify something about anything that is serialized into a save file.
     
    #16
    aliensalmon likes this.
  17. aliensalmon

    aliensalmon Veteran Veteran

    Messages:
    111
    Likes Received:
    13
    Location:
    United States
    First Language:
    English
    Thanks dude! It worked with the new save file.

    So I guess that means if I add any new enemies to the database, I'll have to start another new save file to test them out in-game?
     
    #17
  18. Enelvon

    Enelvon Slumbering Goddess Veteran

    Messages:
    240
    Likes Received:
    134
    Location:
    Dreamland
    First Language:
    English
    Not at all. New entries to the database will work with no problems, as the contents of the database aren't serialized in the save files (with the exception of actors). Any save files created once the bestiary has been added will continue to work - the problem only occurred because the script was trying to find a hash that had never been created.
     
    #18
    aliensalmon likes this.
  19. aliensalmon

    aliensalmon Veteran Veteran

    Messages:
    111
    Likes Received:
    13
    Location:
    United States
    First Language:
    English
    Okay! Thanks again! You've been a great help! Thank you for the script as well!
     
    #19
  20. Enelvon

    Enelvon Slumbering Goddess Veteran

    Messages:
    240
    Likes Received:
    134
    Location:
    Dreamland
    First Language:
    English
    Not a problem! Glad I could help.
     
    #20

Share This Page