Tsukihime 1,489 Posted July 4, 2012 Is it possible to remove runes with the original script? I've only implemented adding. Share this post Link to post Share on other sites
Geo 0 Posted July 5, 2012 Hi there. Firstly, thank you for making this Script. I am impressed by the fact you're so active and readily able to update and fix problems that arise, quickly and effectively. Thanks for that, it's not always common. No question, Just wanted to say the same ^ ^ I love this script Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 5, 2012 That has been implemented. If you did have 196/200 and you picked up an item that's 5 arbitrary weight units, then you wouldn't be able to pick it up. Unfortunately, I don't have any code that will nicely inform you that you can't pick it up and put it back where you found it. Similarly, if your inventory can only hold 25 items, and you already have 25, you can't pick up any new items. What about keeping track of the weight/items but allowing you to pick them up anyway? There are probably cases where that would be useful (such as having some overburden status effect, or coding a "you have too many items" menu to pop up afterwards and show you what to discard. Share this post Link to post Share on other sites
Tsukihime 1,489 Posted July 5, 2012 You can write an add-on script that overwrites the default weight-checking. Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 5, 2012 (edited) I guess I could... I wasn't really asking for my sake though. OH and almost forgot! Is it possible to remove runes with the original script? I've only implemented adding. Yeah you can remove runes in the original, or replace them with new ones. You just select a filled rune slot and replace the rune there either with another rune or the empty slot in the menu. This still works with FP Inventory but you don't get the rune back like you should. Edited July 5, 2012 by KilloZapit Share this post Link to post Share on other sites
Dark Paladin 1 Posted July 8, 2012 I think I found a bug when using this script. When attaching a common event to an equipable item the event does not work. I've tried it on a clean game with just this script installed. Example: Creating a common event that when a specific item is equiped a switch is turned off. With this script it prevents the common event from running after equipping the item. Share this post Link to post Share on other sites
Tsukihime 1,489 Posted July 8, 2012 (edited) How do I attach a common event to an "equipable item"? I'm assuming you mean weapons or armors (compared to items that can be used). There doesn't seem to be a common event option. Edited July 8, 2012 by Tsukihime Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 9, 2012 (edited) I think he means event pages that check for a item? I don't think they check for if a item is equipped though, so I have no idea. Maybe he means using a conditional branch that checks if you have an item equipped? Let me check... Edit: Yeah it seems checking for an actor's equipment dosn't work. Shouldn't be that hard to fix though. Edit 2: I am sort of wondering if it would be worth it to have the "items", "weapons", and "armor" functions for actors and the party return a special subclass of an array with a new "include?" function for checking for the original objects. Edited July 9, 2012 by KilloZapit Share this post Link to post Share on other sites
silversatyr 31 Posted July 9, 2012 I was wondering if there was a way to check the current amount of items one has, via variable or script line, as a workaround to the 'not picking up an item when full' issue. So I'd have a conditional branch in the chest event that checks to see if I have that amount of items and if so, leaves the box unopened until I get some space. How would I reference the item limit I've set and check it to see if it's maxed? (I'm not very good with scripts, though I am trying to get better.) Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 9, 2012 I was wondering if there was a way to check the current amount of items one has, via variable or script line, as a workaround to the 'not picking up an item when full' issue. So I'd have a conditional branch in the chest event that checks to see if I have that amount of items and if so, leaves the box unopened until I get some space. How would I reference the item limit I've set and check it to see if it's maxed? (I'm not very good with scripts, though I am trying to get better.) try adding this script somewhere: class Game_Interpreter def can_add_amount?(item) return false if item.nil? item = $data_items[item] unless item.is_a?(RPG::BaseItem) return $game_party.inventory.can_add_amount?(item) end end and make your conditional call a script like "can_add_amount?(1) > 0" 1 Share this post Link to post Share on other sites
silversatyr 31 Posted July 9, 2012 ^.^ This will make it much easier to make sure I don't go over the limit~ Thanks so much! (Hopefully others can use this too~) Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 9, 2012 It's always nice to help! Oh, try this version if you need to check weapons or armor: class Game_Interpreter def can_add_amount?(item) return false if item.nil? item = $data_items[item] unless item.is_a?(RPG::BaseItem) return $game_party.inventory.can_add_amount?(item) end def armor(i) return $data_armors end def weapon(i) return $data_weapons end end Then you can use "can_add_amount?(weapon(1)) > 0" instead. Hehe... Share this post Link to post Share on other sites
Tsukihime 1,489 Posted July 9, 2012 (edited) I've sort of updated the script to fix the comparison issue, but that fix will likely cause other issues. The issue with comparison right now is this 1: you have comparison with RPG objects 2: you have comparison with my wrapped RPG objects (eg: Game_Weapon) include? I believe just iterates over each element in the array and calls the == comparison. So for example, if you wrote def ==(item) if item.class == RPG::Weapon p 'checking RPG object' return $data_weapons[@id] == item end end You will see in the console the checking line whenever it's checking stuff. Now there isn't an issue if you want to compare a Game_Weapon with an RPG::Weapon, but what happens if you want to compare a Game_Weapon with another Game_Weapon? Edited July 9, 2012 by Tsukihime Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 9, 2012 (edited) couldn't you do def ==(item) if item.is_a?(Game_Weapon) return @id == item.id elsif item.is_a?(RPG::Weapon) p 'checking RPG object' return $data_weapons[@id] == item else return false end end Note if you need to compare to see if the two objects are the exact same instance of an object you can use the ".equal?" method. Apparently == is designed to be overwritten and assigned behavior depending on the class, and ".equal?" is designed to always check if the objects are exactly the same. Edited July 9, 2012 by KilloZapit Share this post Link to post Share on other sites
Tsukihime 1,489 Posted July 9, 2012 (edited) lol I just noticed I copied the RPG::Weapon code over to each class. Unfortunately the ID is the Ace database ID, and not a unique identifier for the specific instance. Although I really should have such a field. Actually, that's what my index is for. The index stores the position of the item in inventory slot [sword 0, sword 1, sword 2, ...] You will notice that when I delete stuff, I don't actually call "delete", since that would require me to shift all of the indices over, but instead I just zero it out delete sword 1 [sword 0, nil, sword 2, ...] And then I add a new sword, I look for the first available slot, and give it that index add new sword [sword 0, sword 1, sword 2, ...] Or at least, I think that's what should be happening. I really should get into the habit of commenting my code so I can remember what each attribute is for. Edited July 9, 2012 by Tsukihime Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 9, 2012 (edited) Yeah I know the ID is the database id. Like I said, == is a lax comparison and .equals? is a strict comparison. In most cases, you don't need to know if two instances are equal, only that the item type is... Special per-instance methods could use .equals? instead... though you could do this: def ==(item) if item.is_a?(Game_Weapon) return self.equals?(item) elsif item.is_a?(RPG::Weapon) p 'checking RPG object' return $data_weapons[@id] == item else return false end end So Game_Weapon==Game_Weapon would always check to see if it's the same instance... you could even set a flag for strict or lax checks I guess Edited July 9, 2012 by KilloZapit Share this post Link to post Share on other sites
Tsukihime 1,489 Posted July 9, 2012 (edited) That would make sense. The "type" of the weapon can be retrieved using database ID's, so if you want to check if Sword is in my inventory, then the type is enough. I can't think of a use case where you are comparing grabbing the Game_Weapon type and checking how many of that you have in your inventory (because you could just check the size of the slot). EDIT: hmm nope it doesn't work. Undefined method `equals?` EDIT2: turns out it was `equal?` lol Edited July 9, 2012 by Tsukihime Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 9, 2012 (edited) Hehe, If you want to try and eliminate duplicate code try something like this: def ==(item) if item.is_a?(self.class) return self.equals?(item) elsif item.is_a?(self.superclass) p 'checking RPG object' return @baseitem == item else return false end end and setting @baseitem to the $data_items/armor/weapons member on init. Edit: Looking at the new version of the script it really isn't worth it do do this though. Edit2: BTW, I notice you don't return false in the == methods in your new version. Is it not necessary? Edited July 9, 2012 by KilloZapit Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 10, 2012 Hehe you added my code to check if you can carry stuff too! :3 Share this post Link to post Share on other sites
SignumUnderMyBed 0 Posted August 16, 2012 how can I choose which items go into which category? help please! Share this post Link to post Share on other sites
Tsukihime 1,489 Posted August 16, 2012 You can't. That's just the default system. Share this post Link to post Share on other sites
Kayzee 4,033 Posted August 17, 2012 Maybe you are using yanfly's item menu as well? Share this post Link to post Share on other sites
Draconis Feral 0 Posted September 22, 2012 Is there a way to combine this script with the Map Drops script so that items that surpass inventory maximums are dropped on the ground instead of lost? I have tried to do this my self, but I just don't understand ruby well enough. Share this post Link to post Share on other sites
jobwaggon 5 Posted October 20, 2012 Hey, could you write a formula for me to put in the inventory weight limit? I was thinking: Weight limit= 500 + ( 5 x player's level) Share this post Link to post Share on other sites