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. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    66
    Its j
    Its just a missing prefab in the scene, there is no components attached to it so i cant tell what it was
     
  2. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    @jorisshh - all good now, it lost the ufps integration and did not show Block input, but switched it back on and applied it.
     
  3. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    think it was a random loot box
     
  4. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    So, all good now :) ?
     
    julianr likes this.
  5. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    yes thanks. Just need to work out saving to a web server (I have Easy2Save already) never used it before. I've mainly created my own inventory saving via BestHTTP to a php/mysql server.
     
  6. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    66
    One more question. Is it ok when i play UFPS MP Scene the Demo UI and Inventory UI merges?Like at the start with login screen there is a hotbar/skillbar and a notice window.
     
  7. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    66
    Some feedback about UFPS MP. When one player drops any item on the floor it does not spawns for another player.
     
  8. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    It would certainly be an interesting project :) I've been taking a look at UNet it seems really (REALLY) promissing, especially if you compare it to the old Raknet implementation :p

    I'd like to go with a secure (master) server approach, this way you can use it for a survival game, a FPS, or even a MMO (in theory though :))
     
  9. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Dropping unit types (ammo) doesn't work for me, however weapons appear to be dropped correctly?
     
  10. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    sounds good :) Using sockets? Client - > Server, with the master server or game server saving inventory states for all players every 15 or so seconds to a database. Maybe a locks and keys system to prevent hacking.
     
  11. livio3d

    livio3d

    Joined:
    Feb 17, 2009
    Posts:
    145
    find, i resolve my problem setting backpack Collection Priority to 100
     
  12. ChrisSch

    ChrisSch

    Joined:
    Feb 15, 2013
    Posts:
    763
    It gives me an error.
    Code (CSharp):
    1. PlantsController.cs(77,38): error CS0266: Cannot implicitly convert type `int' to `uint'. An explicit conversion exists (are you missing a cast?)
    I tried a different way, to check against the apple identity and then if its true add it, but I always get an empty loot window. Nothing gets generated.

    Code (CSharp):
    1. public InventoryItemBase[] Generate(int minAmount, int maxAmount)
    2.         {
    3.             List<InventoryItemBase> toReturn = new List<InventoryItemBase>(maxAmount);
    4.            
    5.             // Get all items defined in my database
    6.             InventoryItemBase[] allItems = ItemManager.instance.itemDatabase.items;
    7.            
    8.             // Iterate through each item
    9.             foreach(InventoryItemBase item in allItems)
    10.             {
    11.                 if(item.ID == 0)
    12.                 toReturn.Add(item);
    13.             }
    14.            
    15.             result = toReturn.ToArray();
    16.             return result;
    17.         }
    And override it with:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using Devdog.InventorySystem;
    4. public class Plant : TreasureChest
    5. {
    6.     public override void CreateGenerator ()
    7.     {
    8.         var generator = new PlantsController();
    9.         itemGenerator = generator;
    10.        
    11.         if(generateItems)
    12.         {
    13.             itemGenerator.Generate(minAmount,maxAmount);
    14.         }
    15.     }
    16. }
     
  13. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    i have an error with ObjectTriggererItemUFPS on this line Collider:

    Code (CSharp):
    1.   public void TryGiveToPlayer(Collider col, int amount, bool fireEvents = true)
    2.         {
    3.             //m_Depleted = false;
    4.             Amount = amount;
    5.  
    6.  
    7.             if (ItemType == null)
    8.                 return;
    9.  
    10.             if (!Collider.enabled)
    11.                 return;
    I replaced if (!Collider.enabled) with col.enabled and it just worked
     
  14. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    disapointed like always with mobile control it's open keyboard of sell one item
    no drag and drop buy and sell when click Use Context Menu
    nothing happen when try buy


    so i can't desactive context menu

    please make real Mobile version sample optimized with drag and drop
    remember 90% of game is now mobile or got mobile version
     
    Last edited: Jun 13, 2015
    Tiny-Tree likes this.
  15. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909


    don't understand why got invotory is full ?
     
  16. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Buying items using the context menu works fine for me, and what do you mean by I can't disable it? In the settings you can choose to disable the context menu (Main editor / settings / context menu / )
    Perhaps there's an empty object in the "Disable when active" array in the settings (see image)



    As for the dragging / dropping, is this what you meant?


    Constructive feedback is always welcome :)
     
  17. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Did you assign the inventory window to the character (InventoryPlayer component)? If none are set the system can't find empty slots, hence assume it's full.
     
    Last edited: Jun 13, 2015
  18. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    will check
    dragging / dropping for buy / sell
    what's call context menu ? i talking about confirm menu for sell or buy count
     
  19. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    NullReferenceException: Object reference not set to an instance of an object
    Devdog.InventorySystem.InventoryPool`1[Devdog.InventorySystem.UI.Models.NoticeMessageUI].Get (Boolean createWhenNoneLeft) (at Assets/InventorySystem/Scripts/Other/InventoryPool.cs:54)
    Devdog.InventorySystem.NoticeUI.AddMessage (Devdog.InventorySystem.Models.InventoryNoticeMessage message) (at Assets/InventorySystem/Scripts/UI/WindowsOther/NoticeUI.cs:125)
    Devdog.InventorySystem.Models.InventoryNoticeMessage.Show (System.Object[] param) (at Assets/InventorySystem/Scripts/Other/Models/InventoryNoticeMessage.cs:47)
    Devdog.InventorySystem.ItemCollectionBase.AddItem (Devdog.InventorySystem.InventoryItemBase item, ICollection`1 storedItems, Boolean repaint, Boolean fireEvents) (at Assets/InventorySystem/Scripts/Other/ItemCollectionBase.cs:1065)
    mywin.Love () (at Assets/mywin.cs:287)
    UnityEngine.Events.InvokableCall.Invoke (System.Object[] args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:137)
    UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:601)
    UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:743)
    UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:53)
    UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:35)
    UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:44)
    UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:52)
    UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerClickHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)
    UnityEngine.EventSystems.EventSystem:Update()
    here

    gg.AddItem (GameObject.Instantiate<InventoryItemBase> ( myItem ));

    gg.RemoveItem( p1 ,(uint)1);
    gg.RemoveItem( p2 ,(uint)1);

    where gg is public ItemCollectionBase gg;
     
  20. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Is the gameObject which contains the ItemCollectionBase enabled? The only way this can really go wrong, is if the ItemCollectionBase has never been enabled, and therefore never had the chance to create the pool object.
     
  21. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Good afternoon . I have exactly the same mistakes . - Do not pick up weapons , and displays a message . The above was written decision. But when I put the code in liniyu118 but I get even more errors. Write more than , what, where , to address these shortcomings . Thank you again for everything.
     
  22. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Another question . I have already set the player on it , and added a lot of things . If I put all the scripts in it, then it will work ? You just lying in your player with a name change. Or do I have to start from that change prefab ?
     
  23. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    after check it's look disaper from the inventorymanager at start so i make quick refix

    http://puu.sh/intp0/305ea30ae5.png

    ok here please ! i got CharacterUI use 2 head container drag and drop item working on pc
    (edit after retry cant move any item position in same inventory so it's not somethink's about characterUI and container type )
    and not working anymore on mobile
    feel construct feed back coming trolling
    but understand this working in last version
     
    Last edited: Jun 13, 2015
  24. UsefulWeapon

    UsefulWeapon

    Joined:
    Oct 26, 2013
    Posts:
    66
    Would be really cool if you can implement building system like in many survival games (rust, ark, etc.) or integrate inventory pro with building system asset
     
  25. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    I have a critical error NullReferenceException: Object reference not set to an instance of an object
    Devdog.InventorySystem.BasicItemGenerator.Generate (Int32 minAmount, Int32 maxAmount, Boolean createInstances) (at Assets / InventorySystem / Scripts / Other / BasicInterfaceImplementations / BasicItemGenerator.cs: 138 )
    Devdog.InventorySystem.LootableObject.CreateGenerator () (at Assets / InventorySystem / Scripts / Other / Triggerers / LootableObject.cs: 123 )
    Devdog.InventorySystem.LootableObject.Awake () (at Assets / InventorySystem / Scripts / Other / Triggerers / LootableObject.cs: 71 )
     
  26. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Fixed in the upcoming version, you can quickly fixing it by adding the following code to the BasicItemGenerator.cs

    // Paste this at line 85, just after (var item = generatorItem.item;)
    if (item == null)
    continue;
     
  27. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    When will the next update ? It may be early how to fix all defects ??
     
  28. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Fixing all bugs as we speak, I'll try to push an update as soon as possible
     
  29. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    any idea about mobile ? :-;
     
  30. Loishtc

    Loishtc

    Joined:
    Oct 19, 2013
    Posts:
    32
    I think that i need a comprehensive step by step guide to UFPS + Inventory Pro. The standard scene dont work very well, i made custom machine gun and ammo, and when i loot the machinegun, the ammo dissappears from the world and a lot of errors and warnings all the time.
     
  31. Loishtc

    Loishtc

    Joined:
    Oct 19, 2013
    Posts:
    32
    NullReferenceException: (null)
    UnityEditor.SerializedObject..ctor (UnityEngine.Object[] objs) (at C:/buildslave/unity/build/artifacts/generated/common/editor/SerializedPropertyBindings.gen.cs:72)
    UnityEditor.Editor.GetSerializedObjectInternal () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:151)
    UnityEditor.Editor.get_serializedObject () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorBindings.gen.cs:144)
    Devdog.InventorySystem.Editors.InventoryEditorBase.OnEnable () (at Assets/InventorySystem/Scripts/Other/Editor/InventoryEditorBase.cs:23)
    Devdog.InventorySystem.Editors.InventoryItemBaseEditor.OnEnable () (at Assets/InventorySystem/Scripts/Items/Editor/InventoryItemBaseEditor.cs:39)
    Devdog.InventorySystem.Editors.EquippableInventoryItemEditor.OnEnable () (at Assets/InventorySystem/Scripts/Items/Editor/EquippableInventoryItemEditor.cs:23)
    Devdog.InventorySystem.Editors.UnitTypeUFPSInventoryItemEditor.OnEnable () (at Assets/InventorySystem/Scripts/Integration/UFPS/Editor/UnitTypeUFPSInventoryItemEditor.cs:22)
     
  32. takapi

    takapi

    Joined:
    Jun 8, 2013
    Posts:
    79
    I want to foreground the Window that mouse click.
    I was corresponding.

    To 210 lines of UIWindow.cs

    rectTransform.SetAsLastSibling () ;,

    To 32 rows of DraggableWindow.cs

    transform.SetAsLastSibling ();

    In this way, the window will not be in the foreground until you drag.
    When I click on the window, I want to be in the foreground.

    Another
    About treasure chest
    It becomes like a photo when an item is on a lot in the treasure chest.
    I want to display by scrolling through the items in the Loot window.

    Are there any other good way?
     

    Attached Files:

  33. Loishtc

    Loishtc

    Joined:
    Oct 19, 2013
    Posts:
    32
    When will be a update? This asset need a lot of fixes and better documentation, seems to be very powerfull, but i cant use it in the actual "bugeverywhere" status. I bought the asset because i liked the web demo and i need an inventory system for UFPS for a survival like game, with inventory, skill bar, looting and crafting, but this asset dont get the job done. I add my vote for more modular build.
     
    matteo-piccioni likes this.
  34. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522

    You can add a scrolling rect to the UI, I've used this in the inventory window, so you should be able to copy most :)
    I'll also add an option to "focus" a window and bring it to the foreground once the user clicks it.
     
  35. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Currently fixing all bugs and aiming to push the update before the end of the week.
     
    Loishtc likes this.
  36. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    766
    Hi Joris,

    I was wondering why you made the Default Slot Icon mandatory in the latest update. I've setup my UI where I don't need the default slot icon and the image component of my Item prefabs only need the item icon (this allows me creating nice borders for the slots etc). However with the latest update I'm forced to fill in the default slot icon and when clicking the sort of the inventory all unused icentory slots are ... hmmm sowhat screwed up as teh Image component now get the default icon. Basicly this breaks my code that checks the Image component on NULL values resulting in the wrong code path for my UI code.

    Otherwise keep up the excellent work as you system is a real timesaver (was building my own but testing yours does reveiled a lot of potential of you asset so I customizing yours instead ;-))

    PS: not filling in teh default slot icon doesn't break any code though, only the visual red is your UI is suggesting otherwise. (maybe a future update will?)
     
  37. blunty

    blunty

    Joined:
    Dec 14, 2012
    Posts:
    7
    Feel i must say that you are doing a great job Joris , dont be pushed in to releasing updates before your happy with them.

    To the guys calling for "ALL bug fixes , FIX now" please remember this guy is working his arse off on this project , he has already achieved more than his competitors , and if you want it faster then maybe start writing some community code instead of whining.
     
    TeagansDad and julianr like this.
  38. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    I have since written two changes from the top there is 4 errors
    Assets / InventorySystem / Scripts / Integration / UFPS / Multiplayer / InventoryMPUFPSPickupManager.cs (39,30): error CS0246: The type or namespace name `ObjectTriggererItemUFPS 'could not be found. Are you missing a using directive or an assembly reference?
    Assets / InventorySystem / Scripts / Integration / UFPS / Multiplayer / InventoryMPUFPSPickupManager.cs (40,19): error CS1061: Type `object 'does not contain a definition for` TryGiveToPlayer' and no extension method `TryGiveToPlayer 'of type` object' could be found (are you missing a using directive or an assembly reference?)
    Assets / InventorySystem / Scripts / Integration / UFPS / Multiplayer / InventoryMPUFPSPickupManager.cs (53,58): error CS0246: The type or namespace name `ObjectTriggererItemUFPS 'could not be found. Are you missing a using directive or an assembly reference?
    Assets / InventorySystem / Scripts / Integration / UFPS / Multiplayer / InventoryMPUFPSPickupManager.cs (56,27): error CS1061: Type `object 'does not contain a definition for` Amount' and no extension method `Amount 'of type` object' could be found (are you missing a using directive or an assembly reference?)
     
  39. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I've actually gotten rid of the default slot icon in the settings, it's now managed through the wrapper's prefab. The starting icon (the icon that's visible in the prefab) is cached in the wrapper to restore after the item was removed ( in the character window for example, there are custom icons like a gray glove icon, that is restored once the item is removed from it )

    In the next update it should work out of the box, if you set up the prefab correctly ( empty sprite for the item icon, and a background sprite for the border ), then when you move the item it will restore the empty sprite, hence clear it :)
     
  40. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Thanks blunty :), indeed working hard on this asset, and this can be a bit of a demotivator, But I do have to admit that my last update could have been a lot better...

    So I'll do my best to resolve the issues as soon as possible, can't do much more than that ^^
     
    Last edited: Jun 14, 2015
    julianr and blunty like this.
  41. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Is there a class "ObjectTriggererItemUFPS" in your code base at all? If not, something like went wrong during upgrading, and a quick re-import will likely save most of your trouble.
     
  42. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    This is a editor error, you can fix this by simply restarting your Unity editor.
     
  43. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Mobile
    I was finally able to fix all mobile issues, due to Unity UI's design choices (or maybe it's a bug?) OnterPointerEnter / Exit are not registered on mobile devices, even when the pointer is down. I've rewritten this part and manually added raycasting, this adds some GC to the runtime, but not to worry this will only happen in the editor, once you build your game the GC allocations will be gone :)

    Plus I've added drag accepters, these allow you to drop an item on the character (not a specific slot) and it will auto. equip it to the best slot. This same mechanic can also be used on the vendor, dragging an item onto the vendor to sell it.


    Just got to fix some UFPS multiplayer behavior, once done I'll push the update with these hotfixes. ( A thing to note, I started the refactoring / moduralizing, so some things might be a bit out of place )
     
    Loishtc and hopeful like this.
  44. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Thanks for continuing to plug away at all the bug fixes. :)

    BTW, it seems like the next thing after this round of fixes would be better properties for items or trying to make the system more modular. I don't know what this means, really.

    Everywhere I look in my game, it seems I need inventory management ... something not a whole lot different from what you already provide, but maybe different enough that I probably can't quite do it with the system as is.
     
  45. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yep properties are certainly the next step, as well as the more modular build, I've already started working on them, properties are now considered in the character's stats ( optional of course ), and I'll also add properties to consumable, that way, when an apple used that restores 50 health (which is a property) it will restore that amount. This way you'll have full control and can make potions, weapons, etc. without having to write a single line of code :). And the cool thing, it merges with the code, so even if you have a module or plugin that adds stats it will merge with the properties.

    But what do you mean by Inventory management, always open to suggestions? ( I will likely build in spreadsheet loading / saving in the future, for simpler balancing, and so forth )
     
  46. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    realy fix all mobile issues Amazing ! :)
     
  47. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    really impatient to try next update, do you have an estimation for the release?
     
  48. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Exporting the package now to do a clean test run in an empty project, if it's all good I'll push it right away :)

    Also, working on Unit tests and going more towards TDD, to make sure this doesn't happen again ^^
     
  49. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Alrighty the new version has been upload and is currently pending review.

    Upgrading to the new version
    The ShowObjectTriggerer has been renamed to ObjectTriggererHandler, and will have to be re-added to your scene.
     
    Loishtc likes this.
  50. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    do you have any update log for this version ?