I’ve worked on a few games on unity and posted them so some of you may have seen my work in progresses! But anyways, I wanted to make a small contribution to the Unity3d community. So here you go!
Since I’ve noticed a lot of people wanting to work on games but not knowing any scripting, I decided to make a very basic, and by basic I mean really really simple inventory system.
This is heavily commented.
This is mainly aimed at people learning unitys JS. It may not be perfect, or pretty but it works :P.
Okay I updated it with the ability to remove items from your inventory by clicking them, Hopefully this achieved what you needed done :). To literally destroy something, Remove the item from the list the same way i did when moving it to the ground but instead use Destroy(gameObject); That would most likely do it.
Let me know if anything works incorrectly or needs to be fixed.
To make this very interesting script even more interesting you could perhaps make different items that can be assigned to the player.
like picking up an armor piece can only be assigned in the armor slot.
and that armor piece would be assigned to the player model.
(easiest would be to give the player model a skeleton, and rig the armor piece to the same skeleton, but save it as a separate model)
I’m sure people would be willing to pay for that, even more then $5 i know i would
Awesome - Yeah, and I could call this the Indie version, And that the Full version. I think I will deffinetly make a pimped out version of this. An update will probley be ready in a few days so keep a look out.
Hey guys, Wanted to let everyone know i havn’t forgotten about this! :P. Im working on an “Advanced System”, that will be released shortly (day or so hopefully).
This is looking pretty cool. The biggest problem I’ve found in creating an inventory system is coming up with a good way to save and load that inventory between game sessions. Would love to see your take on that.
Well, Ive actually just finished the inventory system and am waiting for it to be uploaded for a release. But, To take care of that problem wouldnt be to hard. Just recreate the inventory each time you load a game.
Ex:
Set up a list of items that could possibly be collected while playing.
Then at the end of the game session use player prefs to store some integers
item 1=4;
item 2=1;
etc. And then just have it re-create the invnetory with the saved int’s when loading
is there a way to extend this for point and click style inv, it goes into your inv, but i want to select a item to use it so then i can use code such as
@Xeno360 - have you tried this out in Unity3 at all? I’m trying to get it working but running into issues within the following code:
var Contents : GameObject[];
function AddItem(Item : GameObject) {
var newContents = new Array(Contents);
newContents.Add(Item);
Contents = newContents.ToBuiltin(GameObject);
}
This produces an error:
(on the final Contents = … line)
Used to work fine in Unity iPhone 1.7. Seems to be a lot of these casting/typing changes in Unity3.
Thats odd >.<. I Dont have Unity3 yet, But when I get my hands on a copy and figure out what the changes are and what not I’ll update this :). Sorry about that.
Hmmm… I booted it up in unity 3, and it runs fine for me. No errors at all. Only thing I noticed different while using it with unity 3, is when dropping the boxes. You can get stuck inside its collider now >.<, (I guess colliders work while inside and out now? ). Maybe if you redownload the package and re-compile it in unity 3 it will work.
Thanks for checking. Which build platform are you set to when testing?
I’m finding a lot of my Unity iPhone stuff isn’t working anymore in Unity 3, but seems to work for other people. I’m wondering if it’s something specific to setting Unity 3 to the iPhone build platform, or maybe some specific setting I have turned on.