Guest
Posts: n/a
|
I've started messing around with the various validation rules in card vault
(mainly adding rules to existing datafiles while I get the hang of how it all works) and I've come undone with one rule. I'd like to specify that the sum of the cost of all copies of any card in the deck must not exceed a given number. Specifically, this came up in the D&D minis mass battle rules where you can spend up to 20% of your points on multiples of a particular miniature. Does anyone know how I can achieve this effect? -- Geoff Gibbs http://www.world-of-geoff.co.uk ------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511 http://us.click.yahoo.com/mOAaAA/3ex...sNAA/WuQolB/TM ---------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/cardvault/ <*> To unsubscribe from this group, send an email to: cardvault-unsubscribe@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
Hi Geoff,
If I understand the question correctly, you're going to need a rule that employs a number of different elements. One possible solution is outlined below. First, you need a rule with card scoping. You also need to make sure you reference all equivalent cards, so that a figure that has two or more different versions (e.g. a re-released fig in the future) has all versions treated as the same figure. This entails use of the "#[equiv]" term. To get the total cost of all instances of the model within the force, you'll need to get the individual model cost and multiply it by the count. To get the model cost, you'll need to obtain that with something like "val:cost.?". I don't know the D&D minis files, but I'm sure there is a cost tag associated with them (the name might be slightly different). The net calculation would be something along the lines of "#[equiv] * val:cost.?". Next, you need to get the total cost of the entire force. This is obtained with something like "sum:cost.?" for the entire force. You can get this value easily via a deck scoping rule. Unfortunately, you need it in a card-scoping rule. So how do you solve this? You need to define a higher priority deck scoping rule that calculates the force total and saves it into a variable. Then you can reference that variable in your lower priority card scoping rule. Setting a variable to the total would look something like: "eval total as { sum:cost.? }". Using that variable to compare it within the card scoping rule would look something like: "#[equiv] * val:cost.? <= @total * .2" Please note that I have NOT actually written these rules and tried them. I'm pretty sure something along these lines ought to achieve the objective you set forth. Use this as a starting point and give it a try. If you run into further problems, let me know and I'll take a closer look for you. Hope this helps, Rob At 07:51 PM 2/15/2004 +0000, you wrote: >I've started messing around with the various validation rules in card vault >(mainly adding rules to existing datafiles while I get the hang of how it >all works) and I've come undone with one rule. > >I'd like to specify that the sum of the cost of all copies of any card in >the deck must not exceed a given number. > >Specifically, this came up in the D&D minis mass battle rules where you can >spend up to 20% of your points on multiples of a particular miniature. > >Does anyone know how I can achieve this effect? --------------------------------------------------------------------------- Rob Bowes (rob@wolflair.com) (650) 588-8252 Lone Wolf Development www.wolflair.com ------------------------ Yahoo! Groups Sponsor ---------------------~--> Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511 http://us.click.yahoo.com/mOAaAA/3ex...sNAA/WuQolB/TM ---------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/cardvault/ <*> To unsubscribe from this group, send an email to: cardvault-unsubscribe@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/ |
#2 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Another query | Ralphey at mtgmelb.com | Card Vault | 1 | November 25th, 2003 02:48 PM |
Another query | Dean_Kirkpatrick at nas.a | Army Builder | 1 | February 15th, 2002 05:59 PM |
Query | bondage__69er at hotmail. | Army Builder | 4 | May 26th, 2000 04:26 PM |