I am creating an MMORPG with unity. I have successfully created a database to store all the user’s info and also created a functional login screen thanks to some of the people who posted in my previous threads. My next challenge is to create a secondary table in the database that DOES NOT STORE the player’s info, but stores all the items in the game as well as their attributes. How it works is when the user selects an item from his inventory, The player’s code (C#) communicates with the item database and tells it that the player has chosen to hold an item from his inventory (Such a a sword). With that in mind, the database then sends the client all of that item’s attributes such as the amount of damage it deals, and all sorts of other things. The problem is, I don’t know how to get the database to store the model of the item the player has chosen to hold. So when the player switches weapons, the model of the weapon he is holding stays the same. The amount of damage the player can deal with the weapon changes, the other attributes should change, but the model stays the same. I am using php files to communicate with the database (both the php files and the database are on the web to lessen the chances of hacking). The client communicates with the database by using WWWForms. I will post more details later.
You do not want to store your models in the database. The model is simply the visual representation of the data in the database and you should not try to store anything visual-related in the database.
Why don’t you just store a string in the database with the name of the weapon (e.g. “sword”) and its attributes and when the player changes his weapon you simply swap the model on the client side and get the “sword” data from the database?
Did not think about that…Thanks