• entries
    16
  • comments
    19
  • views
    16880

What's in an Inventory?

Sign in to follow this  
omnomnom

361 views

What is an inventory?
It's kind of a container the player has to hold Items I guess. Seems simple enough. Coding this should be real quick.

What about creatures can they carry items?
Oh..yeah of course, so an inventory is not player specific after-all, inventories can be owned by any a creature - including the player.

What about a chest and other containers in the map?
Didn't think of that...I guess those are furniture. For simplicity I can just make them a creature that cannot think or act I suppose...

What about a bag?
...a bag?

Yes a bag. A container the player can carry
Oh. *facepalm*. I didn't think of that either. A bag would be an item but it also has an inventory....

Can the player carry a bag in a bag in a bag?
I guess....there's probably only going to be a weight limit.

How are you going to handle the UI for nested inventories?
...

And what about corpses? They have inventories right?
Yes they still have inventories the player can browse

But you can carry corpses right?
wow it gets even more complicated. Can you carry a dead creature while it holds all it's inventory? That means you aren't just carrying items you can also carry creatures. Hmm maybe dead creatures just drop all their items to the floor. Would make it easier...but has downsides too.

What about worn equipment like armor though? Does that just fall off onto the floor?
Uh I guess it could...unrealistic but that would also make things easier.

Now, weight restrictions...
[conversation continues into the night. No coding is done]
Sign in to follow this  


2 Comments


Recommended Comments

So it sounds like inventory should be an interface that whatever class needs to can implement.

"Can the player carry a bag in a bag in a bag?"

Only when they're empty. Otherwise it just doesn't make sense. You then don't have to worry about nested inventories.

"But you can carry corpses right?"

I'd say no. Why would you?

"Now, weight restrictions..."

I'm all for these.

Share this comment


Link to comment
hmm the post was marked as draft...i guess i must have published it by accident at some point...republished now...

[QUOTE]
"But you can carry corpses right?"

I'd say no. Why would you?[/QUOTE]

Good point, I was thinking of nethack where you can.

[QUOTE]Only when they're empty. Otherwise it just doesn't make sense. You then don't have to worry about nested inventories.[/QUOTE]

Good idea

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now