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

Non-platform specific questions.

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

Postby Zehper48 » Sun Sep 09, 2007 1:17 pm

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
I like score
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

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

Postby d-soldier » Sun Sep 09, 2007 5:27 pm

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..
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

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

Postby Zehper48 » Sun Sep 09, 2007 5:34 pm

thats a good idea thanks, im really going to try that =), if anybody else has any ideas just post here =p :D
User avatar
Zehper48
 
Posts: 241
Joined: Sun Jun 11, 2006 1:34 am
Location: Advanced Noob
Score: 4 Give a positive score

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

Postby DocRabbit » Thu Sep 13, 2007 2:08 pm

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.
User avatar
DocRabbit
 
Posts: 114
Joined: Fri Oct 27, 2006 2:56 am
Score: 10 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron