View Single Post
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old October 3rd, 2002, 02:14 PM
To make this work, I need to make sure you've got things structured the
same way I'm thinking, so I'm going to start with steps that you may
already have in place from your description. Then I'll build on that to
reach the full solution. I'm going to use a single character as an example,
and you can extrapolate this to other characters, as needed.

1. Start with a tag group named "character" and create a tag for each
character. For this example, let's use the name "Fred". So define the tag
group and a tag of "Fred" within it.

2. Assign the "character.Fred" tag to the Fred character card.

3. Define another tag group named "ischar" and create a tag for each
character. We'll use this to identify which cards require which characters.
So define the tag group and add a tag of "Fred" within it.

4. Assign the "ischar.Fred" tag to all cards that require the Fred
character to be in the deck.

Everything is in place that we need. Now let's look at the rule you need to
write...

1. The rule needs to span multiple cards, so you have to write a rule with
deck scoping.

2. Since you need to verify that the character card is present for any
cards requiring the character, you'll have to write a separate rule for
each character - i.e. one rule to check for Fred, another for George, etc.

3. Since we have a separate rule for each character, the rule needs to be
declared valid if there are no cards requiring that character. This is done
with the term "card:ischar.Fred = 0". So we'll start each rule with a first
term of "card:ischar.Fred = 0" and use an OR ('|') to combine it with the
rest of the rule. This way, the rest of the rule will be ignored if there
are no cards requiring Fred.

4. If our rule gets past the first term, then we know there is at least one
card that requires our character. So the next part is to verify the
character is present. This done with the term "card:character.Fred > 0".

5. Putting it all together, our rule is given below. This rule verifies
that we have at least one Fred card when there are any cards present that
require Fred.
(card:ischar.Fred = 0) | (card:character.Fred > 0)

6. Verifying separately that a card is doesn't have any character
requirements is unnecessary with the above rule. If a card has no character
requirements, it will satisfy the first term of each rule and be declared
valid for each rule.

7. The last factor to address is the actual scope of the deck rule. Since
you have two play decks, you either have to assign the rule a scope of
"all" OR you have to define the rule twice, with each instance of the rule
applying to a separate deck. However, given your description of things, you
should be fine with simply using a single rule with "all" scope.

Now that everything is figured out, the complete rule entry within the data
file will look something like this:
<rule id="isFred" scope="all"
message="One or more cards require Fred" summary="Fred needed">
<![CDATA[
(card:ischar.Fred = 0) | (card:character.Fred > 0)
]]>
</rule>

I'm quite curious what prompted the placement of the character card in its
own separate deck. Was it done in an effort to make the above rules work
correctly? If so, then it should not be necessary and you can have the
character card placed into a deck with the rest of the cards. If not,
please explain. There are SO many different games, each with its own
assortment of bizarre game mechanics, and I'm always looking to learn more
about those mechanics so that future releases of Card Vault can better
support them. :-)

Hope all this helps,
Rob


At 03:15 PM 10/3/2002 +0000, you wrote:
>I've got a rule that I'm trying to put together, which goes a little
>like this:
>
>You have a character card, and two play decks. There are certain
>cards in those decks which are flagged as only being played by
>specific character(s).
>
>Now, I've got the character card set up as existing in its own deck,
>separate from the play decks, and I've got a tag group set up to
>hold the characters that can use a specific card (the character card
>holds a single value in that tag group).
>
>How can I check that all the cards in the play decks are either non-
>character based, or have the required character attribution?


---------------------------------------------------------------------------
Rob Bowes (rob@wolflair.com) (559) 658-6995
Lone Wolf Development www.wolflair.com


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Plan to Sell a Home?
http://us.click.yahoo.com/J2SnNA/y.l...fIAA/WuQolB/TM
---------------------------------------------------------------------~->
rob is offline   #3 Reply With Quote