Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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
    I've added support for stats in properties in the (currently pending) version. I intend to work more on the stats, as they are a quick and easy way to fully customize your items.

    A tooltip per category isn't currently possible, but you can of course override the InfoBox class and add your own implementation, it's a singleton and runs without any references, so it's easy to modify :)
     
  2. westingtyler

    westingtyler

    Joined:
    Dec 7, 2013
    Posts:
    34
    Question: in the default inventory menu, what do you mess with to change the scale of the item icon slots? I changed on setting by increasing it to 80x 80, but now the slots remain the same size and just have giant buffer margins all around them. The same thing happens in the Bank, too, and I can't find anywhere to actually scale the item slots themselves, regarding the ones that create themselves at run time based on how many the inventory can hold. Regarding the ones in the skillbar and the ones in the equipment screen, they were easy to scale, but I can't figure out where to scale the others. Any clues?
     
  3. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    could you add in docs an example "extend the infobox" ?
    If i create an item with [InventoryStat] public int StatA and in the editor a "StatB" the tool tip will show StatA only but the "Character_Status_row_PFB" will show StatB only i have no clue on how to edit Infobox after line 225. could you make a tutorial to selectively display the stat we want on both prefabs? for example if i have these stats:
    Code (CSharp):
    1. public class EquipableNodeItem_Passive : EquippableInventoryItem
    2. {
    3.     [InventoryStat]
    4.     public int ShieldRegen;
    5.  
    6.     [InventoryStat]
    7.     public int EnergyRegen;
    8. }
     
    Last edited: Jun 10, 2015
  4. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    work in 5.1
     
  5. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    If you're running into a Unity 5.1 compiler error message try the following:

    Replace line 40 in JsonCollectionSerializer.cs with:

    var dict = (IDictionary<string, object>)Devdog.InventorySystem.Integration.SimpleJson.SimpleJson.DeserializeObject(json);

    The currently pending update has this fix already applied.
     
    julianr likes this.
  6. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    This is probably caused by the grid layout in / on the containers. Inside the Inventory and bank there's a container object, on it is a grid layout component that displays all the icons in a grid. On it, you'll find the size of the icons, change that, and it should work :)
     
  7. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yep, sure thing I'll write some documentation on this as soon as I get home, as a quick tip, all data for the tooltip is retreived through the GetInfo() method, which you can of course override. Check the EquippableInventoryItem's buildin GetInfo() for a quick sample.
     
  8. ChrisSch

    ChrisSch

    Joined:
    Feb 15, 2013
    Posts:
    763
    Thanks, and sorry for the late reply. I was swamped with my own assets, and didn't have time to experiment more with this. As I understood, and did what you explained, I haven't the slightest idea how to just generate a random number of one item. I'm so bad at understanding and interacting with other people's code, especially this advanced. I'll keep trying when I have time. Worst case scenario I'll wait for jorisshh to implement it as a feature. xD
     
  9. takapi

    takapi

    Joined:
    Jun 8, 2013
    Posts:
    79
    Last edited: Jun 10, 2015
  10. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Tried all day but not getting any luck to get my looting up and running. I'm having a lootwindow and an inventory window as childs of my canvas. When I'm in range of the treasure chest and click on it the lootwindow is displayed with the generated items. However clicking the items or the all button doesn't do anything. It looks like the mousedown isn't triggered. Running the demo works fine though so I must be missing something but can't grasp what exactly.
     
  11. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The wrapper prevents the item from scrolling. If you were to "scroll" with a drag, while the cursor is on a button it will trigger the button's action. You can enable this behavior by removing the "Image" component on the wrapper, don't forget to duplicate the wrapper first, move it to a safe spot (outside of the InventorySystem's folder), and then remove the component, and lastly assign it to the collection.
     
  12. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Most likely there are no inventories assigned to your player. Since version 2.1.3 a InventoryPlayer script is required. In this component the character collection as well as the inventories are set, this was done to allow multi-character support :)
     
  13. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Indeed linking the InventoryWindow to the InventoryPlayer does fix the looting. I was so focused on the link between the loot and the inventory I forgot the actual player. Should have been nice (and time saving) if there was a warning in the console of a player not having an inventory assigned.
     
  14. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I've updated the video and added a notification in it, I'll also add some safety nets in the following update, thanks :)
     
  15. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Good afternoon . You are working on the integration of UFPS Multieplayer? when to expect ?
     
  16. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    It's currently pending in the asset store, with some luck it should be up before the end of the week :)
     
  17. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    I understand you correctly , what you have already done it ? ! And it will update to a new ?? If so, it's very cool . I've been waiting for this ))) I'm happy ) )
     
  18. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yep :) all done, should be live soon
     
    julianr likes this.
  19. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    im trying to add skill bar, i have setup the UI skill bar in my canvas and filled all the variables,then i add in inventory Manager my skill bar in SkillbarUI editor variable, when i run the scene the variable is automatically set to null and i have this error:

    NullReferenceException: Object reference not set to an instance of an object
    Devdog.InventorySystem.InventoryUIItemWrapperReferenceSum.Repaint () (at Assets/InventorySystem/Scripts/UI/UIItemWrappers/InventoryUIItemWrapperReferenceSum.cs:33)
    Devdog.InventorySystem.SkillbarUI.Awake () (at Assets/InventorySystem/Scripts/UI/Windows/SkillbarUI.cs:52)

    it look like in InventoryManager.cs the line 61:
    instance.skillbar = _currentPlayer.skillbar;
    is the problem as i instanciate my player i cant have its own reference, will i break things if i do this?:

    if(!instance.skillbar)
    instance.skillbar = _currentPlayer.skillbar;
     
    Last edited: Jun 11, 2015
  20. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Great asset! Nice work. I like that you are supporting UFPS and other asset integrations! I've not installed it yet, but can you switch off the walking into items to pickup and only allow mouse cursor pickups? Is there a line of code to change, or a checkbox in the editor?
     
  21. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    there is option on every window of the inventory to "block UFP input" this will block wasd key movement and camera rotation, then by default click on loot will pick them up, but you can also add option for pickup on collider with player or press a key to pickup
     
    julianr likes this.
  22. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Did you assign the skillbar to the InventoryPlayer component on your player? Had similar issue yesterday with the looting and saw a field available for assigning a skillbar.
     
  23. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    no as i said my player is instanciated so it cant reference variable inside the scene before being created. but checking if the current slot for the skill bar is not empty before changing it just fixed the problem
     
  24. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Alternatively you could have a look at: http://devdog.nl/unity/forums/viewtopic.php?f=4&t=31 written by one of the Inventory Pro users, it's a nice solution :)

    I've also added dynamic searching for scene elements for the InventoryPlayer component in the update. That way you can define the path to the skillbar, and the player will "search" for it when it's instantiated.
     
  25. Mark Henderson

    Mark Henderson

    Joined:
    Oct 25, 2013
    Posts:
    41
    messing with quantity is very easy.

    Just add in an "item.currentStackSize = Random.Range(1, maxQuantity);" before the item is added to the return array

    Code (CSharp):
    1.  
    2.             item.currentStackSize = Random.Range(1, maxQuantity);
    3.  
    4.             // Using the item, add it to the result array
    5.             toReturn.Add(item);
    6.  
     
  26. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Any idea on how to start to implement tooltips for the items in the inventory? I can't seem to get those up and running as I don't know where to start to look for.
     
  27. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The default tooltip or InfoBox works as a separate component. You can find it in your scene under Canvas > InfoBox. If you want to add custom behavior to the tooltip you can override it and replace the InfoBox script with your own :)

    I've also updated the documentation, at the bottom you'll find a sample on how to override the GetInfo() for custom item types.
    http://devdog.nl/unity/document/extending-code/custom-item-type/
     
  28. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Downloading the new version of Inventory Pro now ... :)
     
    jorisshh likes this.
  29. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Woh it's live cool :)
     
  30. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Cool)))))))
     
  31. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    i deleted old folder of inventory and added the last update then i have this now:
    Assets/InventorySystem/Scripts/Integration/UFPS/ItemTypes/EquippableUFPSInventoryItem.cs(8,7): error CS0246: The type or namespace name `plyGame' could not be found. Are you missing a using directive or an assembly reference?

    ps: i have ufps but no PlyGame

    edit i had to delete the ufps integration folder to get rid of errors on last update but now i lost the ufps features, feel that something went wrong with last update and ufps
     
    Last edited: Jun 12, 2015
  32. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Ah damn it :(, sometimes VS auto completes what you type and completely messes up, and ads a wrong namespace. Anywho, to fix:

    Go to the EquippableUFPSInventoryItem.cs file (double clicking the error should do it), and remove line 8 which says:

    using plyGame;

    Delete that line and it should all work again, sorry for the inconvenience..
     
  33. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    Another vote for 5.1 Multiplayer (UNET). We have authoritative inventory working with Bolt, but a bit confused how to do the same with UNET. This kit working with 5.1 Unity Multiplayer would be a great reference for us! (and an instant buy :)
     
    chiapet1021 likes this.
  34. livio3d

    livio3d

    Joined:
    Feb 17, 2009
    Posts:
    145
    hi Jorisshh,
    after last update on unity 5.1 i take this error :
    NullReferenceException: Object reference not set to an instance of an object
    Devdog.InventorySystem.CharacterUI.UpdateCharacterStats (Boolean repaint) (at Assets/InventorySystem/Scripts/UI/Windows/CharacterUI.cs:212)
    Devdog.InventorySystem.CharacterUI.Start () (at Assets/InventorySystem/Scripts/UI/Windows/CharacterUI.cs:153)


    i add this line as check (if(l.count != 0)) and the error is gone but if i buy an item from vendor i cannot see it in my backpack .
    Any idea someone?
     
  35. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Hm.. did you assign the stat formatter in the settings? If you go to your settings / Other there's a field for a CharacterStatFormatter (there's one in the demo folder).

    I've been meaning to add safety nets for this sort of thing, so I'll be sure to add this to the next sprint.
     
  36. livio3d

    livio3d

    Joined:
    Feb 17, 2009
    Posts:
    145
    ok this help me with the error but i notice a strange thing, if i buy an item from vendor, this finish on my bank and not on my backpack
     
  37. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Please check your InventoryPlayer, it has references to the inventories that belong to that specific player. Perhaps you've set a reference to a bank? Let me know if this resolves the issue, if not, I'll start searching :)
     
  38. Mark Henderson

    Mark Henderson

    Joined:
    Oct 25, 2013
    Posts:
    41
    Imported the update, worked through a couple errors already mentioned here, then ran into this

    ItemCollectionBase is last changed on 6/11/2015. InventoryUIUtility is last changed on 4/30/2015

    *Edit* the function is defined in Devdo.InventorySystem.UI.InventoryUIUtility. I assume this error comes from me not deleting old files?

    Just as a note for future upgrades - once someone has customized a bunch of stuff, having files move around during an update becomes a royal pain to integrate. Please try to settle on a folder structure and not move files around for patch updates.
     
  39. Loishtc

    Loishtc

    Joined:
    Oct 19, 2013
    Posts:
    32
    I cant set the BD path.
    BTW in the upfs scene im not able to freeze the screen to use the inventory.
     
  40. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    66
    @jorisshh Hi, i just updated to latest version and got 1 error when i enable UFPS and UFPS MP integration

    Assets/InventorySystem/Scripts/Integration/UFPS/ItemTypes/EquippableUFPSInventoryItem.cs(8,7): error CS0246: The type or namespace name `plyGame' could not be found. Are you missing a using directive or an assembly reference?

    EDIT:Also i have a missing prefab in booth UFPS scenes
     
    Last edited: Jun 12, 2015
  41. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Ah, yup, I'm working on a fix, it might take a few minutes, but just so you know I'm on it :)
     
    julianr likes this.
  42. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - I'm having the same issue on UFPS, plus I can't select any of the tabs on the Main Manager (using any demo) using unity 5.1
     
  43. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - on the UFPS demo, when you pick up a weapon it places the ammo in the inventory, but doesn't show the weapon in the inventory slot, or hotbar. When you press 1, the weapon is equipped. (Unity 5.1)
     
  44. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522

    Please paste the following method in the SettingsEditor.cs (line 118) (InventorySystem/Scripts/Managers/Editor/InventoryEditors/Settings)

    Code (CSharp):
    1.         public override void Draw()
    2.         {
    3.             #region Path selector
    4.  
    5.             //InventoryEditorUtil.ErrorIfEmpty(EditorPrefs.GetString("InventorySystem_ItemPrefabPath") == string.Empty, "Inventory item prefab folder is not set, items cannot be saved! Click Set path to a set a save folder.");
    6.             if (EditorPrefs.GetString("InventorySystem_ItemPrefabPath") == string.Empty)
    7.                 GUI.color = Color.red;
    8.  
    9.             EditorGUILayout.BeginHorizontal(InventoryEditorStyles.boxStyle);
    10.  
    11.             EditorGUILayout.LabelField("Inventory Pro prefab save folder: " + EditorPrefs.GetString("InventorySystem_ItemPrefabPath"));
    12.  
    13.             GUI.color = Color.white;
    14.             if (GUILayout.Button("Set path", GUILayout.Width(100)))
    15.             {
    16.                 string path = EditorUtility.SaveFolderPanel("Choose a folder to save your item prefabs", "", "");
    17.                 EditorPrefs.SetString("InventorySystem_ItemPrefabPath", "Assets" + path.Replace(Application.dataPath, ""));
    18.             }
    19.  
    20.             EditorGUILayout.EndHorizontal();
    21.  
    22.             GUI.color = Color.white;
    23.  
    24.             #endregion
    25.  
    26.             base.Draw();
    27.         }
    Which should fix your problem :)
     
  45. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    This is likely because the save path is not set, the editor doesn't permit actions while it doesn't have a save folder. See the post above to resolve the issue.
     
    julianr likes this.
  46. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
  47. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    66
  48. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Ah yep, here you go:

    Go to the EquippableUFPSInventoryItem.cs file (double clicking the error should do it), and remove line 8 which says:

    using plyGame;

    Delete that line and it should all work again, sorry for the inconvenience..


    Could you give me the name / path of the object that has the missing prefab?
     
  49. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    that fixed it - thanks! one other issue is the cursor is not allowing drag and drop, UFPS takes over.. is there a camera override?

     
  50. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I wasn't able to reproduce the problem, could you please check the InventoryAndCharacter object (it's under Canvas/InventoryAndCharacter) and make sure the block ufps input is check under UIWindow (see screeny)