Introduction
There are two main physical components in the card deck feature:
1. The deck
This is a prim which represents the deck itself, and which the user clicks to begin dealing cards. It is linked to the Malleable Linkset object, and has the name: "!card <card name>". Inside this prim is the "Card deck" script, together with the textures that represent the different card values, and an optional configuration notecard. Prims of the "!card" type are very similar in most respects to "!create" button prims.
2. Blank card
This is a moveable prim which is used for the card. Its name should match "<card name>" in the deck prim's name. The only content is the standard moveable prim script. All features of a normal moveable prim are inherited, so the prim description can contain offset/rotation data, etc.
Basic usage
As described above, the card deck feature should work. The user clicks the deck to select it, then clicks any non-moveable prim to place the card. Subsequent cards can be dealt by further clicks on non-moveable prims, or the card deck (or another button prim) can be clicked to deselect. So in this respect, the behaviour is identical to a "!create" button prim.
However, once dealt, the card prim takes on one of the textures in the inventory of the deck prim. The deck prim records which textures have been used and will not reuse them. When the last texture has been used (ie the last card has been dealt), the deck prim will be deselected and no further cards can be dealt until the ML is cleared.
Configuration notecard
An optional notecard in the deck prim's inventory can be used to enhance the basic functionality. The notecard should be named "Config" and have the correct permissions.
Its format is an INI-style layout, with name and value pairs separated by a = sign. Comments in the notecard should be preceded by // markers, and blank lines are ignored. Names and values are case-insensitive unless directed otherwise. Syntax checking is only very rudimentary - unrecognised options produce warnings in chat. There is no duplicate checking.
The additional functionality provided by a notecard is described below.
Alternate dealing options
By default, the cards in the deck (ie the textures in the deck prim inventory) are dealt until none remain, and then the deck becomes inactive.
This behaviour can be modified by using the deal option in the configuration notecard, which may have either (but not both) of the following values:
deal = continuous
At the end of the deck, the cards are redealt in the same order. This is analogous to the cards being returned to the bottom of the deck.
deal = reshuffle
After the last card, the deck is reshuffled and dealing continues.
Linked question and answer decks
It's possible to have two decks working in synchrony, one as a "question" deck and one as an "answer" deck. The user deals questions from that deck, and if a card is dealt from the answer deck, it will have the corresponding answer to the last question dealt.
To set this up, create the two decks as normal. Ensure that the textures in each one have the same name between the corresponding question and answer textures.
Then, edit the configuration notecards to add these lines:
Question deck: link question = <name>
Answer deck: link answer = <name>
The <name> part may be anything, but it must be identical between the linked decks. If there are multiple question-and-answer links, they must have different link names.