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

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I have added an animator that will allow to play opening and closing chest animations when used with the "ItemGroup.js/.cs" script.
    I have also added the ability to show one currency in the inventory bag menu.
    These and more features will be available in the next update.
     
    charles01 and TonyLi like this.
  2. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    Hi @SoumiDelRio - A Love/Hate user, @twobob, tipped me off to a good optimization. If a UI GameObject has an Animator component, only enable it while playing the opening and closing animations: "Unity forces a repaint even when the animation is already finished, which accrues a garbage penalty every frame (and not a small one)." You might want to add this to the back burner for a future optimization if you have time.
     
    OussamaB and twobob like this.
  3. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Thanks for the tip but it's not the UI game object that has an animator component, it's the game object that holds the ItemGroup script.
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,698
    Got it. The tip might still apply if it's something like a chest that only plays open and close animations. No need to keep the Animator enabled at other times. But if it's something like a character that's constantly animated (even looping an idle animation), there's no need to disable it.
     
    OussamaB likes this.
  5. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Thanks, I'm always trying to reduce memory use as much as I can.
     
  6. kvnchua

    kvnchua

    Joined:
    Apr 24, 2015
    Posts:
    6
    hi @SoumiDelRio it is possible for it to run with just 3 out of the 6 system you just created? i just need the vendor, inventory and skill bar system
     
  7. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Of course, you can disable the the other features and keep the ones you need.
     
  8. kvnchua

    kvnchua

    Joined:
    Apr 24, 2015
    Posts:
    6
    how can i disable it? iam trying to import it on another project and just want to keep the 3 system that i want
     
  9. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Disable the UI and the manager scripts of the components you don't need. For example, go to the "CraftManager" object in the prefab and disable both of the scripts that are attached to this object to disable the crafting feature.
     
  10. kvnchua

    kvnchua

    Joined:
    Apr 24, 2015
    Posts:
    6
    thanks a lot :)
     
  11. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    S-Inventory update has been submitted and will be available soon in the asset store. Here's a list of the changes:

    - Fixed a bug in creating currencies.
    - Added the option to display one currency in the bag part of the inventory.
    - Added an animator to play opening and closing animations for the item group chest.
    - Added the option to press "Enter" to complete dropping or selling more than item at a time.
    - Added the option to close all panels with one key.

    I'm really sorry for the inactivity lately but I was busy working on a game for a competition.
     
  12. charles01

    charles01

    Joined:
    Mar 28, 2013
    Posts:
    25
    Good luck in your competition :), for the closing of the panels i know it let now but for next update another addition could be when 1 panel is open and then you open another can you make the first 1 close automatically.
     
  13. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I don't really think that's useful since there's a lot of interaction between different panels where you have to drag items from one to another. But if you really need it for your project, I will gladly make some modifications in the code for you.
     
  14. charles01

    charles01

    Joined:
    Mar 28, 2013
    Posts:
    25
    Ok no problem, Will let you know if i need help with it but will try add it my self.
     
  15. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I've replied to your PM two days ago. Can you please show me a screenshot of the Equipment and EquipmentUI scripts inspector view? Because it seems that you're missing some configurations. Also, does it only happen when try to equip the first item in the inventory?
     
    Yamanlar likes this.
  16. Yamanlar

    Yamanlar

    Joined:
    Aug 11, 2014
    Posts:
    5
    I have a new problem
    when items saved automatically , "kamp ateşi" gameobject color is White
    after save in inventory, my "kamp ateşi" gameObject color is White





    before save




    after save
     
  17. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    This is because you haven't placed the items sprites inside the "Resources" folder under the same name of the items.

    EDIT: The latest update is available in the asset store.
     
    Last edited: May 9, 2015
    Yamanlar likes this.
  18. Yamanlar

    Yamanlar

    Joined:
    Aug 11, 2014
    Posts:
    5
    Thank you its work!!!
     
    OussamaB likes this.
  19. vaki26

    vaki26

    Joined:
    Jan 23, 2015
    Posts:
    22
    Hi Guys,

    Is it possible to have the skillbar use general potion name so any of the 5 slots can have any potion type ?
    I made all the item types potion bu only the first slot stil works I can not use the other slots. So for example the first slot can contain Healt potions, 2nd slot Mana potions, 3rd slot would be invis potions more like a potion belt. Any thoughts ?
     
  20. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    If you are testing this in the demo scene, please make sure that all the skill bar slot objects have all the needed events that can be found in this page or simply copy them from the first slot that has been configured correctly because when updating the skill bar system, I forget to update all of the slots.
     
  21. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Hello everyone, I'm currently working on a new update:

    - Improving saving and loading items: Have different items on different equipment/skill bar slots that share the same name.
    - Choose whether to keep an item (put it back in the inventory) or destroy it after using it in crafting.
    - Create and customize inventory tabs.
    - Pre-populate inventory items.
    - New UI skin.

    Screenshots will follow soon.
     
  22. thenamesace

    thenamesace

    Joined:
    Jan 25, 2014
    Posts:
    157
    Could you add a system to crafting where it takes a certain amount of time to craft different items? which could be set in the recipes ? a sort of cool down system
     
  23. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Very good suggestion, it will be in the next update as well. Thank you.
     
    thenamesace likes this.
  24. pplgg

    pplgg

    Joined:
    Jun 23, 2015
    Posts:
    8
    I'm messaging you through here since there's no option for emailing you directly (that works). I'm having problems getting this to work with anything outside the demo.
     
  25. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Any errors on the console?
     
  26. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    S-Inventory crafting system changes in the next update:

    - Choose whether to keep an item (put it back in the inventory) or destroy it after using it in crafting.
    - In each recipe, items can take a certain time (defined in the inspector) to craft, while it's being crafted you will see a percentage indicating when it will be ready and you can't use that recipe till the item is ready.
    - When an item is crafted, it won't be added automatically to the player's inventory, it will remain in the crafting window till the player takes it to the inventory manually.

     
    thenamesace likes this.
  27. pplgg

    pplgg

    Joined:
    Jun 23, 2015
    Posts:
    8
    Here is an error I received, but this is just one of them~
    NullReferenceException: Object reference not set to an instance of an object
    InventoryManager.Awake () (at Assets/C#/Scripts/Inventory/InventoryManager.cs:105)
     
  28. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    It seems like you haven't added the "InventoryUI" script that is required along with all the other UI components. You can simply copy everything from the demo scene to your scene so that you won't loose the connection between the scripts. The video below shows how to do that:



    This will be changed in the next update so that you will only have to use one prefab that you can copy from one scene to another.
     
  29. pplgg

    pplgg

    Joined:
    Jun 23, 2015
    Posts:
    8
    That helps to save time, but I don't recall the next steps by doing it this way in the guide, so this is the following error I got from the InventoryUI script

    NullReferenceException: Object reference not set to an instance of an object
    InventoryUI.Update () (at Assets/S-Inventory/C#/Scripts/Inventory/InventoryUI.cs:332)
     
  30. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    It seems that you've forgotten to add an Event System which is required for the 4.6 Unity UI. Simply go to "GameObject -> UI -> Event System".
     
    pplgg likes this.
  31. pplgg

    pplgg

    Joined:
    Jun 23, 2015
    Posts:
    8
    I feel like I'm just going to ask you over and over what the next step is, so if there's anyway we could chat or something, that would be fantastic. As soon as I can get this thing to work, I'm giving this asset a 10/10 if I can. However, I'm no longer getting errors, I'm just not able to see anything pop up; like the player inventory for example.
     
  32. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I've PMed you my Skype e-mail so that we can chat there.
     
  33. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    S-Inventory version 1.25 is now available on the asset store. This update includes the crafting system changes and few bug fixes.
    Another update will follow pretty soon.
     
    Last edited: Jul 5, 2015
  34. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    New UI graphics in the next update!

     
    thenamesace likes this.
  35. dshillady

    dshillady

    Joined:
    Mar 28, 2014
    Posts:
    24
    Hi SoumiDelRio.

    I purchased your asset and imported it into a Unity 5.1 project targeting the Standalone platforms.

    Aside from some compiler warnings about obsolete API method/property names, the demo compiles and runs fine.

    However, none of the panels/windows open up on the screen.

    The Debug.Log() commands run and output to the console, such as "Just opened the inventory panel", but that's all that happens when I press 'I', 'C', 'R', or give mouse input that presumably should show the inventory panels.

    Is this a Unity 5.1 compatibility issue, or are there some settings that need tweaking, or is this a matter of asset file hierarchy arrangement?

    I'm hoping this will be an easy fix, because your asset is just what my current game project needs.

    Please help!
     
  36. petersvfx

    petersvfx

    Joined:
    Jan 19, 2013
    Posts:
    2
    Hi SoumiDelRio,

    I have the same error like dshillady. In my opinion this is also something what is just with 5.1 and UI.

    cheers,
    peters
     
  37. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Hello,

    Sorry for the problem you're having. I'm downloading Unity 5.1.1 right now and will post a solution as soon as possible.
     
  38. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I found the solution. In each UI panel that doesn't appear, tick the "Override Sorting" in its "Canvas" component.
     
  39. dshillady

    dshillady

    Joined:
    Mar 28, 2014
    Posts:
    24
    Excellent! This works great!

    Thank you soooooooooooo much, SoumiDelRio!
     
    OussamaB likes this.
  40. petersvfx

    petersvfx

    Joined:
    Jan 19, 2013
    Posts:
    2
    Perfect! Thanks for fast feedback.

    cheers,
    peters
     
    OussamaB likes this.
  41. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The new update is here:
    - Added inventory tabs.
    - New UI graphics.

     
  42. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I'm currently working on a new update for S-Inventory:
    - Improving the inventory tabs feature.
    - Making all the windows draggable.
    - Adding equipment attributes info in the equipment window.
    And few more to come.

     
  43. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The new update has been submitted!

    - Improved the inventory tabs feature.
    - All the windows are draggable now.
    - Added equipment attributes info in the equipment window.
    - Added the option to show a progress bar while crafting an item.
    - Added equipment objects: The ability to activate objects when equipping an item by linking the object and the item in the equipment inspector.
    - Fixed a small bug with dragging items.
    - Equipment attributes are now shown in the item's description when hovering over its icon.
     
  44. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    S-Inventory v1.27 is now available on the asset store!
     
  45. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    As my website is temporarily down, you can access the documentation here: http://bit.ly/s-inventorydoc
    I'm currently moving to a new host since this one (Volt Host) just decided to stop their service without warning anyone before.
     
  46. Harokel

    Harokel

    Joined:
    Nov 2, 2012
    Posts:
    51
    Hello Suomi!

    I´ve followed your instructions in http://soumidelrio.com/document/s-inventory/custom-events/ to create a global variable to call it, but I can´t do this with my classes. All of them are public, and they have worked correctly between my classes until this moment.

    I tried to enter that code in InventoryEvents.cs but I can´t. I have even tried to create global variables in InventoryManger.cs but I have not succeeded.

    This is the error in the console: "The type or namespace name `health' could not be found. Are you missing a using directive or an assembly reference?".

    Clarification: "health.cs"
    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using UnityEngine.UI;
    4. using System.Collections;
    5.  
    6. public class health : MonoBehaviour
    7. {
    8. //......
    9. }
    10.  
    Thank you!
     
  47. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I think you the "health.cs" file is missing in your project. Maybe it has a different name? If yes, just change the script's file name to "health".
     
  48. Harokel

    Harokel

    Joined:
    Nov 2, 2012
    Posts:
    51
    It has the same name.
    What is the search path used by S-Inventory to find scripts?
    Does the only solution is to move my scripts folder to Inventory´s folder?

    When I write the code in InventoryEvents.cs to generate a global variable, does not appear in the drop-down (image) any of my classes, only generic and yours.

     
  49. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    You're not using the custom events correctly. There are different types of S-Inventory related events in the InventoryEvents.cs script. In those events, you can add your own code and call it whenever that event is called. What code customization are you aiming for exactly? I can show you how to do it right then you can follow that example.
     
  50. Harokel

    Harokel

    Joined:
    Nov 2, 2012
    Posts:
    51
    Ok. For example, I want to "use" a eatable object directly in the Inventory Panel. That is, to eat it.
    And this food will raise the "calories" variable, which it is in my health script.
    I have a lot of kind of foods, so I shouldn´t use the skillbar for each one.
    I can do this with the example in CustomEvents (with keycode), but is very inefficient to have to use a key for each object class :S

    A question related with this one. Could I create a Skill Slot (SkillBar) for all of the weapons? Not only for one.
    It could be fine with all kind of foods, buffs, etc, in the other skill slots.
     
Thread Status:
Not open for further replies.