Hello, and please pardon me if this question has been asked already- I didn't bother reading the entire post history.
I'm having a bit of trouble with the script call concerning whether a warehouse has an item or not. That is,
- PHPlugins.PHWarehouse.prototype.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.prototype.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.prototype.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.prototype.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
Just how do you use these? I wanted to use them to determine if an item exists within a given warehouse and tried adding things like >=, = <=, etc, but it won't work. Something about an unexpected token. Also, it says, "Cannot read "hasItem" property of undefined" if I take away the semicolon.
EDIT: I should note that my goal is to make a large number of warehouses independent of variables. I'm creating a living world where NPCs take and put things into warehouses and I have the plan, but I need to add a conditional branch checking how much of an item is in a warehouse- mostly for the purpose of taking it out. Seemingly the hasItem and related scripts don't work with conditional branches.
I'm having a bit of trouble with the script call concerning whether a warehouse has an item or not. That is,
- PHPlugins.PHWarehouse.prototype.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.prototype.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.prototype.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.prototype.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
Just how do you use these? I wanted to use them to determine if an item exists within a given warehouse and tried adding things like >=, = <=, etc, but it won't work. Something about an unexpected token. Also, it says, "Cannot read "hasItem" property of undefined" if I take away the semicolon.
EDIT: I should note that my goal is to make a large number of warehouses independent of variables. I'm creating a living world where NPCs take and put things into warehouses and I have the plan, but I need to add a conditional branch checking how much of an item is in a warehouse- mostly for the purpose of taking it out. Seemingly the hasItem and related scripts don't work with conditional branches.