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

Old November 27th, 2005, 12:49 PM
By implication, I'm going to assume the there are other options on the unit. You want the option in question to only be available if sufficient other options have been selected to push the overall cost of the unit over 14 points.

The problem is that costs are being calculated AFTER everything is evaluated. So checking the cost during evaluation will always net you a value of zero. This means it is not possible to base the availability of an option on the in-progress cost of the containing entity.

There is only one approach I can think of that ought to work in this situation. You'll need to setup a private unit stat in which to track the necessary information during the evaluation process. This means having the various options for the unit assign their cost to the unit stat from their Evaluate script. You can use a Live tag expression to determine whether the option is valid by basing it on the current stat value.

Yes, I realize this is ugly, and probably a lot of work to setup. Another alternative would be to use a validation rule that simply ensures the option is not selected unless the entity model cost is above the threshold. This would be easy to do via a "unit" scope rule and a tag to identity when the option is selected.

I'm going to check with Colen in case he's got any brilliant ideas that I can't think of right now. If he comes up with anything, we'll be sure to post it here. :-)

Thanks, Rob

At 11:43 AM 11/27/2005, you wrote:

Quote:
Ok, I'm trying to set an option that will only be available if the model cost is over 14 points.
Something like entity.cost>14
But, nothing that simple is working, gah!

Thanks again
Butcher
rob is offline   #2 Reply With Quote