Jump to content

How should I go about building this?


Far Cry

Recommended Posts

I have an items table that holds basic info such as id, name, damage etc. values of that item

 

My question is: If I wanted to add a shop where users could buy items, would it be a good idea to make a new database table that holds just one column per item that would be sold at that shop and have it contain the same values as the items table. Then once that item is purchased, have those values copied to the items table? May sound confusing. Just don't know if this idea is at all efficient.

Link to comment
Share on other sites

Assuming there's just the one shop and there are an infinite number of non-tradeable items,

Yes, have a table listing the items for sale. It'll surely have more columns: while items can have a base value I'd make the shop list its own value (which may very well be the same as the base value). When someone buys you "copy" the item to their inventory.

 

I mention "infinite number" and "non-tradeable items" because if that's not the case then things are a bit different.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.