Page 1 of 1

can someone help me with a inventory to a game

Posted: Thu Jun 04, 2009 12:20 pm
by rakarna
hi can someone please help me to build, or link me to a page were i can read about how to make a inventory. i am working on a webb game and need a inventory to it. if you know anything please post it.

i have search on the world wilde webb but cant found anything :banghead:

Re: can someone help me with a inventory to a game

Posted: Thu Jun 04, 2009 12:27 pm
by mikemike
Not sure what you mean exactly. Is this PHP-related?

Re: can someone help me with a inventory to a game

Posted: Thu Jun 04, 2009 12:30 pm
by rakarna
ye i have made my webb game in php and now i want to make a inventory so ea member can buy stuff. but i am not sure if this is posible in php.

Re: can someone help me with a inventory to a game

Posted: Thu Jun 04, 2009 1:33 pm
by Chalks
it's certainly possible. You will want to create a database using mysql (easiest). Here is a great tutorial for learning how to use mysql with php. Once you understand what tables are, a simple inventory table should look something like this:

Table Inventory
Fields
  • userID int
  • itemID int
  • quantity int
  • baseValue int
a sample item in the table would be:
userID-12345, itemID-123, quantity-4, baseValue-200

you would need a few other tables like a User table and an Item table so that you can use the IDs to look up who owns what.
edit:

Table User
fields
  • userID int
  • uName varchar(100)
  • any other fields you want
Table Items
fields
  • itemID int
  • iName varchar(100)
  • baseDmg int
  • range int
  • hitChance int
a sample item:
itemID-123, iName-"Deathglomp Phaser", baseDmg-20, range-5, hitChance-60