Page 1 of 1

Does anybody have an idea on making an inventory...

PostPosted: Sun Sep 09, 2007 1:17 pm
by Zehper48
I cant think of how to make an inventory for an rpg game like you know potions and swords and shields. Does anybody haev ANY idea? on how to make an inventory, or has somebody done it? a demo, i want to make an rpg game but the inventory is the only thing holding me up

Re: Does anybody have an idea on making an inventory...

PostPosted: Sun Sep 09, 2007 5:27 pm
by d-soldier
Interesting question...off the top of my head, I think it could easily be done using multiple variables... You would have to keep a list for yourself, like:
variable: actor
item01 (sword)
item02 (shield)
item03 (magic dagger)
item04 (gold)
etc...

and your inventory display screen would access these variables in order to know which objects are there for use.
if (item01==1)
{
// change animation from blank spot to image of sword;
}
etc...
Probably a better way using all kinds of functions that I don't know how to use though..

Re: Does anybody have an idea on making an inventory...

PostPosted: Sun Sep 09, 2007 5:34 pm
by Zehper48
thats a good idea thanks, im really going to try that =), if anybody else has any ideas just post here =p :D

Re: Does anybody have an idea on making an inventory...

PostPosted: Thu Sep 13, 2007 2:08 pm
by DocRabbit
Like the new forum, been DB programming last 4 weeks.

I would setup 2 arrays to do the inventory.

One array to hold the different types of items.

ArrayItem(0)=axe
ArrayItem(1)=sword
ArrayItem(2)=grub
etc...

And the next to indicate positions in your sack.

ArraySackPosition1=ArrayItem(0)

Come up with a default value for empty, and initialize all positions in the sack to that.
Then when you pick-up an item, set its value to the first empty sack position.
With some coding, you could actually arrange your sack items also.

This is just visualization coding, not actual coding above.