PH - Warehouse/Storage

● ARCHIVED · READ-ONLY
Started by PrimeHover 140 posts Page 6 of 7 View original ↗
  1. Narch said:
    1. The first one is again the " | " sign. I found it's necessary to write a line like this: PHWarehouse randomLoot item <Mediarack1:58|59|60|61|:10>


    If the ID list is not closed with a " | ", the last item will be ignored (in this exemple, the 61).



    Ah, yes. I know how to fix that. That's just a mathematical oversight on my part and an easy fix.

    Narch said:
    Also not a direct bug, but important to notice if another user read this, having the ID list starting with the " | " sign, will create an invisible item that will be spawned inside the chest, and take space of the determined quantity possibility (ending up with a warehouse of 475/500 despite being empty. Happens on small warehouses too).



    I will put a fix on this as well.

    Narch said:
    2. I installed the MrTS_LimitedInventory plugin because I saw compatibility made in previous patches. I tested it in various position in the plugin list, and tested with YEP_Item Core off.


    The limit on MrTS plugin works, blocking the inventory from getting new items, but, a warehouse will never put a stop to withdraw.


    It causes items to vanish when the player takes them from the warehouse.



    Hmm...I'll have to see if there's a way for me to make this work, but no guarantees.

    Narch said:
    Apart from that I'd like to make 2 suggestions if you want to upgrade the plugin. It would be really nice to have an option allowing items to be displayed one by one instead of stacks (might be hard to code),


    and it would be great to have an option removing the "All" when All text option is enable, Leaving only the Withdraw text and Deposit text (would remove some sort of redundancy).



    I would like to do these, but again, my RMMV-based JavaScript knowledge is a little limited. I'll see what I can do.

  2. Interested on how it goes, good luck
  3. It would be even more awesome if we can control the warehouse creation via script calls ;)


    #ScriptCallMasterRace
  4. Need some help here...I used the following comment in the PHWarehouse common event:


    {2}


    item: 39, 40, 41, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64


    keyItem: no


    weapon: no


    armor: no


    But I cannot get the warehouse to store items with those id's (or any items for that matter).  


    I am using no other plugins, so compatibility is not a problem here.


    Probably just a dumb oversight on my part, but any help would be much appreciated...
  5. Hey, there! Just wanted to say that this is a pretty neat plugin and it's been super great so far!

    There's just one thing I noticed while testing the plugin, even on a clean project. The warehouse window lags significantly when the player has over a certain amount of items. I had about 20 items and it dropped down to as low as 3 FPS in both the withdraw and deposit tabs. Is there any way to fix that? At that point, it feels unbearable to navigate...

    *edit*
    Upon further inspection, I discovered that the itemWindow refresh under the update function is the source of the lag. The following edits appear to have fixed the problem, but I'm not yet sure if they will cause other issues:

    Code:
        Window_WarehouseCategory.prototype.update = function() {
            Window_ItemCategory.prototype.update.call(this);
            this.changeCategory();
            //this._itemWindow.refresh();
        };

    Code:
        Scene_Warehouse.prototype.onItemOk = function() {
            this._itemWindow.moveItem();
            this._infoLocationWindow.refresh();
            this._itemWindow.activate();
            this._itemWindow.refresh();
        };

    It'd also be pretty cool to be able to select more than one item at once, but even as is the plugin is really awesome. :) I've thought about trying to write in a number window myself, but I'm still a newb and I'll probably screw it up. :-(
  6. I keep getting an error

    Cannot set property 'loot bonus' of undefined

    I don't want any loot settings, I'm just trying to make a storage chest, is there a way to fix this?
  7. @KittRen Could you type out (or preferably give a screen shot of) that error message, because I think it's not exactly what the message said.
  8. @Kes sure thing thanks :)
    Screen Shot 2017-03-08 at 3.48.09 PM.png
  9. @KittRen Are you using any script calls from the plugin? Most of my issues were resolved by removing the "prototype" part of the script call. :)

    If that doesn't work, could provide a screenshot of your event set up?
  10. @yuyu! Not sure what you mean, I used the plugin commands provided to pull up the warehouse but not sure about any script calls, here is a screen shot of my event

    Thanks! :)
  11. In the create command, why does it begin with a dash(-)? I looked over the help file and didn't see anything that used that notation, so is it possible the warehouse isn't being created, and when you're trying to show it, it's not found and thus throwing an error?
  12. @FDSuprema Took that away and it was fixed! I must have copy pasted the dash by accident from the help file, thanks for spotting it! :)
  13. Hello,
    I love this plugin, actually I have some problem... I don't see amount of items stacked in storage, any idea why?
  14. Having it recognize multiple items doesn't seem to work, I've tried everything but it won't let me store items with the correct IDs

    item: 1, 2, 3, 4 does not work at all, any help? Thanks!
  15. Hey PrimeHover,
    I'm making a game where you can auto mine asteroids with an ore extractor. Everything works great, but when you get a large
    amount of ore in the warehouse (like 3,000), it is rough having to withdraw ore one at a time. Would you be able to add the
    withdraw amount buttons like in the trade screen? Or is it already supposed to be in it, but it's just not in mine?
    Awesome plugin! My game would suck badly without this. lol
    Thanks in advance.
  16. What an amazing plugin.
    Bravo!
  17. PrimeHover said:
    9GqAF1s.png


    Version 1.2.1





    Introduction

    • This plugin allows the creation of warehouses where you can store items in the game.


    License

    • This work is licensed under the Creative Commons Attribution 4.0 International License.

    • To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/

    • However, if this plugin is very useful to your project, consider making a small donation using the link below:



    Configuration

    • Download the JS file and include it into the /plugins folder of your project.

    • Open the Plugin Manager, select the file PH_Warehouse.js, and turn it on.

    • Use plugin commands to create and manage any warehouse anywhere in the game.


    Full Documentation (How to Use, Examples, Configuration, Rule Commands...)


    Plugin Commands

    • PHWarehouse create <Title of the Warehouse>
      Creates a warehouse


    • PHWarehouse create <Title of the Warehouse:50>
      Creates a warehouse and sets its maximum capacity to 50


    • PHWarehouse create <Title of the Warehouse:50:rule_name>
      Creates a warehouse, sets its maximum capacity to 50 and sets a rule


    • PHWarehouse show <Title of the Warehouse>
      Shows a warehouse


    • PHWarehouse remove <Title of the Warehouse>
      Removes a warehouse


    • PHWarehouse loot item <Title of the Warehouse:id:quantity>
      Add an item for loot bonus inside a created warehouse


    • PHWarehouse loot weapon <Title of the Warehouse:id:quantity>
      Add a weapon for loot bonus inside a created warehouse


    • PHWarehouse loot armor <Title of the Warehouse:id:quantity>
      Add an armor for loot bonus inside a created warehouse


    • PHWarehouse loot keyItem <Title of the Warehouse:id:quantity>
      Add a key item for loot bonus inside a created warehouse


    • PHWarehouse add item <Title of the Warehouse:id:quantity>
      Add an item immediately inside a created warehouse


    • PHWarehouse add weapon <Title of the Warehouse:id:quantity>
      Add a weapon immediately inside a created warehouse


    • PHWarehouse add armor <Title of the Warehouse:id:quantity>
      Add an armor immediately inside a created warehouse


    • PHWarehouse add keyItem <Title of the Warehouse:id:quantity>
      Add a key item immediately inside a created warehouse


    • PHWarehouse capacity set <Title of the Warehouse:quantity>
      Set a new maximum capacity for a warehouse already created


    • PHWarehouse capacity increase <Title of the Warehouse:quantity>
      Increase the maximum capacity for a warehouse already created


    • PHWarehouse capacity decrease <Title of the Warehouse:quantity>
      Decrease the maximum capacity for a warehouse already created



    PS.: The difference between loot item and add item is that the loots are added to the warehouse and after the first show of that warehouse, loots cannot be inserted again and the commands will be ignored. If you use add item, it will add the item inside the warehouse anyway.


    Script Calls

    • PHPlugins.PHWarehouse.exist("Title of the Warehouse")
      Verifies if a warehouse exists


    • PHPlugins.PHWarehouse.getMaxCapacity("Title of the Warehouse")
      Gets the maximum capacity of a warehouse


    • PHPlugins.PHWarehouse.getCurrentCapacity("Title of the Warehouse")
      Gets the current capacity of a warehouse


    • PHPlugins.PHWarehouse.hasItem("Title of the Warehouse", id)
      Verifies if a warehouse has a particular item and returns the quantity of this item inside the warehouse


    • PHPlugins.PHWarehouse.hasWeapon("Title of the Warehouse", id)
      Verifies if a warehouse has a particular weapon and returns the quantity of this item inside the warehouse


    • PHPlugins.PHWarehouse.hasArmor("Title of the Warehouse", id)
      Verifies if a warehouse has a particular armor and returns the quantity of this item inside the warehouse


    • PHPlugins.PHWarehouse.hasKeyItem("Title of the Warehouse", id)
      Verifies if a warehouse has a particular key item and returns the quantity of this item inside the warehouse



    Screenshots

    Spoiler
    Spoiler




    rEnAtQZ.png
    K40EJ9w.png
    KusiGVH.png


    Script


    Credits

    • PrimeHover

    Hey PrimeHover,
    I'm making a game where you can auto mine asteroids with an ore extractor. Everything works great, but when you get a large
    amount of ore in the warehouse (like 3,000), it is rough having to withdraw ore one at a time. Would you be able to add the
    withdraw amount buttons like in the trade screen? Or is it already supposed to be in it, but it's just not in mine?
    Awesome plugin! My game would suck badly without this. lol
    Thanks in advance.
  18. Dysfunktion said:
    Hey PrimeHover,
    I'm making a game where you can auto mine asteroids with an ore extractor. Everything works great, but when you get a large
    amount of ore in the warehouse (like 3,000), it is rough having to withdraw ore one at a time. Would you be able to add the
    withdraw amount buttons like in the trade screen? Or is it already supposed to be in it, but it's just not in mine?
    Awesome plugin! My game would suck badly without this. lol
    Thanks in advance.
    Sadly this developer is MIA. Hopefully someone else can post upgrade here for us to use.
  19. @Dysfunktion
    I've made a change to the deposit section of the plugin:
    Code
    Code:
           var item = this.item();
           var hundred = 0;
    
            // Deposit
            if (PHPlugins.PHWarehouse._lastOption == 1) {
                if (PHPlugins.PHWarehouse.checkCapacity() && PHPlugins.PHWarehouse.verifyItem(item)) {
                  if ($gameParty.numItems(item) >= 200) {{
                     SoundManager.playEquip();
                     for(var hundred = 0; hundred < 100; hundred++) {
                     PHPlugins.PHWarehouse.deposit(item, 1);
                     $gameParty.loseItem(item, 1);
                 }}
               } else {
                    SoundManager.playEquip();
                    PHPlugins.PHWarehouse.deposit(item);
                    $gameParty.loseItem(item, 1);
               }
                } else {
                    SoundManager.playBuzzer();
                }
            }
    If you replace the section of code in the plugin (lines 1027-1038, if you haven't edited it previously), then it will allow you to bulk deposit 100 items if you have 200 or more of the item being deposited. If you have less than 200, it will revert to single deposit.

    Hopefully someone can expand on this, as it will require some serious editing of other sections of the plugin's code.

    EDIT:
    I removed some of the content of this post, as I figured out a way to solve the depositing issue. Still working on the withdrawal part, as I'm not sure how the plugin reads the quantity of individual items in the warehouse's inventory.

    Also, I encountered a bug where, if you have say 99/1000 capacity and deposit 100 items, then you will lose 100 items from your bag and the warehouse will only gain 99. The only way around this at the moment is to make your warehouse max capacity a virtually unreachable number. "Stack Quantity" set to 1 helps also.
  20. I've been using this plugin for a while now, and it's the perfect addition to the Limited Inventory plugin. I think I found another problem when you use it together with Yanfly's Item Core, though. When you set up the rules for a warehouse, for example, exluding certain armour IDs, they are ignored if the armour is an independent item. At least that's what I think. I can try to find a fix, but for now, if anyone else can confirm this and happens to be able to fix it, please tell me.

    In other news (I hope this is okay to post...if not please tell me and I'll take it down), I made a little change to the Warehouse plugin. When using this in combination with MrTs Limited Inventory, if you change these lines, you should be unable to withdraw stuff from the warehouse if you're over your inventory limit:

    Look for this:
    Code:
     // Withdraw
             else if (PHPlugins.PHWarehouse._lastOption == 0) {
                 if (PHPlugins.PHWarehouse.verifyItem(item)) {
                     var numItems = $gameParty.numItems(item);
                     $gameParty.gainItem(item, 1);
                     SoundManager.playEquip();
                     PHPlugins.PHWarehouse.withdraw(item);
                 } else {
                     SoundManager.playBuzzer();
                 }
             }

    It should be somewhere around line 1200. Replace it with this:

    Code:
    // Withdraw
            else if (PHPlugins.PHWarehouse._lastOption == 0) {
                if (PHPlugins.PHWarehouse.verifyItem(item)) {
                    var numItems = $gameParty.numItems(item);
                    $gameParty.gainItem(item, 1);
                    if (numItems < $gameParty.numItems(item)) {
                        SoundManager.playEquip();
                        PHPlugins.PHWarehouse.withdraw(item);
                    } else {
                        SoundManager.playBuzzer();
                    }
                } else {
                    SoundManager.playBuzzer();
                }
            }

    That should work. It is possible that I made changes to other scripts additionally to this change, though. If this fix doesn't work, please tell me and I can try to figure out what else I changed.

    Quick explanation
    Basically what this fix does, it checks how much of the particular item the player has. It gives the player the item...if you're over your limit however, MrTs's plugin will prevent you from actually getting the item. Normally, it would now disappear. However, before we delete the item from the warehouse, we check if the number of items in our inventory has changed. If it did, congratulations, we actually got the item and it's deleted from the warehouse. If not, nothing happens except for the buzzer sound being played.