Search Unity

Inventory Pro - uGUI - Performance - Mobile support & More

Discussion in 'Assets and Asset Store' started by jorisshh, Mar 8, 2015.

?

What should I build next?

  1. New currency system

    14.1%
  2. Improved serialization / saving for web

    10.8%
  3. Better properties for items (percentages, base values, etc)

    27.2%
  4. Controller support

    15.4%
  5. Unity 5.1 networking (multiplayer)

    36.9%
  6. More modular build to simplify extending

    25.1%
  7. UFPS Multiplayer (Asset integration)

    11.5%
  8. Core GameKit (Asset integration)

    4.1%
  9. Dialogue system (Asset integration)

    21.3%
  10. Wordpress integration (Asset integration)

    4.1%
Multiple votes are allowed.
  1. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Could you double check if the integration is still checked inside the integrations wizard? Also, could you make a screenshot of the easySave2 component, perhaps it's a configuration issue.
     
  2. Carmexx

    Carmexx

    Joined:
    Jul 29, 2014
    Posts:
    63
    -Yes integrations are still ticked for easy save
    and I have this in the ESInit file, the older entries for 2.4.x commented out..


    ES2TypeManager.types[typeof(Devdog.InventoryPro.InventoryItemSerializationModel)] = new ES2UserType_DevdogInventoryProInventoryItemSerializationModel();
    ES2TypeManager.types[typeof(Devdog.InventoryPro.ItemCollectionSerializationModel)] = new ES2UserType_DevdogInventoryProItemCollectionSerializationModel();
    ES2TypeManager.types[typeof(Devdog.InventoryPro.ItemContainerSerializationModel)] = new ES2UserType_DevdogInventoryProItemContainerSerializationModel();
    ES2TypeManager.types[typeof(Devdog.InventoryPro.StatDecoratorSerializationModel)] = new ES2UserType_DevdogInventoryProStatDecoratorSerializationModel();
    ES2TypeManager.types[typeof(Devdog.InventoryPro.CurrencyDecoratorSerializationModel)] = new ES2UserType_DevdogInventoryProCurrencyDecoratorSerializationModel();

    https://postimg.org/image/61tlzyo01/

    -Actually I can save now, but in game items seem to expand the inventory slots, and the loading, it either wont load, or loads really weird, like there will be a lot of icons all squashed up in the skill bar, or the inventory window adds or removes slots.

    Update: FIXED.

    In 2.5.x code false, in 2.4 its just writer.Save();
    I changed it and its working now, what are the implications of this change ? (assuming it was intended by you).

    public override void SaveItems(object serializedData, Action<bool> callback)
    {
    Assert.IsTrue(serializedData is ItemCollectionSerializationModel);

    using (ES2Writer writer = ES2Writer.Create(fileName, new ES2Settings() { fileMode = ES2Settings.ES2FileMode.Create }))
    {
    writer.Write(serializedData, saveName);
    // writer.Save(false);
    writer.Save();
    }

    callback(true); // Saved
    }


     
    Last edited: Jan 4, 2017
  3. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yep this is intended. The serialization system is now simpler to use and all your need is a simple Save() or Load() method.

    The next version of Inventory Pro will also get custom serialization models per item type, so you can easily save and load your own custom data :)
     
  4. Carmexx

    Carmexx

    Joined:
    Jul 29, 2014
    Posts:
    63
    no I meant was it intended in the 2.5.4 code to have writer.Save(false);

    I removed the false and it now works as intended, the code for 2.4.x had writer.Save(); Assuming from your reply the code should indeed be writer.Save() ?
     
  5. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    According to the easysave2 documentation (http://docs.moodkie.com/easy-save-2/api/es2writer-save/ ) this should probably be set to true; As we want to overwrite data on a save command. I'll get it fixed for the update, thanks :)
     
    hopeful and danreid70 like this.
  6. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    For vendors there is a Vendor Category but this is not explained anywhere.
    http://devdog.io/unity-assets/inventory-pro/documentation/2.5p/api/vendors
    http://devdog.io/unity-assets/inven...og.InventorySystem&search-ref=vendor+category
    What is this?

    [Edit: added short version of question]

    Can individual item buy/sell prices be modified per vendor without affecting the prices of other items/vendors?

    I'd like to have vendors prices to be modified depending on item filters from a master list so iron will be more expensive in coastal cities but fish will be cheaper, while the reverse will be true if an iron mine is nearby but not fish.
    If there were different categories of vendor I could achieve this (eg. by grouping the vendors of a town or vendors of a profession - if I could select multiple categories per vendor then this would work with the modifiers stacking eg. iron mine nearby category gives .75 modifier to iron price while the blacksmith category has iron in his 'able to buy list' and might have a 1 modifier, whereas other characters such as traders may also have iron in their to buy list but may have a modifier of .75 as they can't directly use the item and a further category based upon where they are and how far away a potential sales opportunity is, or what local/world events are happening that they are aware of, or what rumors they've heard, etc).

    Also, it would be nice to be able to modify item prices for each vendor individually regardless of his categories so if a vendor already has a lot of an item and doesn't need any more, they will pay a reduced price based upon supply/demand (so base price * professionModifier * locationModifier * stockLevelModifier * buyPriceModifier * eventModifier = the resulting price). From the UI it only seems possible to modify overall buy and sell modifiers for each vendor. Is it possible to have the effect I'm wanting via code or are item prices only able to be changed globally?

    I'm happy to do all of the economics code myself and keep track of stock levels (though I presume that inventory pro will also keep track of vendor stock levels so perhaps I can just query it), as long as individual item prices can be changed for one vendor without affecting other vendors.



    Speaking of different properties, is it possible to have a detailed list view of inventory and vendor inventory with sortable columns and filters?
    Similar to how windows has different layout options. Or if you have played Skyrim and used the SkyUI mod which was a dramatic UI improvement over the base game.

    Being able to filter by item type, with a checkbox for usable items for selected character and then sort by damage or price or stat requirement/gains would be wonderful and take the UI from a basic to fully-featured version.
     
    Last edited: Jan 6, 2017
  7. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    All this is quite possible, but not directly build in. Let's break it down:

    Price modifiers for vendors:
    The vendor category is used for the buying/selling actions. When you sell an item to a vendor it will either be added directly to it's collection, or it can be added to a buy-back collection; Which is basically just a collection that stores the items the user sold to the vendor. 2 Vendors with the same category will share their buy-back collection. The category can also be used for other features, but it's currently only used for the buy-back feature.

    Price modifiers per item:
    This isn't currently built-in, however, you could create 1 vendor per item type; For example, have 1 vendor that sells iron / metals that has it's own multiplier and create 1 vendor for food, which also has it's own multiplier.

    To create price modifiers per item you'd have to create a new data structure that defines the new prices for items. Vendors have the BuyItemFromVendorNow and SellItemToVendorNow, which are both marked virtual, and can thus be overwritten.

    Also, the following methods exist, which could give you a nice handle to change the price for items:
    Code (CSharp):
    1.  
    2.         public virtual float GetBuyBackPrice(InventoryItemBase item, uint amount)
    3.         {
    4.             return item.sellPrice.amount * amount * buyBackPriceFactor;
    5.         }
    6.         public virtual float GetBuyPrice(InventoryItemBase item, uint amount)
    7.         {
    8.             return item.buyPrice.amount * amount * buyPriceFactor;
    9.         }
    10.         public virtual float GetSellPrice(InventoryItemBase item, uint amount)
    11.         {
    12.             return item.sellPrice.amount * amount * sellPriceFactor;
    13.         }
    14.  
    So, here you could create some lookup table for the price (factor) for an item and return that instead. All checks (to make sure the player has enough currency) uses these methods, so this should all continue to work as expected.


    Custom layouts:
    You can certainly do custom layouts; In fact, in the sci-fi UI design I've made a layout switcher, allowing the user to switch between a grid layout or a list layout. Be careful with Item layout sizes when switching between layouts (items that take up more than 1 slot).

    The way I achieved this is to create 2 slot styles, 1 list and 1 grid. Next, create a button that allows switching the layout. And finally, when the user clicks the switch button: Grab all the items in the collection, store it in a flat array, remove the old grid layout slots, instantiate the new list layout slots, place the items back into the new slots.

    And voila :)
     
  8. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    So with a separate category for each vendor, they will each have a separate inventory.
    Sounds great.

    This sounds like the way to go as I would need to pass a vendor ID (or collection ID) to the method and have it look up the various modifiers for that vendor.


    I think if implementing a list view it would be best not to have item layout sizes.

    Thanks for your reply.
    It's good to know that this is all very possible and not too difficult.
     
    jorisshh likes this.
  9. Muralidaran

    Muralidaran

    Joined:
    May 2, 2014
    Posts:
    93
    Hi Jorisshh,

    How have you been? Good here. So I took some time off my game for personal reasons and now I am back at it. I am trying to get the inventory finalized but I am still having trouble getting the UFPS weapons to equip from the hotbar. Did you ever get a change to look into that? The pickup of weapons and ammo works great, I can equip them, reload and switch between them using the Q and E keys but I can't switch between them using the number keys when I put them on the hotbar.

    Could you let me know if you ever checked into this problem or if you need more info/screenshots/ a video from me.

    Thanks,
    Mura
     
  10. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I have, but never integrated a solution. The skillbar just equips and un-equips the items; I'd have to rewrite the skillbar to make it work with UFPS and also, unequipping would no longer be possible in this case, plus it may conflict with the equipment collection. For example, if your player can only equip 2 weapons yet you have 4 in your skillbar.
     
  11. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Hi Jorisshh

    I think there may be a bug with the bags collection, could you test it for me? I created a bag with 6 slots, added 4 bags to increase the default size from 12 slot to an additional 24, giving 36 slots, added a weapon that took up 8 slots.. but on removing the bags and the weapon that takes up 8 slots, it leaves an addtional 12 on top of the default 12, giving 24 slots and all bags have been removed/dropped.
     
    Last edited: Jan 16, 2017
  12. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I actually wasn't able to replicate this; Bags shouldn't be allowed to be removed if there is a filled slot blocking it. Could you post some screenshots of your set up?

    When saving / loading these collections the length of a collection is also stored; So make sure to also save/load the collection that expands the original. Aka, the bags collection.
     
  13. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I've removed all the saving and loading options and just left the Inventory. Its still doing it at run-time. I'll test it on a fresh build of Inventory Pro without any changes and see if it still does it.
     
    Last edited: Jan 16, 2017
  14. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - here's a video of the problem with bags. What its doing is adding the 12 slot bag, adding a weapon to the inventory, then equipping that weapon, then unequipping the weapon back into the 12 slot inventory, but allowing me to unequip the 12 slot bag into main inventory, it shouldn't allow this as removing the 12 slot bag would mean that there should be no available space left, except its allowing it to go into the 12 slots allocated to the extended inventory, when it should be removed. No code changes other than making the UI look different. I didn't really need to show the weapon equip/unequip, as it was not part of the problem.

     
    Last edited: Jan 17, 2017
  15. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    In the InventoryBagsUI component have you referenced the collection you wish to extend? The BagInventoryItem checks to see if the collection that's being extended can remove a number of slots. If not, the action should be cancelled. If the wrong collection is referenced this could fail.
     
  16. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Yes, here is a screenshot inventorybags.jpg
     
  17. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Hm.. strange. Do you have the same behavior in the demo scene? (aka, a bag can be removed even though it should't)?
    Another thing to check, is the inventory collection that's being expanded part of your inventoryPlayer or is it a shared collection?
     
  18. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I'm checking the demo scene now, but need to add a bag with 12 slots (taking up 4 squares), another item that uses up 4 slots and a weapon that uses up 8 slots, and reduce the max slots of the inventory down to 12. Inventory on my scene is not a shared collection.
     
    Last edited: Jan 17, 2017
  19. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - Created a fresh project, added the latest version of Inventory Pro to it, tested the demo scene and it does the same thing. So its a bug :) Its a bad one too.. as it can increase your inventory slots by repeating the process of equipping it and removing the bag when two items are present taking up the first 12 slots, when you have a save system in place.

    I didn't see anything in BagInventoryItem.cs that would prevent you putting a bag back into the inventory if there wasn't enough room, or in InventoryItemBase.cs - where is the code that stops this so I can see whats going on?

    If you can provide me with a fix before the next update I'd appreciate it as its kinda stopping me from releasing my game. I'd rather fix it now than cause problems in the game further down the line with greedy players taking all the items by exploiting this lol :)

    Video of 2.5.4 where it doesn't work below - but notice where i had to tidy up the inventory, I right clicked on the bag that extended the inventory, so it wouldn't allow me to put it back into the main inventory! It was when I cleaned it up leaving 12 slots free that it allowed me to put it back into the inventory without preventing me from doing so.
     
    Last edited: Jan 17, 2017
  20. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - The good news is that I just tested it on the depreciated 2.4.0 version, it works on that and removes the 12 slots. The bad news is that it doesn't get rid of the bag, it hides it behind the sword which is 8 slots. So until I drop the sword it doesn't reveal that the bag that was removed and is still present in the Inventory, but at least the slots are removed :) - maybe it should have dropped it, even though I did define a dropped object prefab.

    So looks like when you rewrote or made changes to the latest current release and made 2.4.0 depreciated, something was missed or just doesn't work anymore.

    Video test of the depreciated 2_4_0 release.

     
    Last edited: Jan 17, 2017
  21. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    @julianr Ah, now I get it. The bag verifies if slots can be removed first, if this is possible the bag is added to the inventory and THEN it tries to remove the slots, which isn't possible anymore, as the bag itself is now in those slots. Thanks, working on a fix now :)
     
    hopeful and julianr like this.
  22. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Awesome - thanks! :)
     
  23. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Alright, in the BagInventoryItem.cs file scroll down to the bottom method CanUnEquip() this checks if the bag can be unequipped and if slots can be removed from the inventory collection.

    Chang the last line to the following (add + layoutSize), this will consider the item's layout size when unequipping the bag).

    Code (CSharp):
    1.  
    2. return extenderCollection.extendingCollection.CanRemoveSlots(extendBySlots + layoutSize);
    3.  
     
    julianr likes this.
  24. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Great! Thanks for a quick turnaround @jorisshh
     
    jorisshh likes this.
  25. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh That fixed it partly. If you drag the bag (6 slots) back to the inventory in the slots allocated to the bag it will not allow it, but as soon as you place it on half and half (two squares that are the default inventory size and two that are part of the bag it will allow you to drop it, leaving the additional inventory space still there and the bag is back in the inventory, giving you default space of 12 slots and an additional 6 still. Also before I could right click to unequip from the Bags Collector into the main inventory, but now it will only allow me to drag it.

    If you drag it back to the default slots its fine and you are left with the default 12 slots. Up until 0:39 on the video its fine, then it goes wrong.

    Video:

     
    jorisshh likes this.
  26. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    @julianr A newby mistake on my end; The collection handles the dragging behavior, and it did its own calculation, rather than calling the bag's CanUnEquip.

    See the attachment for the 2 updated scripts.
    Place: BagInventoryItem in Assets\Devdog\InventoryPro\Scripts\Items\BagInventoryItem.cs
    Place: InventoryBagsUI in Assets\Devdog\InventoryPro\Scripts\Modules\Inventory\InventoryBagsUI.cs

    Note that the bag checks to see if there are "extendBySlots + layoutSize" slots available to remove at the end of the collection, and isn't blocked by the drag behavior. Because it checks for layout size a bag of 2x2 will take up 4 slots, and thus, if a bag adds 4 slots + a layout size of 4 the script will check to see if there's 8 available slots at the end of the collection before the bag can be unequipped. You may want to change the "extendBySlots + layoutSize" to "extendBySlots + layoutSizeCols", which considers the width of the item.
     

    Attached Files:

    julianr likes this.
  27. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
  28. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - much better thanks! Sorts out the sizing issue. Only one problem is you can't unequip your bag if you have another item in the middle like this. See image attached. The size of the bag is 4 slots, so it should fit in either side of the item. It works if you cleanup the inventory first, then you can place it in the slots to the right. inventoryslots.jpg
     
  29. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - so if you clean it up first, like this. Then you can right click or drag the bag into the inventory slots and it will remove it and also the extended slots

    inventoryslots2.jpg
     
  30. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - hang on I will try "You may want to change the "extendBySlots + layoutSize" to "extendBySlots + layoutSizeCols", which considers the width of the item." to see if this resolves it. Missed that bit - reading it off my phone.
     
  31. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - ok yes that fixes that issue, apart from if you place, or have an item to the last 4 slots like this, you can't remove the bag into the inventory. When there is 8 slots left to fill a 4 slot bag item.

    inventoryslots3.jpg
     
  32. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - adding in "extendBySlots + layoutSizeCols - layoutSize" fixes all :) So you can place the bag to the left or the right of any item.

    Thanks again for the fixes.
     
    Last edited: Jan 18, 2017
    jorisshh likes this.
  33. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    Coming back to Unity after an absence I tried the latest version of Inventory Pro with the latest (and previous) versions of Unity and found a few things.

    I ran the InstantiatedPlayer scene and found a few things that didn't work properly:
    • When selecting the bank the player freezes but there is no bank window (pressing escape brings up the menu but doesn't close the bank window -it should first close open windows (one per press or all from first press) and on last press open the menu)
    • When selecting the chest nothing can be deposited or removed
    • When killing the mob "with loot window" there is no loot window and loot drops on the ground
    • When inventory is full the character crouches when colliding with a new item pickup
    • Boots/gloves/rings don't show on the character model when equipped
    A lot of things do still work well:
    • Doubleclicking to equip/sell/consume depending on open windows
    • Dragging to general character window area to equip in free slot
    • Character slot highlights (though transparency is set too low - it's barely visible)
    • Equipping the dagger shows the model on the character
    • The same demo online works well for most of the above issues:
      http://devdog.io/unity-assets/inventory-pro/demo
    All of these are probably easily fixable in the dev's own games but would be nice if they worked in the Unity demo too.

    [EDIT: I ran the 8.AllDone scene which seems to be a fixed version of the InstantiatedPlayer scene and also has equipable boots so I will study this further, but other questions remain below]

    One question I do have is when equipping shoes for example is there an option to hide the character's feet to prevent clipping? (especially in the case with helmets and hair where some helmets will require alternate hair models such as lower hair only eg. from ears down)
    The dev would need to create/import their own models of course but does IP have systems built in to cover these instances?



    Also, on a separate note, is it possible for characters to be items?
    (or for items to have inventories)

    This would allow for a huge amount of flexibility:

    eg. I have a pet slot in my main character sheet. I equip a pet there. I can also open the pet's equipment sheet and equip various things such as a collar that improves the pet's stats.
    I can drag the pet to the action bar and when I click it he will do the required action such as attack (or I can make a separate pet command window for more advanced options).

    Alternatively, I have a magic staff with 3 gem slots. We can think of this staff as a character/item with his own inventory that only accepts gems. We can equip this staff in our character's inventory and we can also open the staff's character sheet to socket gems from our inventory. In this case we want the stat bonuses from the gems to affect the player character rather than the staff 'character'.

    Another example is I have a piece of armor with one magic slot. I have created a fire shield item and it is in my spellbook (inventory collection for spells only). I drag it from my spellbook and into my armor (though my spellbook inventory doesn't decrease). My armor's inventory is now one fire shield spell 'item' and my player character now has the fire shield buff causing enemies to take fire damage when they attack him/her.

    Yet another example similar to the previous is I have a fire spell. This spell has 3 slots for stat modifiers (again a type of item collection). So I can add a +10 damage modifier (perhaps this is removed from my player character's inventory and perhaps not depending on the game), a +5 range mod, and a -5 mana cost mod. These stats affect this fireball 'character' to increase 'his' damage by 10 and range by 5 while reducing his mana cost by 5.

    If I want to get recursive I can have a modifier that links to another spell on hit. So with the previous example I can have a spear with 1 slot, and on hit modifier with 1 slot and a poison spell.
    The poison spell is placed in the on hit's 'character sheet' and the on hit is then placed into the spear's 'character sheet', giving the spear the poison on hit buff. The result being that when the spear hits an enemy it activates the 'on hit' condition which then in turn creates poison damage to further harm the enemy over time.
    Of course it would then be possible to create missiles that separate into more missiles, spellcrafting, and consumable items with permanently increase an items stats such as a grindstone which adds +5 damage permanently to a sword, or an upgraded handle which adds +5 handling, etc.

    All this simply by allowing either characters to act as items or items to act as characters (or items to have inventories) within limits designed by the developer. It seems like all of the base character/item/inventory systems are already in place for this to happen.

    Can we just add a player, inventory player, and custom character sheet to something tagged as an item to get the above behavior or will the system not allow this?
    [EDIT2: I'm trying this out now but as I'm not very familiar with IP it will take some time for me to test..]
    [EDIT3: The system is allowing me to add the player and inventory player components to an item (the purple boots in this case) so I'm in the process of learning how to set up a new character sheet for Mr Boots.. all good thus far..]
    [EDIT4: I have duplicated the character window and assigned it to the Character UI of Mr Boots. I can open this 'pet' menu with 'P' and Mr Boots can equip items from my inventory. He's currently wearing gloves. The only current issue is that I can open his character window before I've equipped him but I'm sure some kind of setting can disable this (even a range trigger with a very small range would work).]
    [EDIT5: I've set up a camera and render texture for the boots (copying the system for the main character), but I've run into an error where Ethan cannot pick up new items as it says his inventory is full (it's possible referring to the inventory of the boots which has 0 space - the boots only have a character sheet and no inventory. See image below..]

     
    Last edited: Jan 22, 2017
    jorisshh, danreid70 and AGregori like this.
  34. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    @Cereal_Killa

    Not so great:
    • When selecting the bank the player freezes but there is no bank window (pressing escape brings up the menu but doesn't close the bank window -it should first close open windows (one per press or all from first press) and on last press open the menu)
    What demo scene are you using to test this? I used the 8.AllDone demo scene and wasn't able to reproduce this.

    • When selecting the chest nothing can be deposited or removed
    What demo scene are you using to test this? Items can't be deposited but should be able to be removed. Make sure that the collection restrictions allow it.

    • When killing the mob "with loot window" there is no loot window and loot drops on the ground
    2 of the mobs drop items on the ground, 1 shows a loot window. This is just to show that you can use either option.
    Edit: The enemy with the loot window failed to set the items because it has no input handler attached (fixed for the next version) + a bug in the lootUI window. Fixed for the next version also.

    • When inventory is full the character crouches when colliding with a new item pickup
    A known issue, but quite hard to fix. The items have a collider by default and these collide with the player. There's a larger trigger around the object that causes a pickup, but when the inventory is full this is no longer possible.
    The only fix I can think of is setting up the collision matrix to make sure the player doesn't collide with the objects and create a child object with the trigger that's in another layer. This would however require people to configure their collision matrix + convert existing items, and layers would have to be enforced heavily (last part is doable through editors).

    • Boots/gloves/rings don't show on the character model when equipped
    -


    You can indeed make pets and give them their own inventory. Inventory collections can be assigned to a single player, but can also be shared between all players in the game. There can only be 1 active player at a time though; When your player becomes active it's collections are loaded into the managers and become the active collections used to store items. Shared collections always stay active between player changes.

    If you can't pick up items the wrong collection is likely assigned to the managers. You can see the currently active collections on the _Managers object (at run-time only) - Called the "Loot to collections"
     
  35. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    1. Disabling body parts so clothes don't poke through: If we had a box in the inspector for each paper doll slot that we could drop in/pick a body transform to disable or disable a mesh, I would use it. Trick is, if you disable the chest the arms and hands would disappear too. So, the character model would need to be broken into parts. Ours is, for this very reason, and if Inv Pro supported switching off a covered body part, well, WOW, that would be awesome.

    The other solution is an artists solution. I am certain different developers do their clothes differently, but I would never make a one layer article of clothes that is only slightly larger than the character mesh. Your animation artist will go nuts trying to adjust the models to get no poke through. I would make all clothes two sided meshes with some thickness. You need to make the clothes stand off the character a little bit. Also,the character model has to be constructed correctly, T pose, extra tris at important places (like arm pits /shoulders), extra bones for capes and skirts, rigged right, checked. Not doing this only makes the animation artist's job harder.

    Mount Points asset has a system for making clothes not pop through, but I don't know if his system is compatible with Inv Pro, Uncharted territory.

    2. To @Cereal_Killa: boots gloves and rings can all show in Inv Pro by making them skinned meshes, and setting them up with Inv Pro.
     
    jorisshh likes this.
  36. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    @wood333 & @Cereal_Killa Wood333 makes a good point, something like this would have to be implemented properly, which could make an asset on its own.

    Inventory Pro is compatible with UMA2, which does a pretty good job at exactly this; Plus, it's free :)
     
  37. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    It looks like there was an old copy and a new copy of the same scene in the most recent version of the asset which is what caused most of the initial errors.

    Is it the Player script that is in charge of picking up objects?
    In this case removing it from the boots would probably fix that problem of the wrong prefab trying to pick up items.

    As for crouching when picking up items is it possible to just stop them from colliding with the player?
    Should be possible with layers. If the player needs to collide with something to pick them up then a separate trigger collide can be added to the items or to the player.

    So you would have the player and items colliding with the ground but not each other, and an additional trigger collider on the player simply to collide with the objects. You could extend this collider if you wanted to increase the pickup range.

    Shipping a game with the crouch bug would be a bad idea..

    As for swapping items and turning off body parts, if each bone on the player was a dummy mesh and visible body/item meshes were added as children of each dummy item then they could be turned on and off without breaking the bones or the body. Is there any code in Inventory Pro that we can use to turn on a particular mesh if a slot is empty and turn it off when a slot is full? (or leave it on if the item only partially covers the body part in the slot concerned)
     
  38. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yes, the InventoryPlayer component is responsible for picking up items. The trigger callbacks are virtual and can be overwritten if you'd like.

    Preventing the collision with the objects is possible, however, keep in mind that this requires a collision matrix change and the player collider has to be in a different layer, or the item layer has to be different. This can of course already be done, nothing is restricting you from changing the layers or your collision matrix.

    I think it's a reasonable solution, but a bit error prone. As far as I know I can't modify the collision matrix through code (I'll have a look at the IL later on..).
     
  39. RealAspireGames

    RealAspireGames

    Joined:
    Dec 24, 2013
    Posts:
    265
    Hello
    Is there a way to get this working with the Realistic FPS Prefab? I've been trying for a few days now and nothing seems to be working. I would greatly appreciate the help. :)
     
  40. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
  41. StarFluke

    StarFluke

    Joined:
    Jan 19, 2013
    Posts:
    39
    Confirm:
    On Unity 5.5.0p4 fresh project with Standard Assets already installed... install of Inventory Pro v2.5.4 puts Inv Prov Standard Assets into Unity Standard Assets folder. Cannot find the namespace 'cause some Inv Pro ends up in wrong package.;):(o_O:)
     
  42. StarFluke

    StarFluke

    Joined:
    Jan 19, 2013
    Posts:
    39
    Workaround... delete the Inv Pro files that got moved to Unity Standard Assets, remove Standard Assets to zip file, refresh install of Inventory Pro, unzip Standard Assets. YAY! :D
     
    jorisshh likes this.
  43. Stevepunk

    Stevepunk

    Joined:
    Oct 20, 2013
    Posts:
    205
    From: http://devdog.io/unity-assets/inventory-pro/documentation/2.5p/api/collections

    There may be a typo here.
    Also is there a difference between an inventory and a collection or is an inventory just a type of collection?

    Because you have:
    Code (CSharp):
    1. bool currencyRemoved = InventoryManager.RemoveCurrency(currencyID, myAmount);
    And:
    Code (CSharp):
    1. bool currencyRemoved = myCollection.RemoveCurrency(currencyID, myAmount);
    I'm not sure why there's a need for both if an inventory is a collection.
    Thanks!
     
  44. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    A typo indeed; All fixed now.

    An inventory is indeed a collection. Anything that contains items is a collection (Character collection, inventory, vendor, bank, etc).

    This method removes currency from a loot to collection. Loot to collections are all inventories + shared inventories of a player. So, for example, assume your player has 4 inventories and 2 shared inventories. The InventoryManager.* calls talk to all those collections.
    1. bool currencyRemoved = InventoryManager.RemoveCurrency(currencyID, myAmount);

    While the following method talks to a specific collection.

    bool currencyRemoved = myCollection.RemoveCurrency(currencyID, myAmount);

    In most cases you can use the InventoryManager.Add, Remove methods; However if you have multiple collections and wish to remove / add to a specific collection use the myCollection.Add, Remove methods instead.
     
  45. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Inventory Pro V2.5.5 is here :)

    • Added serialization attribute that can be added to InventoryItemBase objects to add a custom serialization model (fixes #233) Example: [SerializationModel(typeof(ExtendedInventoryItemSerializationModel))]
    • Advanced trigger unuse
    • Added null checks for items to make sure AddItem() doesn't throw an error when an empty item is given
    • Updated loot collection to allow using layout item sizes
    • OnPointerUp fix for vendorUI slot
    • Removed use distance on inventory pro settings database (use general settings instead)
    • ItemCollectionSerializationModel fixed for reference collections. Saved objects were added to the scene.
    • Exposed color variable on InventoryActionHelper
    • [ADD] ItemCollectionBase calls a notification message when exceeding max weight
    • [ADD] Expand parent size option in StatCategoryUI to make the StatCategoryUI grow to it's parent's size. Useful for layout
    • [FIX] SkillbarUI only accepts 1 key press per frame to avoid double item usage
    • [FIX] SelectableObject Info unsubscribed event on destroy, fixed issues when loading a new scene
    • [FIX] SaverLoadBase issue when loading scenes fixed
    • [FIX] CanRemoveSlots from inventory when using bag collection now consider bag's own size.
    • [FIX] EasySave2 save/load issue fixed when trying to overwrite existing file
    • [FIX] StatUI no longer throws error when repainting it while inactive.
    • [FIX] Bag issue fixed where the bag itself blocks the slot removal
    • [FIX] LootUI objects not added auto.
    • [FIX] StatUI repaints value based on current max health, not definition's max health.
     
    hopeful, Stevepunk and julianr like this.
  46. altugs

    altugs

    Joined:
    Jan 14, 2017
    Posts:
    17
    How to apply stats to an NPC, like strength, agility etc. and modify them? I see there is a custom monster script in demo scene but is it useful for all conditions? Like calculating dmg with considering both stats between npc and player etc..
     
  47. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    You can re-use the StatsCollection for this. It's used to store the stats; The StatsCollectionUI is used to display those stats.

    Code (CSharp):
    1.  
    2. // Make a reference to the StatsCollectionUI
    3. // Assign in inspector
    4. public StatsCollectionUI collectionUI;
    5.  
    6. // Create the stats collection
    7. private StatsCollection _stats = new StatsCollection();
    8. public StatsCollection stats
    9. {
    10.     get { return _stats; }
    11.     protected set { _stats = value; }
    12. }
    13.  
    14. // In Start() fill the statsCollection with stats:
    15. // Note: You can use stats providers, or you could manually add stats directly to the statsCollection (stats.Add())
    16. // StatsProvider is the default provider, which grabs all stats from the database.
    17. void Start()
    18. {
    19.     // Tell collectionUI to show the stats from 'stats', our stats collection.
    20.     collectionUI.statsCollection = stats;
    21.  
    22.     stats.dataProviders.Add(new StatsProvider());
    23.     stats.Prepare();
    24. }
    25.  
     
  48. altugs

    altugs

    Joined:
    Jan 14, 2017
    Posts:
    17
    Anyone adapted llJIMBOBll's RFPS 2.4 integration into 2.5? Got some errors and couldn't able to fix them.
     
  49. Hans

    Hans

    Joined:
    Feb 20, 2007
    Posts:
    422
    Last edited: Feb 7, 2017
  50. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    @Hans @altugs A fair bit has changed since V2.4. Underlying API's have moved to Devdog.General to make them reusable, scripts have been renamed for consistency and some things have been completely replaced.

    I've requested a copy of RPFS a while back, which I received from the creator; If I can find the time I'll have a look at llJIMBOBll's 2.4 project and upgrade it to 2.5. Don't get your hopes up though, I'm quite limited on time at the moment.