Item & Skills Catalogue

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Item & Skills Catalogue
Version: 1.0
Author: modern algebra
Date: August 16, 2009

Version History


  • <Version 1.0> 08.16.2009 - Original Release

Planned Future Versions

No real future versions, but possibly two mutually exclusive patches:

One where if you select an item it will bring up an ordering screen and allow you to purchase the item from the catalogue (with tax). The other would be for if you also have the Grid Inventory, and it would bring up a more detailed Information window (like the one in Grid Inventory).

Description


     This script allows you to create custom catalogues containing any of the items, weapons, armors, or skills that you have encountered. Wish to make a catalogue that will show every item you've ever encountered? That can be done. Want to make a catalogue that contains all paladin equipment and/or skills, whether encountered or not? That can be done too!

     Unlike other Item Logs, this script gives you the customizability to make different item logs that can show different things. Items, weapons, armors, and skills are auto-encountered (or not, if you wish), but you can also manually encounter items with a code. All of this means that there is a lot you can do with this script if you want to, but if all of that configuration seems a bit too complicated for you than that's OK too - the script will work plug & play too.

Features

  • Can keep a nice collection record of all items
  • Can work with Items, Weapons, Armors, and Skills; even better, you can mix all of those different types of items together in the same catalogue, if you wish.
  • Vastly configurable with no set limits on catalogue objects or on what can go in a catalogue
  • automatic encounter methods that add the items to be visible as soon as they ae encountered by the player.

Screenshots



Instructions

Please see the header of the script, as well as the Editable Regions for instructions.

Script


The code is too long. Please see the attached text document. Note that this script requires the Catalogue Base script. Bitmap Addons is recommended.

Bug Fixes

Spoiler for Unequip to Nothing Bug:
A bug occurs whenever you try to unequip a weapon or armor and not replace it. To fix it, paste the following code into its own slot below the Item Catalogue but still above Main:

Code: [Select]
class Game_Party
  def gain_item (item, n, *args)
    unless item.nil?
      array = item_encounter_array (item)
      array.push (item.id) unless array.include? (item.id)
    end
    malgbra_basecatlogue_gnitem_7ff7 (item, n, *args) # Run Original Method
  end
end


Credit


  • modern algebra

Support


Please post in this topic at RMRK for support. Please do not PM me.

Known Compatibility Issues

This script requires the Catalogue Base script. Bitmap Addons is recommended.

Demo


See the Attached rar file.

Author's Notes


This was one of the first scripts I wrote for RMXP :) It didn't at all have the same function though :(


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
« Last Edit: August 02, 2011, 03:37:18 PM by modern algebra »

**
Rep:
Level 83
プログラマです
Hey man. Another nice script although I had a problem before my title screen came up. Says it's on line 183. System stack error. Stack level too deep. =/

Just thought I'd post incase it's a problem with the code rather than a clash with other scripts I have.

Note: I have the other catalogue script needed :)

Any help would be great.

Thanks :)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Does the demo work for you?

If so, it is probably a compatibility error. Come to think of it, it is likely an error with Monster Catalogue, as I made a silly mistake. I am updating that script to 1.0b now, so if you have it, try replacing it with the new version once I post it.

**
Rep:
Level 83
プログラマです
Ah it's working now! I'm not sure why's it's started working though. Must have been compatability with other scripts seeing as I've been shifting them around.

I can't be sure which script/s were messing up the Item Catalogue.

Anyways, it's still good news I guess :P

And yeh the demo worked so I doubt there was a problem with the script, afterall it's a piece of your work haha always spot on.

Cheers again :)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Well, I make plenty of mistakes, so don't give me too much credit  :police:

**
Rep: +0/-0Level 83
Would it be possible to get the items and such that the player doesn't have display as question marks?

**
Rep: +0/-0Level 82
Lord of Amaranthion
As soon as I get a game start, i get an error

