Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-30-2009, 08:07 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
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
Reply With Quote
  #2  
Old 06-30-2009, 08:20 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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:
Reply With Quote
  #3  
Old 06-30-2009, 08:26 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Quote:
Originally Posted by fowlplay4 View Post
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.
Ah, I see what you're saying. However, it's generally for tracking the item (easier for logs etc)

If you can think of a better way to do log trades, feel free to say. thanks
Reply With Quote
  #4  
Old 06-30-2009, 08:30 PM
Stephen Stephen is offline
Boom!
Stephen's Avatar
Join Date: May 2004
Location: San Francisco
Posts: 10,410
Stephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud of
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.
__________________
Reply With Quote
  #5  
Old 06-30-2009, 08:45 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Quote:
Originally Posted by Stephen View Post
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.
Oh, that's a great idea actually. Thank you

Any other ideas?
Reply With Quote
  #6  
Old 06-30-2009, 08:58 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Stephen View Post
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.
Agreed.

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.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #7  
Old 07-01-2009, 09:31 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Quote:
Originally Posted by xXziroXx View Post
Agreed.

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.
Ahh- right. How would you go about dropping though? (Do you have an inventory that doesn't stack items that way)
Reply With Quote
  #8  
Old 07-01-2009, 09:57 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by [email protected] View Post
Ahh- right. How would you go about dropping though? (Do you have an inventory that doesn't stack items that way)
Can you be a bit more specific?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #9  
Old 07-02-2009, 08:20 PM
[email protected] sid.gottlieb@googlemail.com is offline
Banned
Join Date: Mar 2008
Posts: 861
sid.gottlieb@googlemail.com will become famous soon enough
Quote:
Originally Posted by xXziroXx View Post
Can you be a bit more specific?
When your items are in the inventory, how are they stacked.
Say you had two of the exact same item, are they stacked together (x2) or individual icons (x1)?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:31 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.