casper667

csca
CSCA Encyclopedia w/ Bestiary

202 posts in this topic

CSCA Encyclopedia
By: Casper Gaming (Casper667)
Last Update: March 7, 2013
Latest Version: 3.0.3

Introduction
This script creates an encyclopedia, with the option to insert it into the default main menu. The encyclopedia contains a seperate list for items, armors, weapons, and monsters(called bestiary). You can also create your own custom categories. See screenshots for more info.

Features
- Option to add this script to main menu or not(to increase compatibility w/ custom menu scripts).
- Six lists all in one scene for items, armors, weapons, skills, states and monsters.
- What information displayed for each item is listed below.
- Each category can be disabled easily.
- Everything is set to undiscovered at start of game. When player gains items, or defeats monsters, they are automatically discovered
- Displays total discovered for each item type.
- Create your own custom categories!

Updates
Version 1.1(April 14th, 2012):
- Added ability to set enemy/item/etc. to discovered through script call.
- Bestiary MaxHP and MaxMP listed at top of parameters now instead of bottom.
- Ability to restrict which items, armors, weapons, and enemies are shown to the player based on their ID(you can restrict which ID the list goes up to). Explained more in script.

Version 1.2(April 29th, 2012):
- No more max item count! Now if you don't want an item or enemy or whatever to show up in a list, simply put this notetag in its notebox: <csca enc exclude>

Version 2.0(June 17, 2012):
- Resized the windows to display more info on each item.
- Added skills and states to the encyclopedia.
- All commands(bestiary, items, etc.) are now able to be disabled.
- Changed colors of some text.
- Fixed bug with item occasion of Never.
- Made code more efficient.

Version 2.0b(June 17, 2012):
- Removed add to menu option. Use the CSCA Menu Organizer for that instead.

Version 2.1(July 12, 2012):
- Added option to use a custom image for skills/items/etc. instead of just using the blown up icon for said skill/item/etc. Size of image is 72x72.
- Added ability to change x coordinate of stat amounts.
- Added ability to customize order encyclopedia lists are shown.

Version 2.2(August 13, 2012):
-Windows now resize properly with different resolutions.

Version 2.2b(September 6, 2012):
- Optimized script.
- Added ability to set amount of a certain enemy defeated.

Version 2.2c(September 11, 2012):
-Param text is now aligned correctly automatically.

Version 3.0(October 6, 2012):
- Divided the totals window into 2 separate windows, one shows total completion %, the other shows category completion %.
- Added support for CSCA Achievement System.
- Users can now create their own custom categories.

Version 3.0.1(October 14, 2012):
-You can now order custom categories and default categories any way you want.

Version 3.0.2(October 21, 2012):
-Added ability to change descriptions of custom entries.

 

Version 3.0.3(March 7, 2013):

- Compatibility patch for CSCA Currency System

- Removed some duplicate code (now in Core Script)


INFORMATION DISPLAYED:
BESTIARY: Shows enemy sprite(centered), name, currency gain, exp gain, 3 drop items, number of that enemy defeated, enemy parameters, location found, and custom note.
ITEMS: Shows sprite (stretched bigger), item name, key item status, price, HP Effect, MP Effect, TP Gain, success rate, occasion(menu/battle/none/both), state applications and removals, number in possession, and custom note.
WEAPONS: Shows sprite (stretched bigger), weapon name, price, type, parameters, speed bonus, state applications, attack element, number in possession, and custom note.
ARMORS: Shows sprite (stretched bigger), armor name, slot, price, type, parameters, state resists, and special effects(such as 2x gold), number in possession, and custom note.
SKILLS: Shows sprite(stretched bigger), skill name, tp and mp cost, element, damage type, state application and removal, scope, occasion, price(req. csca skill shop), critical, variance, and custom note.
STATES: Shows sprite(stretched bigger), state name, priority, restriction, removal types, chance of removal, max turns affected, min turns affected, and custom note.
CUSTOM CATEGORY: Image, name, 2 optional short pieces of data, long description area.

Screenshots
Bestiary(Text view)


encbestiaryi.jpg


Bestiary(monster sprite view)


encbestiarym.jpg


Items


encitems.jpg


Weapons


encweapons.jpg


Armors


encarmors.jpg


Skills


encskills.jpg


States


encstates.jpg


Custom Category


enccustom.jpg



How to Use
Place in your materials section. Further setup optional, instructions included in script.

Script
Text file is found here(copy and paste everything into your script editor in the materials section): LINK
To easily add this script to the main menu, please use the CSCA Menu Organizer: LINK
Requires CSCA Core Script to work properly - Get it here!

FAQ
1. I get an error when I try to open the encyclopedia?
Most likely you tried opening it from a saved game. This script requires initialization(happens automatically on new games). For testing if you are unwilling to start a new game,
you can try this script call: $game_party.csca_init_encyclopedia
however this will erase all previous encyclopedia data!

