Search Unity

advanced inventory system/example

Discussion in 'Assets and Asset Store' started by slkjdfv, May 27, 2011.

  1. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    Important - The java version currently is broken and not working causing unity to crash. I'm am working to resolve this issue. However the C# version is still working great :D. I'll keep you all posted.

    UPDATE!! I have converted version 2 back to java for those who would rather have it in java as opposed to C#. If you would like the java scripts instead of the C# scripts then visit my store on my website and purchase the one you want then pm me with your email and I'll send you the converted java scripts. Also key note, I will be charging an extra $5 after the 11th of November for the converted scripts so until then its free.

    Update Video 6

    Update Video 5

    UPDATE!!!!! Video 4 is now on my youtube channel Link to video here Sorry for the delay.

    Update!!! Video three on the progress of my Inventory system version 2 is up click the link Here

    Version 2.0 SNEAK PEEK!!! HERE!!!

    Version 2 Features update video here

    Version 2 New Features from version 1.x series :

    -Coded in C#
    -Ability to move items around your inventory(you can toggle this on and off)
    -You can move the menu titles and windows around to where you want
    -When you drop items you can choose to drop all or a set amount(also toggle-able on and off)
    -Equipment system is re-written and has more equipment options
    -You can toggle the ability to drag windows on and off(100%)
    -etc(For more info check my channel on youtube)


    This is an advanced inventory system that can be immediately imported into your game and function. Features are as follows :

    -Inventorys can be resized by changing two values so no need to change code to make a smaller or bigger inventory.
    -Lootable Items
    -Stackable Items.
    -Storage Chests
    -Item Equipping/Consuming.
    -A tab system for better organization (There are 3 tabs : Player Stats, Inventory, and equipment).
    -A health bar for testing Item consumption.
    -"i" opens and closes inventorys and "e" is for opening chests and using the crafting table.
    -Game locks the cursor and hides it when menus are closed "TAB" key will lock or unlock the cursor (debug feature).
    -Items must be within a certain distance before you can pick them up.
    -Inventory window can now be dragged and stays within the screen.
    -Crafting system
    -If you want smaller icons in your inventory just change one variable no code editing requierd.
    -Dragable inventory window
    -Fully Customizable crafting system
    -Money System
    -Merchants

    Known bugs
    -mouse doesn't always center itself when you press test play. So a quick fix is to unlock then lock the cursor using the TAB key

    If you notice any bugs or glitches with the code or something please post a comment or PM me letting me know what the issue is.

    Link to donate : Donate
     
    Last edited: Nov 9, 2011
  2. Warrior1424

    Warrior1424

    Joined:
    Sep 30, 2010
    Posts:
    980
    Wow thanks! I can't donate, as i am also in need of money, but if you check out my Medieval Houses model collection you could have some of those if you want :)
     
  3. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    I saw those ^^ very good job on your part. I may have a use for them.
     
  4. Warrior1424

    Warrior1424

    Joined:
    Sep 30, 2010
    Posts:
    980
  5. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    I sent you a PM
     
  6. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    no other comments?
     
  7. Tudor-Nita

    Tudor-Nita

    Joined:
    Dec 10, 2009
    Posts:
    336
    This is some really cool stuff. Will test it on iOS these days and report back. Looks like it could be really useful for someone that needs an inv. system.
     
    Last edited: May 27, 2011
  8. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    i only have windows so yea please test and let me know :)
     
  9. rudy777

    rudy777

    Joined:
    May 25, 2011
    Posts:
    23
    as soon as i get a paypall set up with cash on it for sure ill donate well if i use it im pretty sure i will though and thanks for this man
     
  10. joel

    joel

    Joined:
    Jun 12, 2010
    Posts:
    117
    Very Very cool! but i cant figure out how to craft an item.
    also when checking the code i couldnt find a recipie.

    Cant wait to see future updates :) when they arrive i'll be sure to donate!
     
  11. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    Mk well if you look under the workbench object in the scene you'll see an array there called "Item Recipie List" its value is zero change to to how ever many recipes you want that crafting box to hold. For now just make it one until I finish making the crafting system fully editable you can only use four items for a recipe ItemA, ItemB and so on. Now if you want a slot to be blank leave both the Item(Letter) blank and its corresponding amount blank. After that choose an item prefab for the "Item Crafted" variable and your done your first recipe is completed that simple :). The workbench will check to see if you have the items in order and there amounts in order and if so it shows the item that can be made. Hope this helps.
     
  12. joel

    joel

    Joined:
    Jun 12, 2010
    Posts:
    117
    Great! that did the trick :)
     
  13. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    Glad I could help :)
     
  14. wiseowlstudios

    wiseowlstudios

    Joined:
    Feb 13, 2011
    Posts:
    741
    nice im keeping my eye on this for later updates as im in need of this sort of system since old one let me down and is there any way to save the inventorys (for online games)
     
  15. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    well the items inside the inventory's are prefabs I'm sure if you saved the prefabs name and stats into an xml file or something it could be possible.
     
  16. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    UPDATE!!!!

    I got the crafting system full customizable. I'm just fixing up a small hiccup where its having an issue scanning the items in its inventory. If all goes well I should have a new release of the system in either a few hours or maybe tomorrow when I wake up lol. I also got some commenting done for you all. :) Thanks again for your support.
     
    Last edited: May 29, 2011
  17. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    Okay heres the new version http://www.mediafire.com/?bh3nvbkhb5hzhhn There is still a weird glitch with the crafting but it does work and you can fully customize it now :D. I also commented the crafting script more. Enjoy!!!
     
  18. joel

    joel

    Joined:
    Jun 12, 2010
    Posts:
    117
    Great to see an update so quickly :D
    but when i import the package, the workbench script isnt working. (script missing) when i re-assign it, i cant open it.
    any idea?
     
  19. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    yea i noticed that when i re-opend the file lol i deleted the wrong scene just drag the inventory sorry not the inventory the craftingSystem script from the folder inside the plugins folder into the work bench and all is good
     
  20. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    you need to erase all the old package files i think then re-import if it still doesn't work i'll re-post the file
     
    Last edited: May 29, 2011
  21. joel

    joel

    Joined:
    Jun 12, 2010
    Posts:
    117
    I made a new project, then imported the package. and dragged the craftingsystem script on the _workbench.
    doesnt work.
     
  22. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    kk i'll repost it. now when you say doesnt work wha exactly isn't working? whats it say/do?
     
  23. joel

    joel

    Joined:
    Jun 12, 2010
    Posts:
    117
    what i mean with doesnt work is that you cant open the workbench, and thus cant craft anything.
    opening the inventory works fine. just opening the workbench using 'e' doesnt.
     
  24. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    mk well i'll re-export and repost one sec ^_^ There you go :) its updated i know this works cause i tested it.
     
    Last edited: May 29, 2011
  25. joel

    joel

    Joined:
    Jun 12, 2010
    Posts:
    117
    New version works great! havent had time to really test it much, so i havent ran into that bug you were talking about. but i hope you'll fix it soon.
    As thanks i send a donation your way.
     
  26. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    Much appreciated ^_^, The next update will include money and possibly a merchant but money is a definite. As for the glitch It is on my top 5 list list of important things :).
     
  27. joel

    joel

    Joined:
    Jun 12, 2010
    Posts:
    117
    No chance for a C# version right? ;)
     
  28. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    no cause the inventory scripts array is a 2d array so its variable is like this when i do checks in other scripts inventory[0][0] and c# in unity can't do [ ][ ] other wise i'd be using c# trust me lol
     
  29. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    mk I should be uploading a new update by todays end. I fixed a coding error on my part with how it drew the inventory i was using inventoryX where i needed to use inventoryY and visa versa. I've also added money. The last thing I'm working on before i post the update is the merchant system. Then its bug fixes and what not from then on well that and coding unlesss i find something i want to add. OH and of course I'm going to finish the GUI don't worry.
     
  30. joel

    joel

    Joined:
    Jun 12, 2010
    Posts:
    117
    Cool, looking forward to the update :)
    when i was working with it, the crafting menu was stuck behind the inventory. had to make some changes to get it right ( changing the offset doesnt do anything)
    the merchant system is a seperate script i pressume? so i can work with the upcoming update, and then add the merchant system lateron?
    man... when i get everything in place i'll be sure to donate again :D
     
  31. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,298
    In C# you do this:

    inventory[0,0]

    and to declare it:

    int[,] inventory = new int[4,5];

    I'm going to need an inventory system soon so i'll try to check yours out some time this week!
     
    Last edited: May 31, 2011
  32. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    joel yes its just a new script you add it to a prefab tell it what to sell and how big its inventory is and there you go. I re-wrote the inv2 script so that will need to be replaced. I thought i tried that well if that works i may make a c# version but thats not certain as of yet.
     
  33. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    Sorry for the wait I'm almost done i had to re-do the code i typed that took me a half hour or more to do cause my computer decided to delete what I did lol. But any ways I'm almost done I'm adding the finishing touches to the merchant. These are the scripts that need to be replaced. I also did some more commenting mostly in the item script.

    -item
    -inv2

    New Script(s)
    -MerchantInv
     
  34. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
  35. SirGive

    SirGive

    Joined:
    Sep 27, 2010
    Posts:
    384
    Will definitely be checking this out!
     
  36. jedy

    jedy

    Joined:
    Aug 1, 2010
    Posts:
    578
    Nice. I will check this out now.
     
  37. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    Mk aside from updating this engine and adding more features to it(as always if theres a feature you want to see list it here) and as much as I like open-source software not every thing for this engine will be free I will be releasing add-ons that only people who donate a minimum of $5 USD will get. Once you donate you DO NOT have to donate again unless you want to, it only TAKES ONE DONATION to get all these add-ons. Those who have already donated will get these for free. I will be working on the following package add-ons that are for donaters only. Ones marked with a * are a definite add-on to be released.

    *Advanced Merchant script* :
    -you can change an items value based on a percentage you set so a merchant can sell items at a higher or lower rate of your choice
    -merchants have the option of having a set amount of cash like the fallout games had.

    Storage Bags that go inside your inventory :
    -Lootable
    -Adds Additional Slots of your choice to hold items in a separate inventory

    *3D model and Icon starter kit* :
    These will be more detailed then what comes with the engine already.
    -3D Workbench Mesh
    -3D Equipment Meshes (Helm, Chest, Boots, Sword)
    -3D chest Mesh
    -Inventory Icons

    These add-ons aren't finished yet. I am working on them I can't say when they will be released my estimated time is a week maybe more for the models and icons but the ones with a * are guaranteed to be released to all who donate when they are done. Just because I'm making add-ons that are donaters only doesn't mean I'm not making any new free features. I am, but as stated these listed above will never be available to non-donaters.


    Next updates feature ideas
    -Variable money system (you can either have one currency or multiple so its possible to have just gold or you could have gold and silver or gold, silver and bronze or what ever you want)
    -Merchant can clear and/or reset his inventory after a set period of time.
    -Identifying items

    Please note this update may take longer then usual but I want to fix all the bugs and hiccups I can and do some optimization as well as get the GUI finished. I'm also working on those packages listed above so have patience :) and as always Thanks and Enjoy ^_^.
     
  38. Scryer

    Scryer

    Joined:
    Jun 2, 2010
    Posts:
    69
    This is very good stuff! I think you'd even be able to sell it for at least $10.... you're being very generous! Everyone should at least donate $5, this was a lot of time this man used to make this for us! keep up the good work mate!
     
  39. samuraialchemy

    samuraialchemy

    Joined:
    Feb 15, 2011
    Posts:
    2
    Is there any way for you to make a c sharp version? or maybe help me attach this to my C# character controller? I can post the scripts for my controller. or email them if needed let me know @ samuraialchemy@live.com
     
  40. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    you can reference a java script with C# and visa versa. I do plan on trying to make a C# version. The whole thing that kept me from doing it was the whole 2D array thing i didn't know how to do them in C# until now lol. If you look at the example you'll see what needs to be attached to the player and what doesn't. I could help you attach them If you want yes just export your project to a .package other wise I'll get pink objects and missing scripts then send the package to slkjdfv@aim.com. I'll work on it for you today as soon as I can.
     
  41. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
  42. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
  43. mrw3bby

    mrw3bby

    Joined:
    Sep 1, 2010
    Posts:
    18
    This is very impressive, when you do the add-ons i'd be happy to donate $5 or what ever it is, this is perfect as i wouldnt have known where to start with this as i know very little script... Anyway, to the question, how easy would it be to incorporate this into a 3rd person game, with a change of mesh when items are equipped?
     
  44. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    well i think it would work the same for 3rd person you just drag the script onto the player set his stats and your done. in version 2 im going to have an example weapon that when you equip it it will display on the screen. version 2 also is going to have more customization features check out the link to the sneak peak video in the top of my post.
     
  45. CursedOne

    CursedOne

    Joined:
    Apr 4, 2011
    Posts:
    91
    Hey :) OMG Thank you for doing this I really needed it!
    I'm just having a couple of problems :(

    I'm making a 3rd person game/rpg with a camera where you need to right click / left click to look etc.
    When I add all the scripts to my player it doesn't seem to work :( I've tried loads of things to get this working.
    On your example scene it works perfectly :)

    Is there any chance you could give me instructions on how to add this into my game.
    I've been trying for about 2 hours and I'm not getting anywhere :(
     
  46. Benopaluz

    Benopaluz

    Joined:
    Aug 14, 2010
    Posts:
    300
    You cant just "Drop the scripts into any scene" bet you didnt even read the scripts he created, very nice job, its all rather to complex for me and im trying to figure out a much simpler one.
     
  47. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    Cursed One : the reason it works in my example scene is cause the default fps camera look script and the fps movement script were edited to not work if the mouse wasn't locked and visible. thats why it works in my example ^_^. As for Benopaluz Version 2 will be much simpler and less complex to use i will also release tutorial videos for version 2. check out the video in the top of my post if you haven't already :)
     
  48. CursedOne

    CursedOne

    Joined:
    Apr 4, 2011
    Posts:
    91
    Would it be ok for me to edit it so that it works without the camera and fps movement?


    I did read them, I got crafting to work on my scene + the stat window with me own health scripts I just couldn't get it to open properly.
     
  49. slkjdfv

    slkjdfv

    Joined:
    Oct 23, 2010
    Posts:
    424
    i locked them so you couldn't move or look when the inventory was open or whatever :) but if you want go ahead. Also I'll add in something for enabling camera and movement lock in version 2. :)
     
  50. Mirace

    Mirace

    Joined:
    Nov 29, 2010
    Posts:
    481
    Is this packet royalty free? so i can use it on my commercial work?