Jump to content


Photo

Modification To ONE Entry When Multiples Exist?


  • Please log in to reply
1 reply to this topic

#1 jhale1966

jhale1966
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 28 November 2003 - 03:13 PM

In my game I have several tables of different decks of cards. Now, some of these cards are duplicated in the deck (items, spells, etc.) and each card has a unique \'cardid\' entry in the table.

Now, if a player achieves a spell, and the deck has 3 copies of the same spell (and they have separate unique cardid\'s), all 3 entries are tagged as drawn by the player - where it should only tag one of them, freeing the other two entries to be drawn by other players.

The Table search is done based on the Spell NAME (not the cardid) so that I have the ability to add more spells in the future.

How do I tag just ONE instance of the card in the DB instead of ALL of them?

Thanks! :)

#2 Z24_2000

Z24_2000
  • Members
  • Pip
  • Newbie
  • 5 posts

Posted 03 December 2003 - 02:50 PM

Not sure if this is a good approach, but...

You could add a prefix to the Card Name i.e.

A Stinky Spell
B Stinky Spell
C Stinky Spell

Then Parse the first part of the Card Name before displaying it. This way you\'ll know which one to tag as being drawn.

Another idea might be to add a column to the table for use by cards that are duplicates and throw A, B and C into the coressponding columns. Use that as a foreign key when tagging the cards as being drawn.

Both solutions imply a little more work, which is why I\'m not sure that either will work in your situation. Just some ideas for you to think about.

Hope this helps,
Andrew




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users