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

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Thank you jorisshh.

    I just have put your asset in my to buy basket :)
     
  2. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522

    Much appreciated :), Also sit tight for the huge update with vendor and crafting support coming in a few days ^^
     
  3. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Ladies and gentleman I present to you, the pending review :)
    Vendor System
    Crafting System (2 types)
    Notification center
    + much more


    You can try the new demo at devdog.nl/unity/inventorysystem/

    P.S. Keep in mind, because of a lot of re-factoring and a lot of new features bugs will be present. The faster they're reported, the faster I can fix them :D
    I'll sum up a list of new features tomorrow.
     
    Joens likes this.
  4. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    awesome.... just tell me when.
     
  5. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    For the setup I'll record some editor videos in the upcoming days on how to integrate it into your own project, as well as showing of all features.
     
    Joens likes this.
  6. charles01

    charles01

    Joined:
    Mar 28, 2013
    Posts:
    25
    Hey, Can you integrate with Core GameKit please looks great and will work well with your asset :)
     
  7. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    What kind of integration / features were you thinking of? As far as I can tell they have pooling (so does the InventorySystem) and global variables to modify without scripts and some utility features to simplify fast development?
     
  8. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I've also added a 2nd demo with a completely different UI, just to show off how customizable it really is :).
    Right clicking an item will slide in the context menu from the right.


    This uses the exact same code as the following UI, not a single change made in code, all configured through the editors :)
     
    twobob likes this.
  9. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    I know this is probably a stupid question but...

    if the UI was shown on an Android screen at tiniest resolution and rotated, how do you see the menus working.
    I guess I am asking "Do you support Long Press instead of Right Click".

    Looks amazing btw
     
  10. charles01

    charles01

    Joined:
    Mar 28, 2013
    Posts:
    25
    Was just thinking how it will be possible to connect your inventory with Core GameKit adding values to the equipment, The have a world variable for creating health, coin, exp etc. Am not sure if am explaining it right :)
     
  11. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yup, full mobile support, you can choose your own custom triggers for mobile devices (See image below).


    And optionally you can enable the context menu to add your own custom actions :)
     
    twobob likes this.
  12. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I see, I'm currently working on PlayMaker support, after which I think I'll start on UFPS (as it is likely a super easy integration), after that I'll be sure to look into Core GameKit integration.
     
  13. charles01

    charles01

    Joined:
    Mar 28, 2013
    Posts:
    25
    Ok np.
     
  14. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I've written the following PlayMaker features, if you like to request some features, please do so now :)

    Currently written PlayMaker features:
    Add item to any collection
    Add item to inventory (auto. picks the best collection based on restrictions and priority)
    Crafting enable / disable a blueprint (learning / unlearning a blueprint)
    Drop an item / Pickup an item
    Open / Close treasure chests
    Set the items in a collection (removes previous items)
    Set items for vendor (everything a vendor has for sale)
    Show / hide any UI window, like character screen, vendor, bank, inventory, dialogs, etc.
    Show a notification message
    Use an item

    If you want to see more features, let me know
     
  15. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Because I have very little patience, and because the asset hasn't been approved by the Unity asset team, I decided to look for other alternatives :).

    You can now purchase the fully updated version with crafting, vendors, etc, with the full 40% discount at:

    https://sellfy.com/p/NZix/

    A discount requires a share (when you click the purchase button), so if you're anti-social, and don't wish to share (this awesome asset) you can get a share free version at https://sellfy.com/p/NZix/-LAUNCH_PARTY/

    Updates can be uploaded immediately to Sellfy, so faster iterations and a bigger discount ^^
     
    Last edited: Mar 28, 2015
  16. charles01

    charles01

    Joined:
    Mar 28, 2013
    Posts:
    25
    Is it possible for you to mail does that already got it the update if they sent you the invoice ? and i don't use play maker is there folder i can delete or not import ?
     
  17. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I wrote a little processor directive, so the PlayMaker code won't be compiled unless you have the PLAYMAKER keyword in your scripting define symbols (Which it doesn't by default). I'll write a small tutorial for this once I officially support the package.
     
  18. charles01

    charles01

    Joined:
    Mar 28, 2013
    Posts:
    25
    Ok,
    ?
     
  19. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,363
    I tried to buy in Sellfy but it says the receiver cant accept payment at this time.
     
  20. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yeah, sorry about that, Paypal blocked my account because of "suspiciously high activity"... Luxury problems I suppose :)

    Working on it though, I'll let you know when it's fixed.
     
  21. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,363
    Thanks
     
  22. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    So - bit of feedback for future googlers.

    if you receive the error:

    Code (csharp):
    1. Assets/InventorySystem/Scripts/UI/ContextMenu/InventoryContextMenu.cs(117,24):
    2. error CS1061: Type `Button' does not contain a definition for `onClick'
    3. and no extension method `onClick' of type `Button' could be found
    4. (are you missing a using directive or an assembly reference?)
    This means you have imported InventorySystem into a project that uses the - now outdated - Beta Sample Assets package, having just done this myself I can advise you that it would be better to rip the main guts of your stuff out into a completely new project than to bother trying to disentangle the mess.

    This is /not/ an InventorySystem error per se, simply a result of - ME - relying on the Beta Asset structure :) (Although to be fair it did say BETA - heh - mea culpa) not being too dissimilar from the shifting sand that is the ironically named multi-versioned un-standard Standard Assets structure. Needless to say it is not similar enough :D

    It would not hurt to directly namespace the call within IS to a UnityEngine.UI.Button as this would prevent other packages - of which there have to be more than a few - that declare "Button" in a non-safe way, doing the same damage to your logic.

    so I guess public UnityEngine.UI.Button button; would be enough? (whenever it was typed)

    Hope this saves someone else some time
     
    Last edited: Mar 29, 2015
  23. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I've renamed the button fields to UnityEngine.UI.Button to avoid any future problems, it was a quick fix. I suppose the UI / logic separation comes into good use now :)
     
    Last edited: Mar 28, 2015
    twobob likes this.
  24. takapi

    takapi

    Joined:
    Jun 8, 2013
    Posts:
    79
    Hi,jorisshh. :)
    I bought this asset at https://sellfy.com/p/NZix/ yesterday.
    This asset is very GREAT.
    I'd like to ask you a favor.
    I have produced 2d type game.
    Would you like to implement 2d type example for this asset's user?
     
  25. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
  26. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    There is actually going to be a sale on the asset store, but Unity hasn't approved the asset yet, it takes up to 5 days...
    So far I've integrated PlayMaker, as well as EasySave2 (Not live in the asset store yet!), uFPS is on the planning. I contacted the uFPS developer for a package to develop with (I don't own a uFPS copy, so..) but he didn't respond yet, I'll try again today.

    Cheers,
    Joris
     
  27. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Glad you like it, and yes an example is certainly possible, what kind of game / style / genre were you thinking of?
     
  28. takapi

    takapi

    Joined:
    Jun 8, 2013
    Posts:
    79
    Hi, jorisshh
    Thank you for your reply. :)
    My produced game is 2d type game like UO(Ultima Online).
    My game has been connected to the network by Photon PUN+.
    If it is possible, I want inventory system like UO. :)
     
  29. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Hey Take,

    I don't see anything out of the ordinary, as far as I can tell all these features are available right out of the box. A 2D gamestyle doesn't directly have any dependencies on the Inventory system.

    Networking is not build in (it's on my research list), but considering the event driven architecture it should be really easy to build in networking.
     
  30. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    I too would like the thought of networking... I use Photon.
    Pushing around inventory items to other players, and - possibly - browsing the inventory/cash/objects of others.
    "Basic stuff" would be enough to get us all going on doing our own, more specific, stuff.
     
  31. takapi

    takapi

    Joined:
    Jun 8, 2013
    Posts:
    79
    Hey jorisshh.
    Thank you for your reply. :)
    Would you like to include Unity 2D mode example scene in addition to 3D example scene ?
     
  32. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I certainly could, but to be honest with you I don't see the added benefit of this for the Inventory system. I could just copy all the UI elements, and paste them in a 2D scene.
     
  33. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Does seem a bit moot

    click thing 2d - 2.5d - 3d - system is same
     
  34. BornGodsGame

    BornGodsGame

    Joined:
    Jun 28, 2014
    Posts:
    587
    How easy to convert to a weight based inventory rather than slots?
     
  35. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Noted, I'll look into networking possibilities soon, Unity did announce a new networking system in Unity 5.x check http://blogs.unity3d.com/2014/05/12/announcing-unet-new-unity-multiplayer-technology/ . Then again when Unity announced the uGUI system it took them ~3 years to finish it, so....
     
  36. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    You want to prevent the user from adding items when the inventory has reached a certain weight?
    If so, easy peasy, check the code below.

    Code (CSharp):
    1. public class MyInventoryUI : InventoryUI
    2. {
    3. protected float maxWeight = 10.0f;
    4.  
    5.     public override bool CanAddItem(InventoryItemBase item)
    6.     {
    7.         bool canBase = base.CanAddItem();
    8.         if(canBase == false)
    9.             return false;
    10.  
    11.         return MyCheckWeightMethod(item);
    12.     }
    13.  
    14.     /// Sets an item directly
    15.     public override bool CanSetItem(uint slot, InventoryItemBase item)
    16.     {
    17.         bool canBase = base.CanSetItem(slot, item);
    18.         if(canBase == false)
    19.             return false;
    20.  
    21.         return MyCheckWeightMethod(item);
    22.     }
    23.  
    24.     protected virtual bool MyCheckWeightMethod(InventoryItemBase item)
    25.     {
    26.         // Add your custom weight method, all items have a weight variable by default
    27.         float weightSum = 0.0f;
    28.         foreach(var i in items)
    29.         {
    30.             if(i.item != null)
    31.                 weightSum += i.item.weight; // (multiply by i.item.currentStackSize if you want to include stacks)
    32.         }
    33.  
    34.         if(weightSum + item.weight > maxWeight)
    35.             return false;
    36.  
    37.         return true; // All good
    38.     }
    39. }
     
    Last edited: Mar 30, 2015
  37. takapi

    takapi

    Joined:
    Jun 8, 2013
    Posts:
    79
    Is "public MyInventoryUI : InventoryUI" a new script named MyInventoryUI.cs ?
    Otherwise, where should I write?
     
  38. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    anywhere (within reason). The "Scripts" folder would be a good place.
    The class will be compiled and picked up once it is made.

    You would then use this derived class in place of the inherited class in the "relevant" place(s).
     
  39. takapi

    takapi

    Joined:
    Jun 8, 2013
    Posts:
    79
    oh, thanks I get it.
    twobob, how you wrote? :)
     
    Last edited: Mar 30, 2015
  40. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    i believe you cant make a generic function, the way i did it using photon was like this, user can send request to server to change their own inventory, they do not change it in their instance. then server serialise the list of INT (object ID) and all set the inventory depending on this list, this is how UFPS multiplayer do it too, it best against cheats
     
    twobob likes this.
  41. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Aye. all my stuff would be anti cheat toolkit-ed up.

    Oh.. YEAH! possible integration Anti-Cheating Toolkit ;)

    heh.
     
  42. takapi

    takapi

    Joined:
    Jun 8, 2013
    Posts:
    79
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4. using Devdog.InventorySystem;
    5.  
    6. public MyInventoryUI : InventoryUI
    7. {
    8.  
    9.     public override bool CanAddItem(uint slot, InventoryItemBase item)
    10.     {
    11.         bool canBase = base.CanAddItem();
    12.         if(canBase == false)
    13.             return false;
    14.      
    15.         return MyCheckWeightMethod(slot, item);
    16.     }
    17.  
    18.     /// Sets an item directly
    19.     public override bool CanSetItem(uint slot, InventoryItemBase item)
    20.     {
    21.         bool canBase = base.CanSetItem(slot, item);
    22.         if(canBase == false)
    23.             return false;
    24.      
    25.         return MyCheckWeightMethod(slot, item);
    26.     }
    27.  
    28.     protected virtual bool MyCheckWeightMethod(uint slot, InventoryItemBase item)
    29.     {
    30.         // Add your custom weight method, all items have a weight variable by default
    31.         float weightSum = 0.0f;
    32.         foreach(var i in items)
    33.         {
    34.             if(i.item != null)
    35.                 weightSum += i.item.weight; // (multiply by i.item.currentStackSize if you want to include stacks)
    36.         }
    37.      
    38.         if(weightSum + item.weight > maxWeight)
    39.             return false;
    40.      
    41.         return true; // All good
    42.     }
    43. }
    44.  
    45.  
    Assets/InventorySystem/Scripts/MyInventoryUI.cs(6,22): error CS8025: Parsing error
    What would be the best thing to do?
     
  43. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.UI;
    4.  
    5. namespace Devdog.InventorySystem
    6. {
    7.  
    8. public class MyInventoryUI : InventoryUI
    9. {
    10.  
    11. public override bool CanAddItem(uint slot, InventoryItemBase item)
    12. {
    13. bool canBase = base.CanAddItem(item);
    14. if (canBase == false)
    15. return false;
    16.  
    17. return MyCheckWeightMethod(slot, item);
    18. }
    19.  
    20. /// Sets an item directly
    21. public override bool CanSetItem(uint slot, InventoryItemBase item)
    22. {
    23. bool canBase = base.CanSetItem(slot, item);
    24. if (canBase == false)
    25. return false;
    26.  
    27. return MyCheckWeightMethod(slot, item);
    28. }
    29.  
    30. protected virtual bool MyCheckWeightMethod(uint slot, InventoryItemBase item)
    31. {
    32. // Add your custom weight method, all items have a weight variable by default
    33. float weightSum = 0.0f;
    34. foreach (var i in items)
    35. {
    36. if (i.item != null)
    37. weightSum += i.item.weight; // (multiply by i.item.currentStackSize if you want to include stacks)
    38. }
    39.  
    40. if (weightSum + item.weight > maxWeight)
    41. return false;
    42.  
    43. return true; // All good
    44. }
    45. }
    46. }
    Perhaps just compare it to some of the other classes if you are unfamiliar with c#.

    that should work.
     
    Last edited: Mar 30, 2015
  44. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    edit: Well for some reason taka deleted his question.. which was

    " Another error that maxWeight is missing. "

    that's right.

    Since it doesn't exist...

    You would define it as a variable and then set it...

    Add a float maxWeight = 5;
     
    Last edited: Mar 30, 2015
  45. takapi

    takapi

    Joined:
    Jun 8, 2013
    Posts:
    79
    Hi, twobob.
    Sorry and very thanks. :)
     
  46. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Code (csharp):
    1.  
    2.  
    3. public class MyInventoryUI : InventoryUI
    4. {
    5.  
    6. public float maxWeight = 50; // or something
    7.  
    8.  
    It's fine. It will just take you a VERY long time learning to program "here"
     
  47. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    looking at that...

    Assets/InventorySystem/Scripts/MyInventoryManager.cs(15,30): error CS0115: `Devdog.InventorySystem.MyInventoryUI.CanAddItem(uint, Devdog.InventorySystem.InventoryItemBase)' is marked as an override but no suitable method found to override

    Since there is no single argument method in the base class.

    so it should have been
    Code (csharp):
    1.  public bool CanAddItem(uint slot, InventoryItemBase item)
    2. {
    3. bool canBase = base.CanAddItem(item);
    4. if (canBase == false)
    5. return false;
    6.  
    7. return MyCheckWeightMethod(slot, item);
    8. }
    if that is what was intended.
     
  48. takapi

    takapi

    Joined:
    Jun 8, 2013
    Posts:
    79
    Hi, twobob. :)
    Thank you very very much.
     
  49. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    No problem.
    Hope that gets you started...

    He posted pseudo-code, it was just a few syntax issues.
     
  50. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    The Sellfy problem should be resolved and the asset can be purchased again. We're back in business :)
     
    twobob likes this.