Credit
Casper Gaming

Terms
http://www.caspergam...rms_of_use.html

Edited by casper667

Share this post


Link to post
Share on other sites

I see an Item almanac and bestiary hybrid altogether! Great job casper.

But for the bestiary part, should the MaxHP and MaxMP placed above the other stats(ATK, DEF)? It looks awkward.

 

Suggestion: There are something I don't want to show up on the Encyclopedia due to storyline purpose.

Can you add a notetag which would have enemies, items, weapons and armors excluded from the list?

Share this post


Link to post
Share on other sites

@Pikakapi Yes I agree the MaxHP placing on bestiary looks sort of awkward. It is that way since the script uses the same function to draw the monster parameters as it does for the wep/armor parameters, but this should be a relatively easy change that I'll include in tomorrow's update.

 

As for the notetag option, I think I know a way of doing that but it will likely take a while to implement as the script relies heavily on the item ID's for listing them, which is ruined if there is an item missing(the numbers would go from item 23 to item 25 for example). Also I am not very good at regexp yet :P

 

EDIT: I have made a sort of "band-aid" fix that allows you to restrict which ID's the list goes up to. So let's say you have 113 items, 13 you don't want to be listed and the rest you do. You could set the item list to not show any items with an ID greater than 100. However this means those items not shown will likely need to be moved in the database to a higher number and any events which concern those items may need to be updated.

 

(of course if you're still in the beginning stages of development this won't be as big of a deal as you can just estimate how many items you'll want to show to the player and how many you do not, and can start creating those items/enemies/etc. at the correct ID's from the start.)

 

EDIT 2: Script updated.

Edited by casper667

Share this post


Link to post
Share on other sites

yeah! Great script! Could you add a information part? Which updates info of new characters, places.. etc maybe based in images...

 

An excellent job!!

Share this post


Link to post
Share on other sites

Bump for update! :D

 

Version 1.2(April 29th, 2012):

- No more max item count! Now if you want an item or enemy or whatever excluded from the list, simply put this tag its notebox: <csca enc exclude>

Share this post


Link to post
Share on other sites

Woow, very nice script, Good job man :D

But would it be possable for you to make the Bestiary compatible with SAS IV System?

Thanks in advance! xD

Share this post


Link to post
Share on other sites

Hmm how does SAS deal with enemies? Are they just events? Cause you could use the script call $game_party.csca_set_enemy_true when the enemy is defeated to "discover" the enemy.

Share this post


Link to post
Share on other sites

Wow, this is amazing!

I was looking for a simple bestiary when I stumbled upon this and it's almost perfect for me :)

 

You see, I'm using Drop Options by modern algebra to have better control over, well, drops. However, it seems these two scripts don't work together.

Would it be possible to A. make them compatible?

or, what sounds to me like a simpler option B. Have a notetag that forces the script to fill in the drops with specific items? Maybe something like <drop1 itemID> ?

And now that I'm all ready being bold and requesting stuff, maybe add an option to show more than three drops? Seeing as that is very much possible when using the Drop Options script.

 

Still, even without this, it's one of the handiest scripts out there. So thank you :)

 

Drop Options script by modern algebra (rmrk.net):

 

