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
    You can set the mobile action in the settings
     
  2. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    This could be done in several ways; I'd suggest checking the category of the item to define it's behavior. You could also create a custom item type and add the skills and animations to it there ( http://devdog.nl/documentation/creating-a-custom-item-type/ ).

    If you're using something like playmaker, it may be easiest to check the item's category and give your players a set of animations that way.
     
  3. florianbepunkt

    florianbepunkt

    Joined:
    Nov 28, 2015
    Posts:
    45
    Awesome! Sounds rather cool. If you can add crafting stations to the docs or do an video about it, this would be helpful. Learned a lot about the system from your tutorials on IP.
     
  4. YIsDaRumGone

    YIsDaRumGone

    Joined:
    Jan 8, 2016
    Posts:
    19
    Sounds awesome and way better than my changes :)
    I'm sure you've been asked a million times, but do you have an ETA on the next release? Days, weeks, a month or two? I'm just curious if I should bother moving forward with more of my crafting changes or move on to one of the other items on my list.

    Thanks again!
     
  5. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Tonight probably :p Almost done with the sci-fi UI design, for which I made some small Inventory Pro changes. Keep in mind that Unity usually needs up to 5 days to validate the asset before it goes live :)
     
    florianbepunkt likes this.
  6. YIsDaRumGone

    YIsDaRumGone

    Joined:
    Jan 8, 2016
    Posts:
    19
    Oh wow, way sooner than I expected. You the man!
     
  7. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    And the changes for 2.4 - Should be on the asset store in a few days :)

    New:
    • Playmaker scene udpate
    • Updated playmaker actions + new actions (now use playmaker variables) fixes #170
    • loot window now has currency fields (currency no longer placed as items, but in special UI element)
    • Player death support ( player.NotifyPlayerDied() ) -> Creates drop object with all items and currencies (fixes #164)
    • OnTriggerUnUse renamed to OnTriggerUnUsed and OnTriggerUse to OnTriggerUsed
    • Item utility helper methods to enforce max stack size (splits stacks)
    • LootUI hide on empty
    • Removed "force save in collection" for crafting
    • TryAdd for counter now handles items exceeding max stack
    • itemCollectionBase.isEmpty (checks items and currencies)
    • interface for key triggerer (skillbar wrappers) instead of enforced type
    • Updated plyGame + UIWindowField allows to search for windows dynamically (by window name)
    • plyGame scene update + plyGame skill item type
    • Disabled equippableFields are now ignored. - Allows creator to programmatically enable / disable fields. (Example: allowing the player to unlock another equip field) fixes #167
    • InventoryPlayerSpawner can now move the player to the spawn position on scene start
    • New crafting system (Allows to share progress between instance, category or as a singleton). + Reward collections to store the items into (Beta).
    • Convert UIWindow to UIWindowInteractive button in editor
    • PlayMaker changestat action added - fixes #178
    • canPutItemsInCollection notification in adder
    • Trigger stat affector now uses coroutines to avoid a lot of inactive Update calls
    • CanUnEquipItem for equippable item types to allow for overloading
    • InventoryItemBase cooldown has been moved to NotifyItemUsed - Item won't go into cooldown until this is called.
    • Changed all craft events to new CraftInfo + Crafting system now shares the progress containers properly between crafting stations
    • Sync collection now just copies all wrappers without requiring another collection (only wrappers move)
    • Crafting UIModels methods renamed to Repaint instead of Set for consistency
    • Crafting categories now have icons
    • Item categories now have icons
    • New InventorySceneUtility that handles deprecation's
    • Audio manager ignores mixer group of other managers are not present in the scene.
    • Collection restrictions are enforced on vendor to avoid strange set ups
    • Looting update, no longer requires specific looting type
    • playmaker fsm's AddCurrency
    • Cleaned up dialogs

    Fixes:
    • Unstack problem fixed (fixes #165)
    • Fixed characterUI Drag bug
    • InventoryManager lists not initialized before awake
    • Color and sprites for character stats fixes #173
    • Consumable items that couldn't be stored were used when "Use move to bank" was enabled.
    • onShowActions invoked twice on UIWindow's fixes #181
    • Stat affector update, wasn't fired when OnEnter wasn't used
    • skillbar unlimited usage fixed
    • Sync collection - copy wrappers back to original collection ( fixes #180 )
    • Fixed controller support scene + trigger visualizer now doesn't stutter / blink anymore
     
  8. thedreamer

    thedreamer

    Joined:
    May 13, 2013
    Posts:
    226
    Do you plan to make Fantasy Inventory UI Skin..
    I know You are making Sci-FI UI..

    But I need Fantasy Style
     
  9. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Maybe in the future, it's on my list of 'possible to-do's', but I haven't got any definitive plans to create one yet. I've already got most code in place to build a nice UI, so that would be a bit of a time saver :)
     
  10. r3nrohan

    r3nrohan

    Joined:
    Sep 28, 2015
    Posts:
    33
    ohkay, I was able to use ca
    ohkay, I was able to use category.name {one_handed, two_handed, etc...} but there is also type{sword,shield,helmet}, which code to use access the "type".

    Thanks Again
    tegory.name {one_handed, two_handed, etc...} but there is also type
     
  11. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I.. I'm not sure I'm following :p But if you want to get the type of an item you can just use the C# .GetType() method.
     
  12. r3nrohan

    r3nrohan

    Joined:
    Sep 28, 2015
    Posts:
    33
    oh my mistake, that was blunder, I meant type as seen in figure as helmet.
     

    Attached Files:

  13. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Ah my bad :). You can get the equipment type from all equippable items. If your item is of type InventoryItemBase you'll have to cast it upwards to EquippableInventoryItem. For example:

    var equippable = myItem as EquippableInventoryItem;
    if(equippable != null)
    {
    // It's an equippable item type
    Debug.Log("Equip type is: " + equippable.equipType);
    }
     
  14. shwa

    shwa

    Joined:
    Apr 9, 2012
    Posts:
    461
    Hi,
    I bought this a while back. Would Inventory Pro work for the following situation.

    Scene with an empty living room and kitchen.

    User can choose a 3d model of a chair or object from the inventory system.
    Drag or drop it into the scene.
    Then, move it around.

    rinse repeat with other objects.

    thanks.
     
  15. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Well, certainly it's possible, but this would of course require some custom coding.
    I suggest the following:

    • Create a new custom item type ( http://devdog.nl/documentation/creating-a-custom-item-type/ ).
    • Override the Drop() method, which will be called when you drag it onto the world. Optionally you can also override the Use() method, which is called when the item is used through a click, skillbar, etc.
    • Use raycasting (camera to worldspace from cursor position) and place the item.

    There are building systems in the asset store that might make this simpler, although it's not to hard to build it yourself :)
     
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Version 2.4 is now in the asset store. :)
     
    danreid70, jorisshh and YIsDaRumGone like this.
  17. FlameFalcon

    FlameFalcon

    Joined:
    Jun 24, 2014
    Posts:
    1
    Would be nice for it to support both types. As In what if I want it to be a 3D object, many games have it as a collectable. Including my one, so can I re-enable the 3D object, since can't add a 3D object to it now. So I would stay with the version below 2.4, because of this change, instead of supporting both?
     
  18. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Hello,

    I've recently started using this system and I have to say its fantastic, really good layout and user friendly. I followed the video tutorials and have made a good start but iv hit a snag when trying to make a 2d equipable items. When I create it I complete all the properties in the main item script but it keeps saying that the item doesn't have a triggerer but the triggerer is on the item (automatically applied when creating the item). Am I missing something or is there a step by step guide to making an equipable item. The video tutorials seems to be on a earlier version of the system so cant follow them exactly.

    *Update*
    I've just been checking through the various inventory pro information and now realised that perhaps 2D functionality may not actually be included at the moment? Is it possible to have items that are strictly 2D sprite based as my character is a 2D character rigged using puppet2D. I had a look through the triggerer script and it seems to only handle 3d objects (although my coding skills are pretty minimal so perhaps I'm mis-reading it). Would it be possible for me to edit the script to handle 2D colliders or would this break everything?

    Thanks

    Alex
     
    Last edited: Feb 10, 2016
  19. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Here's an image of the issue I'm having for the post above No Trigger.png
     
  20. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    It's referring to a colider (trigger), that isn't found on the object. Meaning that the item cannot be looted, as it can't be clicked or detected without a collider. I'll update the error message as it's a little misleading.

    Edit: Updated the editor, the warning wasn't accurate, it didn't scan for 2D colliders; Besides that the looting / click handling should work fine. Can you try adding a 2D collider to the object and try it?
     
    Last edited: Feb 10, 2016
  21. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    You can still use a lootable object, however when the items are in the loot window they don't show up as an item in the list, but instead are shown in a field at the bottom displaying the currency amount. That's the only thing that changed :).

    You could of course override the LootUI window and re-add the items to the list.
     
  22. YIsDaRumGone

    YIsDaRumGone

    Joined:
    Jan 8, 2016
    Posts:
    19
    On the CraftingWindowStandard and CraftingStandardTriggerer, what is MainItemsCollection and CraftingItemsCollection?
    EDIT: Looks like it's only used for the Layout Crafting mode? Is that correct?

    Another EDIT after tinkering with the new changes for a couple hours:
    Do you have plans to continue work on this crafting station portion of IP? If so, do you have a list of things you're going to work on? I ask because there's a few other things I'd like to add/customize myself, but if you are planning on it anyways I won't bother.
    Here are a few things I've noted that I'd like to do:
    1. A window to show the crafting queue, along with the ability to cancel a specific item(s) in the queue.
    2. An input collection. Items would be pulled into this from the inventory when the craft button is clicked rather than on craft completion. This would prevent the player from accidentally removing things in their inventory that are going to be used up in the current craft cycle. Option to show in the UI or just have it behind the scenes on the progress container.
    3. Another Input, this one for fuel. For example your campfires, have an item fuel requirement of wood, and this is slowly burned and diminished overtime. Fuel would be required to turn it on and it won't work unless it has some type of fuel.

    I also wanted to say kudos! This asset is becoming more and more awesome, and I see it being an integral inventory and crafting solution for my project (dream) :)
     
    Last edited: Feb 11, 2016
  23. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Awesome, thanks for your prompt response. Strangely I did have a 2d collider on the object with the trigger set to true but I guess the update will fix the issue. I'll grab the update when I get home from work and give it another try.

    *Update*
    Double checked that my prefab item has a 2D collider on it which it does. Don't seem to have any updates available to download, is it pending with Unity? I also tried adding 2 colliders, 1 trigger, 1 non-trigger but that didn't work either, still getting the "Drop Object has no triggers...." message. Hopefully this isn't just me being an idiot, are you able to make 2D items and drop them into a 2d world/pick them up?
     
    Last edited: Feb 11, 2016
  24. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522

    1. Currently not in the list of future features; It might be a little to specific and a little hard to keep configurable for those who don't want to use it. If you'd like to implement this, there's a crafting queue in the progress container that you can use for this :).

    2. The main collection can actually be used for this; For the layout collection the main collection is used to detect the blueprint, as well as draw items from it. On the standard crafting the main window is used to remove items from. If this is not set it will use the inventories instead.

    3. Not planned, but not to hard to implement, all methods are marked virtual in the crafting triggerer allowing you to override them.

    And, thanks :p :)
     
  25. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    I've fixed it in the repo, but haven't pushed it to Unity yet; It takes up to 4-5 days for Unity to validate assets, so I only push them once very month or so; Which is also nicer for all users, it would be quite annoying having to update every day :p

    Is the equipment working besides the error in the item creator? When you equip an item does it give any errors, warnings? Does it actually equip?

    (Most likely the colliders bug the player controller, this is something I've also fixed for the next version).
     
  26. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    danreid70 likes this.
  27. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Ahh cool, yeah that makes sense :)

    Haven't been able to pick up an item because of the issue, so not been able to equip anything. I'm at work at the moment but when I get back I'll log all and any errors and let you know. Thank you for excellent customer interaction. Also your sci-fi UI looks fantastic.

    *Update*
    Booted up this morning to test it out. Everything is fine now, I still get the "Drop object no trigger" warning which you've fixed in the repo but other than that everything is working perfectly. I can create items and position them on the character without any issue. I must have been doing something wrong the other day when trying. I have the feeling I hadn't assigned a sprite to my items sprite renderer, because it was empty when I looked today so I added a sword sprite and then I could click on it and add it to inventory. Anyways all's well sorry for causing any unnecessary confusion.
     
    Last edited: Feb 13, 2016
  28. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    As I mentioned above my previous issue is all resolved now so I can equip items. Now that I'm equipping items I have a new question. Say I have "Warriors Shoulders" as an armour piece, is there a way to combined 2 separate shoulder items (i.e. left and right shoulder) so that when I right click to equip the "Warriors Shoulders" both the right and left shoulder piece equip to their correct position and rotation. Same would apply for legs ect. Also if I wanted the arms to be more than just 2 pieces would I be able to have a single item which when equipped would do both left and right shoulders along with left and right forearms?
     
  29. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Good afternoon . Update to the latest version of Asset . There were two mistakes . He writes that he can not be found a reference to the trigger. But what and where? It seems to do all the same. Trigger Range Ui I had not stood . How to resolve these errors ? 2 problem - the player does not find containers !
     

    Attached Files:

  30. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Nice :)
    Currently there's no way to equip 2 items using a single item; Optionally you could of course create a custom item type ( http://devdog.nl/documentation/creating-a-custom-item-type/ ), and add some items to your player on equip.
     
  31. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    If you're dynamically instantiating you either have to use the Inventory Pro Player spawner, or manually fill the equipment bindings; The reason this can't be automated is because the connections don't exist before instantiating the player;

    Lastly, you could also create an object structure like so:

    Local player prefab (root) < Instantiate this
    - Interface (Canvas object)
    - Player (Inventory Player)

    This way the interface will remain connected, as all connections are managed within the prefab.
     
  32. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342

    About I understand you spawn . But how to solve 2 other errors ? screen attached .
     
  33. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Your InventoryPlayer isn't set; Because the player is marked as "Is dynamically instantiated" it will never initialize. You can either manually call player.Init(), or un-check the "Is dynamically instantiated".
     
  34. Alex3333

    Alex3333

    Joined:
    Dec 29, 2014
    Posts:
    342
    Now everything is clear . I actually forgot to remove a tick . Thanks for the support ! I have a question . in a problem is you have to do . - Synchronization objects in UFPS. Will this task is done in the next update ?
     
  35. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Cool I think I see what you mean. So I make a new item type i.e. "dualEquipableItems" and then inside the script I make room for 2 public gameObjects. Then in the .Use() function I tell it to run the .Use() of both the public objects. Then I just assign 2 normally created equipable objects into the public gameObjects I made in my new "dualEquipableItems"?

    This may be a really dumb question but once I have my custom item type script how do I access another items .Use() from the .Use() of the item type I'm creating?
     
    Last edited: Feb 14, 2016
  36. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    578
    Hi, im having so many problems with ufps mp setup, i've copyed what you had in ur scene to a new scene, if i use the singleplayertest then i can pickup items no problem and the treasure chest shows ufps items, but when i use the menu to load mp when i pickup a item i get some error not set up object, and when i open treasure chest the items are not ufps.
    I looked more into ur demo and there are loads of dummy objects with some script on them, so i put that script to the main menu gamemodes, but that didn't work.
    Does the inventory work for mp? The demo scene is so untidy and lots of missing objects its very hard to understand anything.
     
  37. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522

    You could do something like:

    public class MyItemType : EquippableInventoryItem
    {
    public EquippableInventoryItem itemA;
    public EquippableInventoryItem itemB;

    public override int Use()
    {
    int used = base.Use(); // base.Use() will call NotifyItemUsed when used.
    if(used < 0)
    return used;

    int usedA = itemA.Use();
    int usedB = itemB.Use();
    if(usedA < 0 || usedB < 0)
    {
    return -2; // Couldn't use item
    }

    return 1;
    }
    }


    P.s. Using an array would obviously be nicer if you ever want to equip 3 items :)
     
  38. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Missing objects? Such as? None should be missing. Did you enable the integration in the integration manager?
    Also, what errors are you getting? (+ stack trace please)
     
  39. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Thanks very much, that makes perfect sense. I'll test it out later, I think your right that using an array would be the best option so I can control how many items need adding. With regards to that do I just create

    Public EquippableInventoryItem[] itemsRequired;

    then use a foreach() to utilize the .Use() for all the items?

    also with regards to the "return -2; //Couldn't use item":
    Do I return a -1 for each item e.g. return the minus length of the array?

    Sorry for all the questions, I'm not terribly great at scripting so only understand it on a basic level.
     
  40. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Yep, using a foreach should do the trick :)

    The return value is a 'code', the different uses are in the code; See the current use codes below, note that more might be added in the future if needed.

    /// <summary>
    /// Use the item, returns the amount of items that have been used.
    /// (n) the amount of items that have been used.
    /// 0 when 0 items were used but there is still an effect (like a re-usable item that doesn't decrease in stack size)
    /// -1 when the item is in cooldown
    /// -2 when the item cannot be used.
    /// When overriding this method, do not forget to call base.Use();
    /// <b>Note that the caller has to handle the UI repaint.</b>
    /// </summary>
     
  41. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Ahh brilliant, I should have checked the documentation, thank you for explaining the codes. I'll try it all out later :)
     
  42. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Had a couple busy days so only just got round to trying this, I'm having trouble accessing "EquippableInventoryItem" class. Says I'm either missing a using directive or assembly reference? Sorry if its a dumb question like I mentioned before I only know a bit of scripting.
     
  43. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    You'll need :

    using Devdog.InventorySystem; // You need this namespace for all Inventory Pro things.
     
  44. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Ahh yeah, Id just been looking at your pre-existing classes and figured it out, was heading on here to let you know. Thanks for your prompt response anyway though. I have to admit what you've created is an amazing piece of work. I may have had a couple of questions but that's just my inexperience showing and you've answered them very quickly. Everything else is very well laid out and user friendly especially for such a complicated area of game design, definitely a 5 star review from me.
     
  45. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Another quick question still on the multi item script. With regards to the array so far I have:

    public EquippableInventoryItem[] items;

    public override int Use()
    {
    int used = base.Use();
    if(used < 0)
    return used;

    foreach(?????? in items)
    {
    ??????? .Use();
    }

    foreach(?????? in items)
    {
    return -2;
    }

    return -1;
    }

    I've tried different things where I have ??? but I haven't had much luck yet, are you able to tell me what needs to go in those spots or am I going about it incorrectly?
     
  46. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    This should do the trick :) - Simply use all the items. Currently I'm storing all the return values in an array as well, although this isn't really necessary, as the action should always succeed.

    I've also added the CanUse() method, which checks if both items can be equipped in the first place.

    public EquippableInventoryItem[] items;

    public override int Use()
    {
    int used = base.Use();
    if(used < 0)
    return used;

    var itemUseReturns = new int[items.Length];
    for(int i = 0; i < itemUseReturns.Length; i++)
    {
    itemUseReturns = items.Use();
    }

    return -1;
    }


    public override bool CanUse()
    {
    bool canUse = base.CanUse();
    if(canUse == false)
    return false;

    foreach(var item in items)
    {
    if(item.CanUse() == false)
    {
    return false;
    }
    }

    return true;
    }
     
  47. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Thank you for your help, Iv been away for a couple days so only just got round to trying the script. I have 1 small problem on the following line: "itemUseReturns = items.Use();"
    'EquippableInventoryItem[]' does not contain a definition for 'Use' and no extention method 'Use' accepting a first argument of type......
    I'm using the namespace Devdog.InventorySystem, do I need to reference something else?
     
  48. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Whoops, that should of course be:

    itemUseReturns = items.Use();
     
    Last edited: Feb 23, 2016
  49. Collrain

    Collrain

    Joined:
    Oct 27, 2012
    Posts:
    45
    Still the same issue, sorry I'm probably being really dumb but I copied and pasted your line over the top of the problem line and its the same?
     
  50. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Ah :/ Unity's forum doesn't like sub i very much it should be
     
    hopeful likes this.