![]() |
Unique ID
So, I'm creating an item system with unique id's, the problem? Well, it's fairly simple, the dropping of items that're the same but with a unique ID.
I'm thinking a loop is the only way to avoid this, however what if a player is dropping more than one of the same item? So, let's say I had 999 Wooden Bows If I were to lay 999 Wooden Bows (each of the 999 wooden bows being a unique ID for the item) how would I assign each individual ID to the 'Wooden Bow' about to be dropped without a loop? Can anyone think of a solution? Thank you |
Well depending on the way you store your items, just have a item counter and add one to it after or before you drop the item.
If you use SQL, delete / alter the row of the item that dropped then the insert statement of the item being added will just pick the next available row number. |
Quote:
If you can think of a better way to do log trades, feel free to say. thanks |
You may want to limit your UIDs to specific items - so that it's optional rather than mandatory.
Arrows are a good example of items which do not necessitate UIDs. |
Quote:
Any other ideas? |
Quote:
I only use unique ID's for stuff that needs it - weapons/rare items/etc, and everything else gets their item name as ID. Unique ID's are purposely not stackable in my system either. |
Quote:
|
Quote:
|
Quote:
Say you had two of the exact same item, are they stacked together (x2) or individual icons (x1)? |
| All times are GMT +2. The time now is 03:56 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.