Code: [Select]
alias malgbra_basecatlogue_gnitem_7ff7 gain_item
  def gain_item (item, n, *args)
    # If obtaining item, add it to encountered items
    array = item_encounter_array (item)
    array.push (item.id) unless array.include? (item.id) -----> [b]This is the line thats gives me the error[/b]
    malgbra_basecatlogue_gnitem_7ff7 (item, n, *args) # Run Original Method
  end



How can I fix this? I tried many things and it doesn't seem to fix the problem

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
It's likely an incompatibility with some script that overwrites the initialize method of Game_Party. Try pasting the catalogue below all of the other custom scripts you have in the editor, but still above Main.

**
Rep: +0/-0Level 82
Lord of Amaranthion
I always put new scripts below all my other ones. Maybe if I put it up top that might help. But thanks again Modern

EDIT2: Alright, i got it to work now. But none of my items are showing up. I even gave myself the items or equipped them and they don't appear.
« Last Edit: February 21, 2010, 10:03:31 PM by Destinynite1 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Well, what did you do to get it to work? If you altered that line in any way, particularly if you skipped it if array is nil, then that would result in none of the items being considered encountered.

Could you upload your Scripts.rvdata for me? I can't do anymore until I see the scripts it is conflicting with.

**
Rep: +0/-0Level 82
Lord of Amaranthion
Yeah, i'll send you a pm with link

EDIT: I'm using the Color Coded items script thats here. You gave me the link on RRR(atleast i think it was you XD)

EDIT2: I even copied the script exactly into a new project. I bet there's a conflicting script. Either one of Yan's or another custom one i have
« Last Edit: February 22, 2010, 02:58:28 AM by Destinynite1 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Yeah, there's a sort of conflict. For some reason, I never anticipated that there might be a script which calls the gain_item method with a nil argument.

I think all you need to do to fix it is check if the array is defined, so put it back at the bottom (or at least below KGC_LimitBreak) and replace the line that gave you the error with this:

Code: [Select]
    array.push (item.id) if array && !array.include? (item.id)

**
Rep: +0/-0Level 82
Lord of Amaranthion
Alright Modern. Thanks. I'll try that and let you know how it works

EDIT: Alright, now it shows the items. That part is fixed. Now, for some reason, when I go over any item with the color, it gives an error, this time coming from Window_Base on line 158. Here's the line:
Code: [Select]
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
« Last Edit: February 22, 2010, 03:56:14 AM by Destinynite1 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
I wasn't able to reproduce that error in your project, sorry. My bet is that you don't have element icons set up though - In the Item & Skills Catalogue, you need to set up this array:


  CI_ITEM_ELEMENT_ICONS = [132, 2, 4, 14, 16, 12, 138, 137, 104, 105, 106, 107,
                           109, 110, 111, 112]

So that there is an icon for every element. If you have x elements, you need x icon indices.

**
Rep: +0/-0Level 82
Lord of Amaranthion
Looks like i have to go through my thousands of icons -.- Well, i'll get around to this and fix and see whats happens. Thanks for all the help modern

EDIT: By the way, how can I tell what icons goes to what?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
It's in order, first in the array goes to the first element, second in the array goes to the second element, etc...

If you mean how do you know what index an icon in your Iconset is represented by, you can just count. First icon of the first row is 0 and it goes from left to right, then down a row, and so on. There are 16 icons in each row.

If you have a lot of icons, it would probably be worth using the Icon Preview script by woratana. You can find it in his Christmas Giftbox in the Script Database.

**
Rep: +0/-0Level 82
Lord of Amaranthion
So the first number is Physical, then whatever, etc.. Alright.

EDIT2: I know why I kept getting that error. Mostly it was the icons. Now since i'm using KGC Equip Extension, anything thats from the standard 5 equipment slots, gives me the Window_base Error. How can I add more to the types of items?
« Last Edit: February 22, 2010, 06:26:55 PM by Destinynite1 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Well, I have no guarantees, since I've never used that script. But this might work. I imagine it definitely won't work for whatever items have a kind = 6, so you might need to set up the extra equip script so that there is no first equipment type (and no items that have it)

