Nicke 151 Posted May 2, 2012 XS - Class Items Version 1.0d Introduction This script enables you to restrict items to a specific class or classes. Features Simple and easy to use. Use the note tag to specify which items that should be restricted. (If you leave the note tag empty it will use the default restriction, i.e all classes can use that item.) The restriction will work in the default item scene and in battle. You can restrict an item to as many classes as you want. Screenshots None How to Use Instructions how to use it can be find inside the script. To install this script, open up your script editor and copy/paste this script to an open slot below Materials but above Main. Remember to save. Script Get the script here. Updates Released 1.0d. Added restrictions for items in battle. Credit Do credit me, Nicke, if you are planing on using this script. Thanks. Can be use in a commercial project. Share this post Link to post Share on other sites
CookieDough 0 Posted May 6, 2012 This script is awesome. Many thanks, but I seem to get an error when selecting the item from the menu. For the sake of testing. I've even tried opening in a new game, but I recieve the same error. I'm no fanatic at scripting, so I can't for the life of my figure it out. All I know is that it seems to be trying to proccess something from Scene_Itembase line 80, but it can't locate an ID or something? Thanks in advance. Share this post Link to post Share on other sites
Nicke 151 Posted May 6, 2012 Are you using another script that change items or? Becasue I can't seem to replicate your error. Share this post Link to post Share on other sites
CookieDough 0 Posted May 6, 2012 (edited) Nope. I've been testing them in blank and fresh projects and I still recieve this error. :x Edit: God, I completely missed the fact that this is item only! Apologies for that. I guess this is one of the long-lasting nasty habits I have from carrying 2k3 memories. Back when items were the category for weapons and all. Anyway, I changed things back. But now I recieve this error when I select a blank item space in any category (Item ect) and as a result, it completely nullifies the specific class script. (When Items ARE in slots, they are still allowed to be used universally.) Edited May 6, 2012 by Essenceivis Share this post Link to post Share on other sites
Nicke 151 Posted May 6, 2012 I am aware of that. Gonna release a update soon that fixes that bug. Share this post Link to post Share on other sites
CookieDough 0 Posted May 6, 2012 Alrighty. I know the worst part of scripting is having to get it debugged by other people (see, my earlier days of amateur RGSS1 work! :wacko: ) But once the full version is out, it's an accomplishment! Good luck with the script, hope to see it completed~ Share this post Link to post Share on other sites
Nicke 151 Posted May 12, 2012 Okey, newer version released which fixes the item nil bug when selecting a "empty" slot. Share this post Link to post Share on other sites
CookieDough 0 Posted May 13, 2012 Nice update, but now I get this when I launch the game I'm sure it's something simple, but I can't figure it out. I searched in the script and everything looked okay to me. It was pointing me toward this: } return usable_class_id end end Share this post Link to post Share on other sites
Nicke 151 Posted May 13, 2012 @Essenceivis: You must have copied/pasted the script wrong then because it works for me. Share this post Link to post Share on other sites
CookieDough 0 Posted May 13, 2012 Ah - it was a compatibility error I had with another script. They kept clashing. Apologies for that. Works fine now that I removed the opposing script. Share this post Link to post Share on other sites
+ AdamSakuru 43 Posted July 27, 2012 (edited) I'm having trouble getting this to work properly. When I've tested this; If the said item is meant for a class that currently isn't in the party, then the item isn't selectable/useable. But, if even one class that can use the item is in the party, then every member of the party can use it. Is this how it's supposed to work? I was under the idea that it worked differently (meaning if I had 2 classes that could use it and two that couldn't, then the two that couldn't should not be able to consume said item if the two that can are in the party). I'll try testing it out in a new project here in a second to see if it's an incompatibility issue, but as far as I know, I'm pretty sure I wasn't doing anything wrong. Edit: Tried messing around with it more in my current project. Apparently if the said item isn't usable by the class of the first party member, you can't select it. Edited July 27, 2012 by AdamSakuru Share this post Link to post Share on other sites
Nicke 151 Posted August 26, 2012 @AdamSakuru: Yeah, grab the newer version which I've released now. It should now work as intended. Sorry for this and for the late update. I've released yet another update version 1.0d to be exact. Added restrictions for battle as well. Share this post Link to post Share on other sites
FallenWind 0 Posted September 10, 2012 Hi, sorry. Im not the most experience with scripts. Im afraid I might be doing it wrong, because I go to the items tab and put in <class: 1> for one of my classes (Wizard) on the notes section of it. Then I test the game, and one of my characters who is the wizard class is unable to use the item. However, when I remove this everyone is able to use it. Share this post Link to post Share on other sites
estriole 326 Posted September 11, 2012 Hi, sorry. Im not the most experience with scripts. Im afraid I might be doing it wrong, because I go to the items tab and put in <class: 1> for one of my classes (Wizard) on the notes section of it. Then I test the game, and one of my characters who is the wizard class is unable to use the item. However, when I remove this everyone is able to use it. this script restrict certain class to use the item. so if you put <class: 1> then every one except class 1 is able to use them but class 1 not. if you really want <class: 1> means only class 1 can use it just change all this line (there two of them): return false if $game_party.members[@actor_window.index].class_id == id to return false if $game_party.members[@actor_window.index].class_id != id it will make only the class assigned at notetags can use it. Share this post Link to post Share on other sites
Nicke 151 Posted September 11, 2012 Yep that is correct, the classes you add wont be able to use that item. Share this post Link to post Share on other sites
ZombieSchematic 0 Posted November 17, 2012 This wouldn't happen to work with Accessories as well? I'm using the Equipment Skills System Script by Fomar0153, basically it lets me use a skill system like Final Fantasy 9. But lets say I have a "Ring of Fire", I want either only the Mage to be able to equip it (So he can gradually learn to use Fire) or lets say I can equip it to the Mage and the Warrior, The Mage can learn Fire through it, but can't learn Fire Slash and vice versa as the Warrior cannot learn Fire but he can learn Fire Slash. Share this post Link to post Share on other sites
Alexandra Erin 0 Posted December 15, 2012 Oh, man... this script sounds like exactly what I need, but the link is dead. Share this post Link to post Share on other sites
estriole 326 Posted December 15, 2012 Niclas is changing domain i think. so all his link is dead. for now you could grab this: #============================================================================== # XaiL System - Class Items # Author: Nicke # Created: 02/05/2012 # Edited: 28/08/2012 # Version: 1.0d #============================================================================== # Instructions # ----------------------------------------------------------------------------- # To install this script, open up your script editor and copy/paste this script # to an open slot below â–¼ Materials but above â–¼ Main. Remember to save. # # This script enables you to restrict a certain item for a specific class. # To use this go to the notetag in the item section and add the following: # # <CLASS|class: id, id, id...> # # Examples: # <class: 1, 2, 3> # <class: 2> # <class: 3, 1, 5> # # Note: If you leave the notetag empty for an item it will use the default # method instead. # # *** Only for RPG Maker VX Ace. *** #============================================================================== ($imported ||= {})["XAIL-CLASS-ITEMS"] = true # *** Don't edit below unless you know what you are doing. *** #==============================================================================# # ** RPG::BaseItem #==============================================================================# class RPG::BaseItem def class_use # // Method to check if class can use item. arr = [] n = /<(?:CLASS|class):[ ]*(\d+(?:\s*,\s*\d+)*)>/i @note.split(/[\r\n]+/).each { |line| case line when n $1.scan(/\d+/).each { |num| arr.push(num.to_i) if num.to_i > 0 } end } return arr end end #==============================================================================# # ** Scene_ItemBase #==============================================================================# class Scene_ItemBase < Scene_MenuBase alias xail_class_items_scene_item_base_on_actor_ok on_actor_ok def on_actor_ok(*args, &block) # // Method when actor ok. unless check_class?(item) if item_usable? return use_item else return Sound.play_buzzer end else return Sound.play_buzzer end unless item.class_use == [] xail_class_items_scene_item_base_on_actor_ok(*args, &block) end def check_class?(item) # // Method to check actor's class_id for specified item. item.class_use.each {|id| return false if $game_party.members[@actor_window.index].class_id == id } end end #==============================================================================# # ** Scene_Battle #==============================================================================# class Scene_Battle < Scene_Base def item # // Methdo to set item. @item_window.item end alias xail_class_items_scene_battle_on_item_ok on_item_ok def on_item_ok(*args, &block) # // Method when actor ok. if check_class?(item) command_item return Sound.play_buzzer end unless check_class?(item) == [] xail_class_items_scene_battle_on_item_ok(*args, &block) end def check_class?(item) # // Method to check actor's class_id for specified item. item.class_use.each {|id| return false if $game_party.members[@actor_window.index].class_id == id } end end # END OF FILE #=*==========================================================================*=# # ** END OF FILE #=*==========================================================================*=# Share this post Link to post Share on other sites
Yanomry 14 Posted February 23, 2013 http://forums.rpgmakerweb.com/index.php?/topic/4469-xs-class-items/ here's a link to the place where you can actually download this script, sorry about necro post just figured since this was the only google result i could find of this script that it was important to give people the corrected link. Share this post Link to post Share on other sites