#==============================================================================
#	Drop Options [VXA]
#	Version: 1.0
#	Author: modern algebra (rmrk.net)
#	Date: December 19, 2011
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#	This script is very simple. All it does is allow you to make item drops a
#   little less static in some very simple ways:
#
#	 (a) you can make more than three drops for each enemy, so enemies can
#	   drop a greater variety of loot;
#	 ( you can place a cap on the amount of these extra drops, so if you
#	   want a boss to have a 100% chance of dropping one of three items, but
#	   only one, then you can do that;
#	 (c) you can use percentile rather than denominator based drops; and
#	 (d) you can randomize the amount of gold dropped by setting a range
#	   within which it can fall.
#
#	If you are using any scripts that show loot drops of enemies (such as a
#   bestiary), the effects of this script will not be correctly reflected in
#   that without direct modifications. If you are using such a script, please
#   feel free to post a link to it in this script's thread in RMRK and I will
#   write a patch for it.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#	Place this script above Main and below any other scripts in the Script
#   Editor (F11).
#
#	All configuration happens in the note boxes of enemies. If you wish to add
#   a new drop, place this code in a note box for the enemy:
#
#	  \drop[type id, probability]
#		type		: the type, either I (for Item), W (for Weapon), or A (for
#					 Armor).
#		id		  : This is the ID of the item, weapon, or armor.
#		probability : This is the probability the item, weapon, or armor will
#					 drop. If you put a % sign after the number, then it will
#					 drop that percentage of the time. If not, then the number
#					 you put here will be the denominator, same as with
#					 regular drops. The number has to be an integer.
#	EXAMPLES:
#	  \drop[i1, 65%]
#		  This will mean that the item with ID 1 (Potion by default) will drop
#		 65% of the time when you kill this enemy.
#	  \drop[a5, 8]
#		  This will mean that the armor with ID 5 (Mithril Shield by default)
#		 will drop 1/8 times you kill this enemy.
#
#	To set a maximum on the number of extra drops (note that this only applies
#   to extra drops set up in the note field - the two default drops are exempt
#   from this cap), you can use the code:
#
#	  \max_drop[x]
#		 x : the maximum amount of extra drops that you want.
#   EXAMPLE:
#	If an enemy is set up like this:
#	  \drop[w3, 100%]
#	  \drop[w4, 100%]
#	  \max_drop[1]
#	Then that means that the enemy will definitely drop either Weapon 3
#   (Spear) or Weapon 4 (Short Sword), but will not drop both since
#   the \max_drop code prevents it from dropping more than one of the notebox
#   drops.
#
#	To randomize the amount of gold an enemy drops, place the following code
#   in its note box:
#
#	  \gold[variance]
#		variance : this is an integer, and the amount of gold dropped is
#		  calculated by randomly selecting a number between 0 and this value,
#		  and then adding it to the regular gold drop you set in the database.
#	EXAMPLE:
#	  If an enemy has 5 gold set as its drop in the database, then the
#	 following note:
#		\gold[12]
#	  will mean that the enemy will drop anywhere between 5 and 17 gold upon
#	 its death.
#==============================================================================
$imported = {} unless $imported
$imported[:MADropOptions] = true
#==============================================================================
# ** RPG::Enemy
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#	aliased method - gold
#	new method - random_gold; extra_drops; max_drop
#==============================================================================
class RPG::Enemy
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # * Gold
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 alias ma_drpopt_gold_2go9 gold
 def gold(*args, &block)
(rand(ma_random_gold + 1)) + ma_drpopt_gold_2go9(*args, &block)
 end
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # * Random Gold
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 def ma_random_gold
(@ma_rand_gold = self.note[/\\GOLD\[(\d+)\]/i] != nil ? $1.to_i : 0) if !@ma_rand_gold
@ma_rand_gold
 end
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # * Extra Drops
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 def ma_extra_drops
if @ma_extra_drops.nil?
  @ma_extra_drops = []
  self.note.scan(/\\DROP\[\s*([iWA])\s*(\d+),?\s*(\d+)(%?)\s*\]/i).each { |match|
	drop = RPG::Enemy::DropItem.new
	i = ['I', 'W', 'A'].index(match[0].upcase)
	drop.kind = i.nil? ? 0 : i + 1
	drop.data_id = match[1].to_i
	drop.denominator = match[3].empty? ? match[2].to_i : match[2].to_f
	@ma_extra_drops.push(drop)
  }
end
@ma_extra_drops
 end
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # * Max Drops
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 def ma_max_drops
if !@ma_max_drops
  @ma_max_drops = self.note[/\\MAX[ _]DROPS?\[(\d+)\]/i].nil? ? 999 : $1.to_i
end
@ma_max_drops
 end
end
#==============================================================================
# ** Game_Enemy
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#	aliased method - make_drop_items
#	new method - ma_make_extra_drops
#==============================================================================
class Game_Enemy
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # * Make Drop Items
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 alias mlg_dropopt_makedrops_5rx9 make_drop_items
 def make_drop_items(*args, &block)
# Run Original Method and add the new drops
mlg_dropopt_makedrops_5rx9(*args, &block) + ma_make_extra_drops
 end
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # * Make Extra Drops
 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 def ma_make_extra_drops
result = []
enemy.ma_extra_drops.each { |di|
  if di.kind > 0
	bool = di.denominator.is_a?(Integer) ? (rand * di.denominator < drop_item_rate) : (rand(100) < (di.denominator * drop_item_rate))
	result.push(item_object(di.kind, di.data_id)) if bool
  end
}
while result.size > enemy.ma_max_drops
  result.delete_at(rand(result.size))
end
result
 end
end

 

Share this post


Link to post
Share on other sites

