LackeyCCG

LackeyCCG Forum => Plugins & Plugin Creation Forum => Topic started by: Boontoe on July 15, 2011, 06:52:56 AM

Title: Pack Definitions with OR
Post by: Boontoe on July 15, 2011, 06:52:56 AM
It seems by default the <crit> are all evaluated with AND, can we evalute with OR?

What I'm trying to do is made play-ready starter packs (Magic) that span a block, so I'd like the cards to come randomly from three different sets.  I know I can achieve this with a <eval>DOESNTCONTAIN</eval> for all the other sets but that'll make for an overly huge definition.

Hope I've been clear enough in what I'm asking, I can try and elaborate if not!
Title: Re: Pack Definitions with OR
Post by: Boontoe on July 15, 2011, 07:19:12 AM
Oh and another question: do the chances need to be integers or can they be decimals?
Title: Re: Pack Definitions with OR
Post by: Trevor on July 15, 2011, 11:53:58 AM
A pack generally is more fixed than that. If you want to have a card that could come from one of 3 sets, you could make 3 different chances set, one for each set.

It isn't ideal, but I think I made it to only accept integer chance values. I am changing that now.
Title: Re: Pack Definitions with OR
Post by: Boontoe on July 18, 2011, 06:33:43 AM
Using chances for the sets won't achieve what I'm trying to achieve.  The closest using chances will get is to create single-set decks but randomly pick the set.  I'd like each card in the deck to be picked randomly and independently of the other cards.  Of course I appreciate that the pack generator is just designed to handle existing random packs, but I think it'd be pretty ace if it could also be used to create more interesting things.

Had more of a play around at the weekend with it and realised that ruling out other sets with <eval>DOESNTCONTAIN</eval> won't work because some of the set names (like 'an' for arabian nights) are contained in other sets (like plANechase).  Is there a full list of the different <eval> values that are usable?  It looks like there's an ISNOT but I couldn't get it to work; I tried the following simple definition and it returns nothing:

<packdefinitions version="1.0">

<pack>
<packtitle>Tester</packtitle>
<packimage>an</packimage>
<packformat>Test</packformat>
<packkind>Starter</packkind>
<packdoubles>yes</packdoubles>
<chance>
<prob>100</prob>
<kind>
<qty>200</qty>
<crit><field>Type</field><eval>ISNOT</eval><data>Instant</data></crit>
</kind>
</chance>
</pack>

</packdefinitions>
Title: Re: Pack Definitions with OR
Post by: Trevor on July 18, 2011, 08:08:02 AM
I realize it's not a "good" way of doing it, but if you really want to, you can make an extra column in the data file that defines what is in each pack. Like "pack1" or something like that, and make a pack criterion for including that.

When I get the time, I'll allow OR comparisons in the packdefinitions, which is the proper way of doing this.
Title: Re: Pack Definitions with OR
Post by: Boontoe on July 18, 2011, 08:55:59 AM
Ah yes, hadn't considered adding columns into the data files.  Cheers for the help.
Title: Re: Pack Definitions with OR
Post by: Boontoe on July 19, 2011, 06:02:11 AM
Ok I'm back to scratching my head again - I've added a new data column but it doesn't work with criteria.

I've added a 'Block' column to the end of each of the set text files.
I've added COLUMN11:"Block" 1 to the plugininfo.txt

Is there anywhere else I need to change something?  The column appears in the deck editor panel and has appears to contain the right information, however when I try to use it as a criteria for a pack definition it gets ignored.
Title: Re: Pack Definitions with OR
Post by: Boontoe on July 20, 2011, 05:48:03 AM
Ah nevermind, I've sidestepped the problem by changing the set names of a bunch of the sets in the data files and will be keeping it separate from the 'real' magic plugin.
Title: Re: Pack Definitions with OR
Post by: Trevor on July 20, 2011, 06:28:16 AM
Quote from: Boontoe on July 20, 2011, 05:48:03 AM
Ah nevermind, I've sidestepped the problem by changing the set names of a bunch of the sets in the data files and will be keeping it separate from the 'real' magic plugin.
It's a bad idea to alter a plugin unless you are the plugin creator. This will likely cause errors.