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
    hopeful likes this.
  2. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Awesome! Looking forward to that :)
     
  3. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    It's coming along nicely :). Biggest surprise of the day - Sorting didn't break ... like.. at all...
     
    TonyLi, Tinjaw and twobob like this.
  4. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    I'm so jealous man. Thanks for taking my suggestion and actually taking time to try and create it. Looking forward into this.


    EDIT: And it seems like most of the stuff worked right ? If something breaks you can take an hour to fix it and this big feature will be in your system. I'm hoping for the best.
     
  5. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yeah sure, I'll fix issues that come up; But considering that there are over 1000+ IPro users I don't want to build anything that breaks all those project :) - But things are looking good so far, just 1 more thing to fix, and then I'll be able to assess the situation
     
  6. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Sweet baby jesus it works!

    A few restrictions

    • Containers have to use the custom layout group
    • Custom layout group requires a fixed amount of columns, so once the column count is set it cannot change.
    • Only rect and square item sizes, so 1x1, 1x2, 3x3, 3x1, etc.. No weird Tetris shapes.
    A few known problems:
    • Sorting has to be broken... it has to be > Can't see what's wrong with it though :)
    • Dragging a large item 1 slot to the side fails because it hits itself when checking for placement.
    • Icon stretching
    • Swapping items works, however when swapping a large item it will only accept swapping it for 1 smaller item. (For example, shield of 3x3 -> swap with a single dagger of 1x1 -> works - swap shield 3x3 with 2 daggers of 1x1 -> Doesn't work).
    Give it a spin - (Please do report any bugs you may find so I can fix them)
    http://devdog.nl/sizetest/Builds.html
     
    Last edited: Dec 24, 2015
  7. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    79
    @jorisshh After I upgraded to the latest version, I keep getting this message everytime I try to pickup an item, "The item is to far away to be picked up" I don't know what I'm missing.
    EDIT: I also get a null reference in this line " count += lookup.collection.CanAddItemCount(item);"
     
  8. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Most likely your InventoryPlayer component has an empty "inventory" row. To fix, check your InventoryPlayer component and make sure that all fields are set. If you're instantiating your player make sure the paths are correct.
     
  9. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Sounds great so far ! :D But the link's broken

    EDIT: Yeah the wierd shapes like from tetris are not even needed don't worry 'bout that.
     
  10. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Whoops, authentication thing :oops:
    Updated the link
     
  11. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Okay i've tested a bit, works good. But when you drag it, the last instance of it that is showing where it was before is actually getting in it's way if you want to move it by one slot only, if you get me.

    (Detailed: while the item is dragged, the last position is represnted with another instance of it, right ? But that's considered an item in the inventory the whole time, untill you drop it. When you do drop it, the last instance disappears. But if you drop a bigger item just by one slot, like right next to the last position, it will consider the last instance as an item that will be in it's way, so it doesen't apply it but puts it back where it was before.)

    EDIT: Just tought i'd tell you that, you most likley figured it out yourself. And it's just one of the problems it has so far... Well it's all new, you just started workin on it so that's very expected.
     
  12. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yep it's what I meant by
    • Swapping items works, however when swapping a large item it will only accept swapping it for 1 smaller item. (For example, shield of 3x3 -> swap with a single dagger of 1x1 -> works - swap shield 3x3 with 2 daggers of 1x1 -> Doesn't work).
    But no worries, I've just fixed it, it now ignores 'collisions' with itself :)
     
  13. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    79
    Thank you for your reply, unfortunately I spent all the day trying to figure out whats wrong but still could not solve the problem. I found that inventory collections in " foreach (var inv in _currentPlayer.inventoryCollections) " are null even tho I have set the inventories collections in the inventoryplayer component. One thing to note is that Im instantiating my character later in the game during runtime, and I do this to populate the inventoyplayer component by code once I spawn my character:
    Code (csharp):
    1.  
    2. InventoryPlayer ivp = gameObject.GetComponent<InventoryPlayer>();
    3.         InventoryUI invui = GameObject.Find("OverlayCanvas").transform.Find("InventoryWindow").GetComponent<InventoryUI>();
    4.  
    5.         GetComponent<InventoryPlayer>().inventoryCollections.SetValue(invui, 0);
    6.         GetComponent<InventoryPlayer>().skillbarCollection = GameObject.Find("OverlayCanvas").transform.Find("Skill_BG").GetComponent<SkillbarUI>();
    7.         GetComponent<InventoryPlayer>().inventoryCollections.SetValue(GetComponent<InventoryPlayer>().skillbarCollection, 1);
    8.         ivp.enabled = false;
    9.         ivp.enabled = true;
    10.  
     
  14. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Oh i tought swapping ment like switching positions of two items if you drag one onto another. Nvm, nice job fixing it anyways !
     
  15. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    When spawning your player you could use the InventoryPlayerSpawner component ( http://devdog.nl/documentation/player-spawner/ ). You can of course use your own script, just make sure that on your InventoryPlayer component "Is player dynamically instantiated" is checked. Then, once you've spawned your player and hooked up all the collections call ivp.Init(); // Initializes the player and makes it active.
     
    Lelon and hopeful like this.
  16. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Alrighty, it's official. I'll add the item layout sizes to the next version of Inventory Pro :)

    I've cleaned up the icons a bit, and separated the background texture from the actual icon so it can stretch. Which cleans up quite nicely.


    All items now have an item layout template - Simply click the buttons and your item will be of that size. When your item layout aspect ratio (for example 1:2) differs from the icon aspect ratio you'll be warned as the icon would stretch.


    And finally, collections can ignore the item layout sizes :)
     
    Last edited: Dec 25, 2015
    julianr, montyfi, Hans and 5 others like this.
  17. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    What an amazing support by you man, you really care about your asset and what clients have to say. Thank you ! (Also, sorry for not replying instantly, the alert thing on forum glitches all the time)
    (Wait, another thing... I'm sorry to bother you with stuff but the layout size shouldn't be limited to 4x4 max)
     
    julianr and jorisshh like this.
  18. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    [QUOTEJorisshh said:

    That's some great news :D. I'll contact some designers on the asset store and ask them for permission.

    @wood333 If you have some specific models in mind, let me know and I'll contact the creators.][/QUOTE]

    I don't have any specific model in mind. I previously referred to first person lover (female) because I had seen her used by Aerozo on his forum for his Universal Character Customization (beta). She looks good and she comes with a variety of clothes. However, the clothes are a promotion of the Bjorn Borg line, and for that reason, you might want to look around the asset store for a style that better matches the RPG style of Inv Pro.

    No matter what clothes you use, having Inv Pro bind them to the character bones will be absolutely fantastic!
     
    jorisshh likes this.
  19. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The set up had some performance degradation at larger sized items (I scanned around the items location for potential blocks from other items, so the larger the items the further it had to scan for potential blocks). I've cached the values now and cleaned it up to keep GC as low as possible. I'll update the grid to 6x6, although there isn't currently any reason the item can't be bigger :)
     
    Tinjaw likes this.
  20. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Yeah it would be a little rediculous to have bigger items, but in my case it's actually needed xD. Doesn't matter though i can live with it. I'm trying to build my own once again, i don't know if i'll make it out without some silly bugs but i'll try. If i fail i'll most likley just buy your asset when it comes out with the layout update. If i do make it atleast i'm not the only one interested in the item size support, it's huge now in survival games so it'll catch people's eyes. Keep the good work up with this asset.
     
  21. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    79
    @jorisshh I fixed my previous problems and now I can pick up items by collision, but I still can't pick up items by mouse. When I click on the items to pick up I always get this message" item is to far away to pickup" Inventories are setup correctly because I can pickup using collision. How to change the pickup distance so it does not say that the item is far away?
     
  22. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    A few things you can check ->
    • Are your items in the correct layer (as defined in the Settings > Layers).
    • Does your player have an RangeHelper component?
    • Is the use distance set in the settings?
     
  23. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    79
    My item world layer is set to 26, what does that mean?
    Yes I have rangeHelper component on the player
    Yes the use distance is set in the setting and the "Item trigger mouse click" is also checked.
     
  24. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    By player you mean the _Col gameObject that is a child of the player, right? When the component is not present it will auto. be added at run-time.

    The layer number (26 in this case) represents the number in the Unity layers window (Edit > Project settings > Tags & Layers). And make sure that layer 26 is an Inventory Pro layer (name doesn't really matter); But just make sure that your items in the world have the same layer as set in the Inventory Pro's settings.
     
  25. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    79
    Yes I adjusted the layers now, still can't pick up using the mouse. And yes the range helper in on the _Col object. The mouse cursor does not change as well if that helps.
     
  26. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I suppose the object has a collider, right :p? Could you upload your project so I can have a look (if so - pm with link please)? Not sure what's wrong :(
     
  27. Lelon

    Lelon

    Joined:
    May 24, 2015
    Posts:
    79
    Thank you for the help anyway, yes I have a collider on the item because I can pick it up when it collides with my player fine. I will keep looking on whats the problem, if I can't solve it, I will create a project example for you and upload it.
     
  28. Superjayjay

    Superjayjay

    Joined:
    Mar 28, 2013
    Posts:
    69
    This is precisely what I have been waiting for before opting in. Can't wait ! :D
     
  29. r3nrohan

    r3nrohan

    Joined:
    Sep 28, 2015
    Posts:
    33
    Again, a very basic and noob problem, how to get equipment stats. I am getting error, a lot
     
  30. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Alright, what kind of error? Also did you check the setup wizard?
     
  31. Uto

    Uto

    Joined:
    Nov 10, 2014
    Posts:
    17
    Is it possible to separate inventory grid slot icons from item? So that when dragging, only the actual item is being moved and grid stays. Or do I need to make extra panel that only has the grid icons and then transparent inventory slots on top of that or something like that?
     
  32. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    When the wrapper it's dragged. You can use this to your advantage by adding a button component and using the sprite swap. Then when it's inactive use a transparent icon to hide the background from the icon.


    So when the icon is dragged it will be disabled, and the background icon will be set to transparent -> Keeping only the icon :)
     
  33. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    This would be a great addition to the asset. Or as previously suggested an inegration with ootii's mount points.
     
  34. r3nrohan

    r3nrohan

    Joined:
    Sep 28, 2015
    Posts:
    33
    Actually I solved that part, problem was I forgot converting that "default" value, however i think i need guide to use potions and recover the stats. Thx
     
  35. Uto

    Uto

    Joined:
    Nov 10, 2014
    Posts:
    17

    Thanks, I'll try that. Then, I have another question, is there some event to hook onto when dragging and item?
     
  36. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yes, you can either use the OnDragStart (using the Unity interface, but this would force you to add an extra component to each wrapper), or you can use the InventoryUIDragUtility.OnStartDragging
     
  37. r3nrohan

    r3nrohan

    Joined:
    Sep 28, 2015
    Posts:
    33
    umm, sorry for my english, not natural; there are potions and foods that can restore stats, however I an not able to restore those stats where as I can add stat bonus from equipment, so My question again is, what API am I supposed to use to restore stats?

    Thanks Again
     
  38. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    You can use the stats api ( http://devdog.nl/documentation/changing-stats/ ). The stats have been updated a little in V2.3.1, as well as the documentation, so make sure you're using the last version of Inventory Pro.
     
  39. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    It's that wonderful time of the year again :); That's right, another Inventory Pro update:

    V2.3.2
    Features:
    • Item layouts – Rect and square item sizes! (1×4, 1×3, 4×1, 3×3, etc..)
    • Improved stats system + new events on stat itself, and events moved to statsContainer
    • Moved bestTriggerer event and data to rangeHelper, every player can now have it’s own best triggerer + Fixed bug, OnBestTriggererChanged event didn’t fire when object was destroyed
    • Added warning message to disabledWhileActive list for dialogs
    • Setupwizard now checks for empty fields in IInventoryItemContainers (treasure chests, lootables, vendors, etc)
    • Updated controller scene
    • InventoryPlayer findElement now uses collection name instead of path + editor warnings when not found ( fixes #155 )
    • Drop object can now be overwritten per item fixes #154
    • Cooldown update, now works with overriding on all items with ID fixes #152
    • Removed, select default blueprint + added check to craft button if current blueprint is selected
    • Fixed best trigger changing with player + avoids errors when player is instantiated at late frame
    • Updated UFPS
    • SkillbarUI can now be manually defined for more customization.
    • Dragging workaround in Unity editor
    • Updated setup wizard to reflect new manually defined collections
    • Setupwizard, collections are only scanned in current scene, not Resources
    • Collection wrapper count update (now handles already scanned objects in play mode)
    • Category and rarity warning on Items
    • Property.GetFormattedString to ToString()
    • UIShowStat value interpolation for fancy effects
    • Stats updated – now have an icon
    • Notification update – Now has a string.Format for the entire message to allow prefix and suffixing
    • New collection syncer, wrappers are now moved to save performance, pooling and avoids mismatches as they’re sharing the same resources
    • Vendor fix – You can now only buy as many items as the vendor has when ‘remove item when bought’ is enabled on the vendor trigger
    • HIGH performance improvement on wrappers when animating and scrolling ~100+% performance increase
    • UIShowValueModel performance improvements
    • Collections now auto repaint all wrappers at game start, to allow for leaving lorem ipsum text in the wrapper design
    • InventoryItemUtility now has a method to convert rows to items with stack size + option to break it up into smaller stacks
    • Added color to stats -> Icon also follows color
    • CharacterUI no longer requires categories, when category prefab is empty all items are placed in a single container
    • Skillbook example (mapped to key B) – fixes #99
    • Updated all demo scenes

    Fixes:

    • PlayMaker events fired 2 times fixed
    • Fix – Drop item stack size always reduced to 1
    • Fixed cooldown begins on game start
    • Fixed item editor category ID
    • equippable field editor bug fix (equip types were offset)
    • Trigger error bug fix
    • Updated item database (empty row in crafting result)
    • Warnings and fixes for Unity 5.3
    • Create item from model – Needs to be instance object (Unity 5.3+) fixed.

    Known issues:
    • Sorting with layout items can sort in ways that all items won't fit, which makes items disappear
     
    julianr, Superjayjay and hopeful like this.
  40. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,684
    Awesome-er!!! :)
     
  41. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    And more great news, Inventory pro has been selected for another 24h sale!
    Mark thy calendars with January the 13th - Inventory Pro sale!
     
    tequyla likes this.
  42. r3nrohan

    r3nrohan

    Joined:
    Sep 28, 2015
    Posts:
    33
    okie, Well in Item Property editor, i put base start value as 0 and max value as 100 and ticked on use in stats, next i had set apple to restore 30 points.Also do mind I have my own stats script too. Now i had script like this
    void Update() {
    var myPlayer = InventoryPlayerManager.instance.currentPlayer;
    var myCollection = myPlayer.characterCollection;
    if (myCollection != null)
    {
    i_health = (int)myCollection.GetStat("Player", "Health").currentValueRaw;
    }
    t_health = aplayer.a_health + i_health; // aplayer.a_health is from my custom stat
    }

    When i use sword or equipment it adds up finely,i_health maximum value is set as 100 as sword property , thats what i want.
    Now when i use potion or food, not equipping, it increases till max value becomes 100 as set in item property editor. I am totally lost
     
  43. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    void Update() run every frame so if your game run at 60 fps per sec you are making your player eat 60 apples per second
     
    hopeful likes this.
  44. Uto

    Uto

    Joined:
    Nov 10, 2014
    Posts:
    17
    Is it possible to change mouse item pickup button for right or middle button?
     
  45. r3nrohan

    r3nrohan

    Joined:
    Sep 28, 2015
    Posts:
    33
    apple/consumable item is used per click so update() is not the problem. Its item property editor set up, base value and max value, apple restore the base value until it reach max value, which later increase currentvalueraw. So if my max value is 0 it doesnt recover,
     
  46. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The item click is handled using the OnMouseDown (A unity MonoBehaviour method). You could override this and it's behavior (override and leave blank), then add an OnMouseOver (called continiously), and check with Input.GetMouseButtonDown() to check if a mouse button is pressed.

    For this you'd have to override the ObjectTriggererItem and add it to each item. I could also add a setting to the next update. Could you create an issue at bitbucket for this?
     
  47. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The stats have the following values:

    baseValue (starting value)
    currentValueRaw (the value that is added on top of the final stat)
    maxValue (the maximum value of the stat)

    The *raw is the value before any multiplications, for example, a stat with 100 health and a +10% health bonus will have the following values:

    baseValue = <Whatever you've set in the editor>
    currentValueRaw = 100 (before multiplications)
    currentValue = 110 (+ 10% health boost)
    maxValue = 110 (+ 10% health boost)
    maxValueRaw = 100 (before multiplications)

    The current value is calculated as follows: (baseValue + currentValueRaw) * currentFactor * currentFactorMaxValue

    In most cases you'll want to use the non-raw versions of the stat values, as these represent the final values.

    And finally, in V2.3.2 the stats got an interface, allowing you to implement your own stats, only adding a dependency on the Inventory Pro interface (IInventoryCharacterStat).
     
  48. BuckeyeStudios

    BuckeyeStudios

    Joined:
    Oct 24, 2013
    Posts:
    104
    would you be able to do a tutorial on how to use Inventory Pro if you have (Dialog System & UFPS ) already working using
     
  49. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    What exactly would you like to see? Could you give an example how you'd like to see the 3 system together?
     
  50. tequyla

    tequyla

    Joined:
    Jul 22, 2012
    Posts:
    335
    hello,

    impressive work !!

    compliant with plygame, always ?

    +++