Anyway, again this might not work, but if it doesn't I suggest you either remove the Item Catalogue or find another scripter to do it, as I am really busy with school and not willing to keep looking into it, sorry. Anyway, try doing this. Fo to the following line and add the icons you need to this as well (if you don't want icons for item type, then just give them 0s.

Code: [Select]
  CI_ITEM_KIND_ICONS = [144, 132, 52, 32, 42, 58, 133]

Once that is done, you need to go down somewhere around 610 and find this:

Code: [Select]
def draw_item_kind (kind, x, y)
    vocab = [Vocab.item, Vocab.weapon, Vocab.armor1, Vocab.armor2, Vocab.armor3, Vocab.armor4, Vocab.skill]
    text = vocab[kind]
    icon_index = ModernAlgebra::CI_ITEM_KIND_ICONS[kind]
    # Draw the kind of item
    draw_icon (icon_index, 8, 32)
    contents.font.color = Color.new (*ModernAlgebra::CI_ITEMTYPE_COLOUR)
    contents.draw_text (32, 32, 100, WLH, text)
  end

You should add the names for each type of item into here:

Code: [Select]

    vocab = [Vocab.item, Vocab.weapon, Vocab.armor1, Vocab.armor2, Vocab.armor3, Vocab.armor4, Vocab.skill]

You can split it into more than one line if you want, so like:

Code: [Select]
    vocab = [Vocab.item, Vocab.weapon, Vocab.armor1, Vocab.armor2,
      Vocab.armor3, Vocab.armor4, Vocab.skill]

**
Rep: +0/-0Level 82
Lord of Amaranthion
Alright. Everything works perfect now. All my items appear, icons fixed, item names I'm still working on(getting a crash with that but thats ok, i'll fix it) but now, (maybe I have too many extra equips) but my "legs" slot crashes whenever I get an item that deals with legs. There's nothing for the item that would crash it, but maybe i'll figure it out when you get around to it. I'm sorry for bothering you tons on this script. And again thanks Modern. I appreciate it

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
If Legs are the first extra equipment type that you have set up, then:
I imagine it definitely won't work for whatever items have a kind = 6, so you might need to set up the extra equip script so that there is no first equipment type (and no items that have it)

So, in the setup for Extra Equips, try replacing "Legs" with  "" as the first element of the array and make sure no items are actually of that type. Put "Legs" as the last entry of the array and edit the corresponding items accordingly. That might work.

**
Rep: +0/-0Level 69
Founder of Electronic Curse 2011
Hey Algebra, I love your scripts a lot, it's just that I get some error messages sometimes, like this one:

Script "Skill Item Book" Line 338: No Method Error Occurred
Undefined Method 'include?' for nil:NilClass

I get it every time I equip and dequip weapons and armors even when I don't have the Weapon and Armor Catalogue in my Inventory. What do I do?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Hmm, that is a problem. To fix it, that method:

Code: [Select]
  alias malgbra_basecatlogue_gnitem_7ff7 gain_item
  def gain_item (item, n, *args)
    # If obtaining item, add it to encountered items
    array = item_encounter_array (item)
    array.push (item.id) unless array.include? (item.id)
    malgbra_basecatlogue_gnitem_7ff7 (item, n, *args) # Run Original Method
  end

should be changed to:

Code: [Select]
  alias malgbra_basecatlogue_gnitem_7ff7 gain_item
  def gain_item (item, n, *args)
    # If obtaining item, add it to encountered items
    unless item.nil?
      array = item_encounter_array (item)
      array.push (item.id) unless array.include? (item.id)
    end
    malgbra_basecatlogue_gnitem_7ff7 (item, n, *args) # Run Original Method
  end

**
Rep: +0/-0Level 69
Founder of Electronic Curse 2011
Thankyou programming genius ;)!

*****
my name is Timothy what's yours
Rep:
Level 79
Hello
2014 Most Missed Member2014 Zero to Hero2014 Best IRC Quote2012 Zero To HeroSecret Santa 2012 ParticipantContestant - GIAW 9For frequently finding and reporting spam and spam bots2011 Zero to Hero
Modern Algebra's checklist -
1. Make a fatal error. Check.
2. Be called a genius. Check.
3. Fall asleep on a bed of money. Pending.
it's like a metaphor or something i don't know

