• Register
Post feature RSS Inventory management and other dull stuff

Working some more on "inventory". Its kind of dull, but its important for crafting, trading, resource gathering etc.

Posted by on

Spent the last week doing some work on Inventory for the game. Basically I wanted it so that I could make up inventories in the editor (Unity) and then manipulate those inventories in the game.

I'm new to C#, so it took me a bit of fiddling around to figure out what sort of data structure code I needed, mainly just syntax for things I already knew from other languages (like how to declare a delegate in C#) .

Inventory, or rather, the "collection of items" that is an inventory, is really important code, because it forms the foundations for a ton of other code. Its dull as ditchwater code to write, but it really does require some thinking how to structure it for the unique aspects of the game. I also had to figure out how to tie it in with the NGUI based UI code (I've bought a few more add-ons for unity, such as NGUI and Playmaker, but more on that another time).

Anyway, here's a quick video showing the inventory working both in-game and in-editor. Notice that the items are in sync between the two. Sorry for the lousy capture, had to use a different programme to capture the editor interface.

More to come on this, hopefully I'll be able to explain how all this makes things like trade, craft and resource generation easier in the next video.

Take care. .Z.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.