@Chantal I do not think there is room to display more than 3 drops in the window, and as such I do not have any plans right now to offer support for scripts that increase the drop limit. However, scripts that modify the drops of an enemy should still allow you to use the 3 default drop boxes in the editor, which is where this script pulls the drops from, so just use those unless an enemy drops more than 3 items and those 3 drops should still display. Sorry :(

 

These 2 scripts should be compatible, though. There isn't any game crashing when using these 2 scripts is there?

Share this post


Link to post
Share on other sites

They are compatible in the way that there are no game crashes, yes. What I meant is that the drop options written down in the notebox using the script don't show. Sorry for confusing you. I'm not very familiar with the Scripting lingo yet, I'm afraid :P

 

Thanks for thinking it over though, I honestly appreciate it. I'll just limit myself to three drops then, or maybe have some 'secret' drops for the players to find ;)

I'll just set the drop boxes in the editor and set the droprates to something ridiculously high (1/1000) so the other script still regulates the drops and your script can show them :)

Maybe this'll even give some fanatic players the motivation to redo every boss a hundred times, because there is a small chance to get that epic item twice. /sarcasm

 

Either way, thanks again for this script. It's really nice :) (It's so nice that I'm going to do some strange things so I can still use it ;))

Share this post


Link to post
Share on other sites

Hmm, if you don't plan on using the default drop boxes for anything, you could just disable the default 3 drops from dropping as I think modern algebra's script would still add the extra drops specified in the notebox, and then you could set the 3 default drops to the items you want to display in the bestiary without worrying if they'll drop or not.

 

To do this, in MA's script, you'd change this:

alias mlg_dropopt_makedrops_5rx9 make_drop_items
 def make_drop_items(*args, &block)
    # Run Original Method and add the new drops
    mlg_dropopt_makedrops_5rx9(*args, &block) + ma_make_extra_drops
 end

 

To this:

 def make_drop_items(*args, &block)
    ma_make_extra_drops
 end

 

However, be aware that this will make ALL drops specified in the default 3 drop boxes NOT drop.

Share this post


Link to post
Share on other sites

Found the solution: Above of Line 472, I wrote.

 

 

when 5

type = "Item Bag" (My Equip slot name)

 

Hello, first thanks for great script but I've a problem; I'm currently using Yanfly Engine Ace - Ace Equip Engine v1.06.

Some of my Items are notetagged like this;

le61b.jpg

 

When I try to look my Notetagged equip in Encyclopedia I've got an error;

 

Line 472: Type Error occurred.

 

can't convert nil into String, how can I prevent this?

Edited by Batur

Share this post


Link to post
Share on other sites

Hi, this is a nice script, but I think the enemy info is too cramped in a small window.

Maybe you could decrease the monster list window width to increase the monster data window's. You could also align the monster names with the Encyclopedia options window's text above it and remove the numbering.

Another idea is to remove the statistics window and add a new option like "Statistics" and show that information. Them you could use the space to increase the monster data window height.

Still, nice job making this. =)

Share this post


Link to post
Share on other sites

Hi Casper, looks like you worked hard on this. Seems like a brilliant script - thanks! I'll be trying it out tonight, in the meantime I'm downloading the demo of Pure RPG ^_^

Share this post


Link to post
Share on other sites

@ze1 Yes it was hard to fit all the data in and there is a bit more I'd like to display, but the problem is that the window that displays items and weapons and armors is also the same window that displays bestiary info, and there isn't much more I can put in those windows without having them look empty.

 

Maybe for a future version I'll think it over more, since I plan on a big update to this script in the future, but as of right now I'm busy working on my own game and have finals in college and simply do not have time to really do anything major on any of my scripts, which is why I've only been releasing small scripts lately.

Share this post


Link to post
Share on other sites

Hmm, if you don't plan on using the default drop boxes for anything, you could just disable the default 3 drops from dropping as I think modern algebra's script would still add the extra drops specified in the notebox, and then you could set the 3 default drops to the items you want to display in the bestiary without worrying if they'll drop or not.

 

To do this, in MA's script, you'd change this:

alias mlg_dropopt_makedrops_5rx9 make_drop_items
 def make_drop_items(*args, &block)
	# Run Original Method and add the new drops
	mlg_dropopt_makedrops_5rx9(*args, &block) + ma_make_extra_drops
 end

 

To this:

 def make_drop_items(*args, &block)
	ma_make_extra_drops
 end

 

However, be aware that this will make ALL drops specified in the default 3 drop boxes NOT drop.

Oh, thanks! That helps a lot :)

Share this post


Link to post
Share on other sites

This script has been updated. Likely the final version for a while unless bugs are found.

 

Short Description of the update:

 

Version 2.0(June 17, 2012):

- Resized the windows to display more info on each item.

- Added skills and states to the encyclopedia.

- All commands(bestiary, items, etc.) are now able to be disabled.

- Changed colors of some text.

- Fixed bug with item occasion of Never.

- Made code more efficient.

Share this post


Link to post
Share on other sites

probably a newb question but which script call command do i need to use if i want this to be called from a key item? (e.g Adventurer's Guidebook, click it, then this encyclopedia opens )

 

i didn't want it to show up on the menu

Share this post


Link to post
Share on other sites

I'm not sure what is causing this problem but the text seems to 'overlap' on certain entries.

I posted a picture to demonstrate what I mean. How can I fix this?

 

New_Bitmap_Image.jpg

post-4125-0-14919400-1340085587_thumb.jpg

Edited by Sidbot

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.