**
Rep: +0/-0Level 62
RMRK Junior
I've noticed that when using this (and your monster catalog script) with your FSCMS script, when you back out of either, it leaves the menu altogether. Is there any way to fix this so you go back to the menu?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Add this into its own slot somewhere below the Catalogue_Base script:

Code: [Select]
class Scene_Catalogue
  def return_scene
    $scene = Scene_Menu.new
  end
end

**
Rep: +0/-0Level 62
RMRK Junior
Many thanks!

***
Rep:
Level 74
I'm baaack!
So.... Is this like a database?

**
Rep: +0/-0Level 66
RMRK Junior
Hey Algebra, I know it might be a lot to ask in such short time, but could you add a patch to display the stats added in YEM: New Battle Stats? This would be greatly appreciated, thanks in advance!

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Umm, try pasting the following into its own slot below the Item & Skills Catalogue script (untested):

Code: [Select]
#==============================================================================
# ** Window ItemCard
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - get_item_stats
#==============================================================================

class Window_ItemCard
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Get Item Stats
  #    item : the item to check
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias maisc_gtitmstats_3fr5 get_item_stats
  def get_item_stats(*args)
    item_stats, stat_names = maisc_gtitmstats_3fr5(*args)
    unless @object.is_a?(RPG::UsableItem)
      # Dex
      if $imported["DEX Stat"]
        item_stats.push (@object.dex)
        stat_names.push (YEM::STATS::DEX::VOCAB)
      end
      # Res
      if $imported["RES Stat"]
        item_stats.push (@object.res)
        stat_names.push (YEM::STATS::RES::VOCAB)
      end
    end
    return item_stats, stat_names
  end
end

**
Rep:
Level 62
Shou Akuma Chimera
Hey,
I ran into a problem and am not sure if this is a compability issue with other scripts or whatever.

I installed the script and decided to test it. Now whenever i hover over a certain skill in the Skill List i get this Error:
Quote
Script 'Window_Base' line 158: NoMethodError occured.

undefined method `' for nil:NilClass

It seems to only occur when i hover over this skill in the Skill Catalog, neither occures in the Skill tab of the menu or in a Fight ^^''

i do not use the Bitmap Addon as this gives me a menu when i open the Menu (suspect issue with another script)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Could you possibly recreate the error in a new project and upload it so I can take a look?

**
Rep:
Level 62
Shou Akuma Chimera
currently trying to reproduce the error in a new project.... seems to be a compability issue with another script tho as it works smoothly now... trying to identify scripts that could somehow inflict with it :/

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Best RPG Maker User (Scripting)2010 Most Mature Member
Alright, well let me know :)

**
Rep:
Level 62
Shou Akuma Chimera
Currently i'm oblivious to what file exactly is causing this...

i thought it was something with the amouth of items i have as the exchange of the items.rvdata did not make the error pop up

however when i changed back to Verify that thesis the problem did not occur, then when exchanging everything -> error pops up again

However can say it's not a script issue tho. must be something in the data folders :/

EDIT: It seems to be a problem because the Script cannot call the skills element ^^'' as they're not Basis Elements :X

EDIT2:
For everyone out there with Custom added Elements
If you run into this problem too add more numbers to this line

Code: [Select]
CI_ITEM_ELEMENT_ICONS = [132, 2, 4, 14, 16, 12, 138, 137, 104, 105, 106, 107,
                           109, 110, 111, 112, 112, 122]
As you can see ^ has 3x 112 (as i have a total of 18 used elements (Added Twilight and Blood as an Element)

Thanks to modern algebra for the help tho if you didn't ask me to send you a new project where you can take a look at i'd never found out that it wasn't a compability error but my own stupidity for not carefully reading what the script said ^^''
« Last Edit: September 27, 2012, 03:25:15 AM by Tetosan »