Search Unity

S-Inventory: Equipment, Crafting, Skill Bar, Item Groups, Containers & Merchant (C# & JS)

Discussion in 'Assets and Asset Store' started by OussamaB, Jul 29, 2013.

Thread Status:
Not open for further replies.
  1. HelixU4

    HelixU4

    Joined:
    Jan 25, 2013
    Posts:
    61
    Really looking forward to the update! :)

    Btw, is it possible to have random items in a chest with item groups?

    Like you specify what items the chest contains and what percentage each item has a chance of spawning in the chest?
    Could also make like a max items to spawn so if you have a item list of 20 it can only spawn the max you specify.
     
    OussamaB likes this.
  2. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    302
    any updates on ufps integration?
     
  3. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Awesome, thank you so much for taking the time to improve an already neat product, especially given the other constraints on your time. :)
     
    OussamaB likes this.
  4. thenamesace

    thenamesace

    Joined:
    Jan 25, 2014
    Posts:
    157
    Hi guys ...small problem when i drop anything small say "Ammo" out of the inv it falls through the map? so i cant pick it up again any ideas?.....and how do i change where the object spawns in relation to the player?
     
  5. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Sounds like a great idea! I'll add it to my to-do list. Thank you.
     
  6. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    It's planned but not any time soon (maybe next month). Sorry.
     
  7. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The ammo object must have a non trigger collider in order not to fall through the map.
    To change where the item spawns, open the "InventoryManager" script, search for the "DropItem" function then change this line: "CloneItem.transform.localPosition = Player.transform.localPosition;" to whatever you want the object to spawn at.
     
    thenamesace likes this.
  8. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Hey guys, I have started working on the update since two days as my schedule isn't very busy anymore. I literary spent the whole two days working on the update. It has been a lot of work but I managed to finish a lot of things. The good news concerning the update are that you will be able to customize the whole inventory system to your liking. You can customize the text, slots, buttons and everything in different windows however you want. I have also re-written a lot of the code in order to reduce memory and CPU usage.

    I have finished the inventory, equipment, skill bar and vendor menus for C# and JS but a lot of work is still waiting for me. Here's a screenshot:

     
  9. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Hello guys, I have finally finished the update! I've completed the container, crafting and item group UI (screen shots below). I have a few annoying bugs which I'm currently chasing and I still have to update the documentation on my website. So it might take one day or two. Thanks for your patience!

     
    thenamesace likes this.
  10. thenamesace

    thenamesace

    Joined:
    Jan 25, 2014
    Posts:
    157
    Any chance of adding in a Furness in a future update? i think it would be a great addition to the crafting aspect in this asset :)
     
  11. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Mind explaining what do you mean by Furness? Thanks!
     
  12. thenamesace

    thenamesace

    Joined:
    Jan 25, 2014
    Posts:
    157
    Ha my mistake i meant furnace! as in you could melt metal down and then add it back into the inv after a set time
     
    OussamaB likes this.
  13. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Interesting, this is definitely going on my to-do list. Thank you!
     
    thenamesace likes this.
  14. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I've been testing the update, improving the code structure and fixing bugs today. I have just started updating the documentation and the update will be submitted tomorrow. I will add a web player link so you can be able to check it out. A lot of new features will come in future updates so stay tuned and keep those amazing suggestions coming! Thanks for the support in the past weeks!
     
    HelixU4 and thenamesace like this.
  15. HelixU4

    HelixU4

    Joined:
    Jan 25, 2013
    Posts:
    61
    Can't wait :D
     
  16. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    I like this suggestion. My vote is for one of these variations:

    1. Space for a simple, static image that doesn't reflect what's equipped, like the screenshot below or this image.



    2. Or space where a separate camera or RenderTexture can render an actual 3D model like the screenshot below or the link in @Sendatsu_Yoshimitsu 's post.

     
  18. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Apologies to SoumiDelRio if this is a bit afield, but I'm curious if you already know of a good way to accomplish this, Tony? I've been looking at doing this for both menus and in-game models, the easiest method seems to be hand-rigging each item onto the model in advance, and disabling every article of clothing except for the one the player has equipped, but when your game has hundreds of equipables, this can be a pretty lousy way to waste memory.

    EDIT: Also I forgot to add, but when I did the paperdoll thing in ngui a while back, I hacked together a pretty simple implementation of the 2d version: I drew each item to character scale, and centered an empty UISprite where each piece of equipment needed to be drawn over the character. The icon for the equippable was just a scaled-down version of the wearable sprite, so the actual item class only needed to remember a single image, then when you dragged and dropped it drew itself twice, once in the item slot at around 50x50, and once over the character in whatever sprite layer that item slot was associated with.
     
  19. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    S-Inventory documentation has been updated! I'm currently uploading the update to the asset store.

    Actually, this is possible and easy to do with the new update. Equipment slots can be placed anywhere you want. Same thing applies for crafting, vendors, etc...
    As for having an actual 3D model, it requires some work and I'm currently very busy since I will start S-Quest uGUI update right after I finish this one.
     
    HelixU4 likes this.
  20. HelixU4

    HelixU4

    Joined:
    Jan 25, 2013
    Posts:
    61
    In the new update, can you make stuff happen when using consumables?
     
  21. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Mind explaining more? There are custom events called when items are added in the equipement or skill bar menu. You could use those maybe?
     
  22. HelixU4

    HelixU4

    Joined:
    Jan 25, 2013
    Posts:
    61
    Say I have a bread in my inventory and I rightclick it and select equip/use. Can you make custom events, like adding value to a global variable? Play sound etc.
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    @SoumiDelRio - A while ago, we discussed the possibility of a few additions to InventoryEvents.cs to support things like this. I don't know if you've had a chance to implement them, but they would be really helpful. I'll quote the request here for easy reference:

    May I request a few additions to InventoryEvents.cs?

    1. Would you consider using SendMessage() to notify other scripts when an event occurs? I understand you maintain UnityScript and C# versions, so I won't request C# events. This way, we can write handler scripts without having to directly modify InventoryEvents.cs/js.

    2. Please add events when the player picks up or drops items.

    3. If an Item's equipment slot is blank [meaning it's a usable/consumable, not an equippable item], would you send an OnItemUsed message when the player selects Use/Equip? This way, our code can handle usables as appropriate for our projects. For example, with the Realistic FPS Prefab integration, I'd like to be able to pick up a medkit and, at a later time, open my inventory and select Use/Equip to heal myself.​
     
  24. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    TonlyLi already suggested this a while back.

    The uGUI update only has been submitted, I need to finish S-Quest uGUI update first and then will continue working on these requests. S-Quest users have been waiting for the update since some time now. It won't take me much time since I'm now kinda used to how the new GUI system works. Besides, I'm on vacation right now so I have plenty of free time.

    EDIT: I forgot to mention that the web player has been updated as well.
     
  25. HelixU4

    HelixU4

    Joined:
    Jan 25, 2013
    Posts:
    61
    I know it's been suggested, thats why I was asking if this is possible with the new update :>
     
  26. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The next update will be available by next week. It will include all theses requests.
    The current update is still under review, if any of you would like to get it early, please PM me your e-mail along with your invoice number and I will send it to you.
     
  27. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Two quick suggestions, these might actually be in the API already, as they seem pretty useful, but if not:

    1) Add a function to the Container class that returns a list of every item inside of it, so you can query specific objects for their inventory without manually iterating through each slot.

    2) Loot tables for enemies, so the player can define a set of items from the inventory manager from which enemies randomly select when they drop loot.
     
  28. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    1) Mind explaining more? Isn't the function going to iterate over all container's slots then give you the list of items inside of it?
    2) This can be done with a little coding, create an item group prefab then instantiate it each time the enemy is dead or simply have it placed on the enemy object and enable it only when the enemy is dead. As for the randomly generating items, that's on my to-do list as it was suggested already.

    Thank you for these suggestions, please keep them coming!
     
    twobob likes this.
  29. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    You're right about both, I hadn't really considered if there was a more effective way to do #1... consider me impressed that you already have awesome stuff implemented before I even consider it. :)
     
  30. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Okay, so - - Just tested the 4.6 release.

    Performance: EXCELLENT
    Niggling erorrs: Now REMOVED.

    Great work!!!
     
    OussamaB likes this.
  31. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Awesome.

    Please consider rating and reviewing S-Inventory on the asset store guys!
     
    twobob likes this.
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    I'm sorry I forgot to reply! I think many games still rig all flexible items to the model in advance. Rigid items like helmets and swords can be childed to the model at runtime, so they don't need to be rigged. There's often a lot of re-use of flexible meshes, too. The same robe mesh can be textured and shaded 50 different ways to make 50 different equippables.
     
  33. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    That makes sense, thanks for the reply. :) You're basically talking about identifying the submesh for each type of clothing and turning it on/off coupled with texture and material swapping, right? Do you happen to know in general what the performance overhead for the disabled meshes tends to be? My big worry is ending up wasting a lot of memory remembering clothes the PC isn't wearing.
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    There's virtually no performance overhead, but of course it'll use memory. However, bringing it back to S-Inventory, you may need those meshes in memory anyway to show them in the inventory and/or shopkeeper windows, even if no characters have them equipped. I'll reply further in your other thread.
     
  35. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Hello, I just bought this asset because TonyLi created integration for it, meaning he vouches for this asset at least a little bit (I am a big fan of TonyLi's Dialogue System asset). I have some questions though:

    1. I would like to be able to drag an item from an inventory slot to an equipment slot (and vice-versa), but S-Inventory doesn't seem to support this functionality? This would seem to be intuitive behavior for most people, and was the first thing I tried to do.

    2. Can I disable ALL reliance on double-clicking or right-clicking and still have S-Inventory work correctly? I want to use this asset on mobile and make everything work with single-touch.

    3. Can I have the windows open up in the same place every time and not be movable? For example, character window on left half of screen, inventory window on right half of screen.

    Thank you!
     
    OussamaB likes this.
  36. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Also I see a small bug in the demo: when you click on an inventory item, which pops up a small menu saying Equip/Drop/Close... and then you move the inventory window, the small menu doesn't follow with the inventory window and just stays put where it is.

    Edit: Also, I can click through the inventory window to pickup items on the ground, even though I can't see them because they are blocked by the inventory window. Any windows that are visible should block clicks into the world behind (Unity 4.6 UI has a way for panels to block raycasts I believe)
     
  37. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Honestly, I would say not bugs, they are both "features" of the current design,

    I tend to agree they are "Bugging" if not "Buggy" and the way you suggest makes the most intuitive sense, Your latter point certainly.

    The sub-menu not moving is not that "surprising" to me [as a user], the click-through could actually be annoying.
    good catch
    :)
     
    OussamaB likes this.
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Hi @eridani - Moving from legacy Unity GUI to the new Unity UI is a big change, so getting everything implemented and polished in S-Inventory may take SoumiDelRio a little time. If you're using Unity UI, to fix the click-through issue add a CanvasGroup to the inventory window and tick Block Raycasts.
     
    OussamaB likes this.
  39. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    This is what would be intuitive for me... I think the easiest solution might be to just act as if "Close" was pressed if the user moves the Inventory window.

    Also, if the user clicks anywhere else on the screen besides on the submenu, act as if "Close" was pressed.

    In fact, maybe make the "Close" button optional. Less choices might be better for some users (the Apple strategy lol).
     
    Last edited: Dec 30, 2014
    TonyLi and OussamaB like this.
  40. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Hi Tony, the CanvasGroup thing was exactly it, couldn't remember what it was called, thanks.

    Regarding the dragging slots issue, I don't think it was possible to drag items from the Inventory to the Equipment screen (and vice versa) on earlier versions of S-Inventory either. I think SoumiDelRio would have to code brand new functionality to be able to drag items from one window to another.

    Anyway I hope he does so, because dragging items from slot to slot is totally intuitive for most people I believe... it's bound to cause some users confusion if you can drag an item from an Inventory slot to an Inventory slot, but arbitrarily can't drag an item from an Inventory slot to an Equipment slot.

    I completely understand that the slots are different programmatically "under the hood," but to users, the slots all look exactly the same, and therefore will probably be expected to function the same.

    If you own NGUI, there is a good demo scene where it demonstrates dragging items from inventory to equipment slots. InventorySlots and EquipmentSlots are both derived from the same Slot parent class, so items can be dragged between them with no problem. It would be a good example to study to get something similar working!
     
  41. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    1) Another user actually requested this yesterday and I added it as you can see in the gif below. I'm currently working on the same thing for the skill bar slots so that you can equip/use items by dragging and dropping them or by using the action menu and you can in-equip them by double clicking them or dragging them back to the an inventory slot.

    2) Yes you can do that by commenting two or three lines in the code. I'll be more than happy to do that for you.
    3) Yes, you just need to set their default position as you wish then don't check the "IsMovable" bool in the inspector.

    Thanks for reporting those bugs, It has been a little bit frustrating to convert everything to the new UI system as TonyLi said but I'll keep hunting those little bugs. Thanks for everyone else who has been helping me find bugs as well.

    EDIT: The update on the asset store will be delayed till I make sure it's bug-free.
     
  42. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Awesome, the dragging and dropping is looking fantastic. Which made me think of even more questions!

    1. Can you tell me what the behavior is if I drag an item and then drop it on an "invalid" spot, such as on a window title bar? Does it return back to the slot it was dragged from?

    2. What if I let go outside a window on the game world? Does it drop the item item to the ground (by spawning an object, etc)?

    3. What about if I drag a sword from the inventory and drop it on a wrong slot, such as the "head" slot? Does it try to find the appropriate "arm" slot automatically or does it simply return to the inventory?

    4. If I uncheck "IsMovable" for the windows, can I still position them EXACTLY where I want? For example, equipment window on the left half, inventory window in the upper right half.

    Thanks SoumiDelRio for your fast detailed replies! Keep up the great work.
     
  43. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    1) Yes.
    2) No, it returns back to the slot it was dragged from. But I can add this as an option. As for dropping items, you can choose between two types: spawning objects to the real world (allowing you to pick them up again) or destroying them completely.
    3) It simply returns it to the inventory.
    4) Yes.
     
    twobob likes this.
  44. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    1. It would be great to have this option. I think dragging a slot item onto the real world and having the real item spawn would be such a convenient way to drop items into the real world (or simply destroy them) without having to use a "Drop Item" submenu at all.

    2. Request for mobile: in addition to having the option of popping up submenu when an item is single-clicked, could you add the option of popping up the "stats tooltip" instead that shows the stats (weight, attack damage, condition, ammo inside, etc)? Either that or have a separate "stats window" that shows this information whenever a slot item is clicked or dragged.
    I know right now a tooltip window is shown OnMouseOver for mouse pointers, but mobile doesn't have an "OnFingerOver" feature so there needs to be an easy and intuitive way to show item stats for mobile users.

    3. I don't know how difficult this will be, and it's not really that important in my opinion, but how about when an inventory item is dragged, the appropriate equipment slots for it will light up, and possibly all inappropriate equipment slots will get dark/disabled/disappear... so that it's really clear where an inventory item can be equipped. Less confusion for "Apple-type" users.

    Thanks again!

    P.S. In case someone gets offended, I think Apple products are great, I use Apple, Android, Google, Samsung, Windows, Motorola products... I think all companies have pros and cons.
     
    twobob and TonyLi like this.
  45. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    if you were gonna do 3. might as well just make it "snap" to the right item location the moment it entered the equipment window.

    I utterly concur about point 2. and would also point out that dragging "window to window" on a 10x16 mobile window is impossible. So, a "submenu" - that does NOT rely on right-click to popup- that contains every action for the item such as "craft with, store in chest, equip, drop, use" and is contextually correct for each item is pretty much a given on that platform or it becomes unusable.

    your first point is also a nice thing to have, however, a toggle to turn off that functionality globally would also be in order as that functionality may not suit all use-cases.
     
  46. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Today updates:

    - The action menu/drop menu now close when you start dragging the inventory window.
    - Added events when a player picks up or drops an item.
    - Added an option to use items that can't be equipped nor used in the skill bar directly from the inventory and an event when they are used.
    - You can now drag and drop items from the inventory window to a skill bar slot and vice-versa.
    - You can now choose a trigger key for each skill slot. When you have an item in the skill bar slot and you press this key, an event will be called and you can choose to destroy the item on use or not. If you choose to destroy the item on use and the the item is stackable, its amount will be reduced till it gets destroyed. For each skill use, you can assign a cool down timer. The skill slot will be grayed when the timer is on.

     
    TonyLi and thenamesace like this.
  47. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I'm adding this right now.

    So an action menu with: equip/use, drop, store, sell, craft and item info options will be enough, no?

    This suggestion will have to wait till all the important requests are done.
     
    Last edited: Dec 31, 2014
  48. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    yes to all your points mate.
     
  49. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    By "item info" you mean this tooltip info right?

    tooltip.png
     
  50. eridani

    eridani

    Joined:
    Aug 30, 2012
    Posts:
    655
    Can you add an option to use the item if it is single-clicked in the skillbar while the Inventory window is closed?

    While the inventory window is open, clicking an item in the skillbar can just display the item info or whatnot, and it can be dragged off and back into the inventory

    Again, trying to think about mobile users who don't have a bunch of keyboard buttons to use as trigger keys.
     
Thread Status:
Not open for further replies.