bar.name

From RPTools Wiki
Revision as of 03:03, 23 December 2008 by Cclouser (talk | contribs) (New page: The ''bar.[bar_name]'' variable permits the getting and setting of the token bar value (and the corresponding image displayed on the token) programmatically. Token bars are o...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The bar.[bar_name] variable permits the getting and setting of the token bar value (and the corresponding image displayed on the token) programmatically. Token bars are one, two, or multi-image graphical elements displayed on a token that are used (typically) to visually indicate the status of consumable or expendable items or character traits (such as Hit Points, Ammunition, Health, or the like).

Bars, like token states, are configured via the Campaign Properties dialog and are specific to the campaign in which they exist. In the screenshot shown below, the green-on-black line across the top of the token is a token bar.

Usage

[bar.[bar_name] = value]

Sets the value of the token bar named bar_name to the desired value. bar_name is set when the bar is created, and may be any name, provided it contains no spaces or special characters except the underscore.

Examples

[HP = HP - DamageTaken]
[bar.Health = HP / MaxHP]

Sets the value of bar.Health to the result of HP / MaxHP. This value is a percentage, and the bar image is adjusted to correspond to the set value.

Related Pages