• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Parameters for Display Expression of Stat Calc?

shaggai

Well-known member
This is for the AB3.1 & the WH40K files.

The Faith point counter for the Witchhunters uses a Stat Calc to determine to total number of faith points available. This calculation used to be shown on all rosters, although it was recently revealed that it could now be tied down to a roster, (e.g, roster.ohw | roster.omd | roster.sm | roster.ig).

The question is, is it possible to bring this down to a more specific situation - such as if it will only display if a unit with the "Faith" stat has been selected, or a unit with a tag (which is known to give faith points) has been selected?
 
Perhaps calculate a hidden faith points count overall. Then create a statcalc to show the faith points. But in the display expression put something like roster.wh & (statCalc[FaithPoints] > 0).

Dunno if it'll work that way.
 
The tag expression used by a stat calc must be comprised of global tags. Normally, this means you are limited to "roster" tags and "ruleset" tags. However, since stat calcs are processed AFTER the roster has been fully evaluated, you ought to be able to utilize ANY global tag. This means that you can define your own global tag, assign it via an entity or option, and then test against it within the tagexpr for a stat calc. So you could assign a global tag to all units that have the "Faith" stat or to options that adjust the "Faith" stat, and then the tag expression ought to work against that tag.

** IMPORTANT NOTE! **

Adding global tags to options is generally a **BAD** idea. There are a variety of reasons, and they are outlined in various places within the documentation. Only uses global tags on options as a last resort. If there is ANY way that you can tie the dependency to tags assigned by top-level units or items, please make sure to do it that way.

-Rob

At 11:20 PM 12/27/2005, you wrote:

This is for the AB3.1 & the WH40K files.

The Faith point counter for the Witchhunters uses a Stat Calc to determine to total number of faith points available. This calculation used to be shown on all rosters, although it was recently revealed that it could now be tied down to a roster, (e.g, roster.ohw | roster.omd | roster.sm | roster.ig).

The question is, is it possible to bring this down to a more specific situation - such as if it will only display if a unit with the "Faith" stat has been selected, or a unit with a tag (which is known to give faith points) has been selected?
 
You can only access the value of a stat calc from within a script. The display of a stat calc is controlled via a tag expression. That means that you have to utilize tags (that can be tested in via the tag expresion) to control the visibility.

This is a critical distinction that is relatively easy to overlook, so I thought it was important to clarify here. :-)

-Rob

At 01:46 PM 12/28/2005, you wrote:

Perhaps calculate a hidden faith points count overall. Then create a statcalc to show the faith points. But in the display expression put something like roster.wh & (statCalc[FaithPoints] > 0).

Dunno if it'll work that way.
 
Back
Top