Inventory System For RPG

Hello,

Can someone please give me a code that acts like an inventory system for a text-based RPG. I need it to store weapons in my game. Any help would be greatly appreciated. Thanks.

- Code Assassin
That's as if I told you "draw me a picture please". I'd have to ask what the inventory system would behave like, how items are stored, overall how you're going to use it.

And writing an inventory system really isn't the hardest part when writing a text rpg, what are you going to do with the other parts? Are you going to ask others to write them for you too?
try this code:

1
2
3
4
5
6
7
8
9
10
11
12
13
class inventory {

public:
   unsigned int m_count;
   std::vector m_items[CONST_MAX_SIZE];

private:
   bool AddItem( Item* pItem );
   bool RemoveItem( Item* pItem);
   bool ReplaceItem( Item* pItem);
   bool GetItem( unsigned int index);
   unsigned int GetNumberOfItem( );
}
Last edited on
You're right my question does sound a bit suspicious.

I've actually written a bunch of code by myself for my RPG. I'm a beginner anyway (12 yrs old). I just needed someone to provide me with an example is all. Not write the whole thing for me... Thanks for your comment anyway.
Thanks, Ceruleus

Topic archived. No new replies allowed.