![]() |
Item DataBase
Well I have seen on several threads, heard from several people and realized on several servers that an ´Item-DataBase´ seems to be something good.
I wanted to try also making such a thing but how exactly are they made? Like is everything bumped in an array (doesn´t seem to be good in my oppinion)? PHP Code:
PHP Code:
I do know that everything is stored in a DB. |
Use SQLITE for an item db, or even a DBNPC and then have method of sending and retrieving data from it.
That would be an even better item system. One bad thing about what you're currently using, this. variables as soon as you restart graal it's value will be reset to null. |
Only use SQLite for a DB if you're going to actually learn how to use it securely and efficiently. If you're not going to bother doing it right or to debug it, it's going to be slow and insecure.
|
Quote:
SQL, NPC Flags, Files are all just storage for the item data. Establish a basic item system first: For tracking the quantity of the item: clientr.item.("item name") = quantity Store item data in a DB: this.("item name") = {item, data}; For making the data of the weapon accessible to your client-side scripts set the following as needed in player flags (this should be a mirror of your DB data): clientr.data.("item name") = {item, data} Search MUDlib on the forums for discussion on the topic of "item systems". |
Quote:
|
Quote:
|
Ok thanks guys. I will look around for those stuff (MUDlib and so on) and mess around with that ;)
|
babby's first item storage might work well by just using classes in which all fields are defined as own variable and saving/loading as JSON.
|
| All times are GMT +2. The time now is 08:24 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.