The DEFINE tag is used to create new variables and set their initial values. In addition to the entry for the tag itself this page will go into the details of using variables, formulas and math operators.
Tag Name: DEFINE:x|y
Variables Used (x): Text (Name of variable)
Variables Used (y): Number or Formula (Can be a formula involving pre-defined variables, numbers, operators and user-defined-variables.)
What it does:
Example:
DEFINE:MonkeyChop|2
Creates a new variable named MonkeyChop and sets the initial value to 2.
DEFINE:MonkeySwing|TL/2
Creates a new variable named MonkeySwing and sets the initial value to half the characters total level.
For those unfamiliar with computer programming or higher math a variable is a symbol which represents a quantity that is not fixed. Most peoples first introduction to variables is in algebra where you might be given a problem such as x+y=z. This is a formula, the x,y and z are variables. PCGen uses variables and formulas for a wide variety of purposes through out the program, some are created in LST files while others are pre-defined, that is they are hard coded and can be used in any formula in any LST file in any game mode. Pre-defined variables are listed below.
Variable Names:
Pre-defined Variables:
ACCHECK
This is the total AC Check penalty from armor and shield.
ARMORACCHECK
This is the total AC Check penalty from armor.
BAB
For classes which have O (for Other) as their BAB progression, you can use a
formula for their BAB progression. e.g. DEFINE:BAB|2*CL would be +2 per
class-level.
BASESPELLSTAT
This is the mod for the class's base spell stat.
BL=name
This will return the Bonus Spellcaster Levels to the class specified, which usually come from Prestige classes.
For example, lets say you have 2 levels Mystic Theurge which add to both your Cleric and Wizard levels,
3 levels of Archmage which add to your Wizard level,
and 1 level of Loremaster which adds to your Cleric level.
BL=Wizard would return 5 and BL=Cleric would return 3.
CHA
This is the character's CHA modifier.
CHASCORE
This is the character's actual Charisma score.
CON
This is the character's CON modifier.
CONSCORE
This is the character's actual Constitution score.
COUNT[CLASSES]
This is the character's number of classes.
COUNT[DOMAINS]
This is the character's number of domains.
COUNT[FEATNAME=name]
This is the number of feats of the given name. Great for multiple
feats that grant bonuses based on the number of times taken.
COUNT[FEATS]
This is the character's number of optionally chosen feats (not automatic or
virtual).
COUNT[FEATSALL]
This is the character's total number of feats (includes automatic and virtual).
COUNT[FEATTYPE=type]
This is the character's number of feats matching specified type.
COUNT[FOLLOWERS]
This is the character's number of Followers.
COUNT[LANGUAGES]
This is the character's number of languages.
COUNT[SA]
This is the character's number of unique special abilities.
COUNT[SKILLS]
This is the character's number of skills.
COUNT[SPELLCLASSES]
This is the character's number of spellcasting classes.
COUNT[STATS]
This is the number of defined stats.
CL
Class Level of this class.
CL=name
Class Level of the named class.
CLASS=name
Returns a 1 if the character has the named class, otherwise 0.
CLASSLEVEL=name
Class Level of the named class, replacing { with ( and } with ). e.g.
CLASSLEVEL=Warrior {Ruby} would return the level of Warrior (Ruby)
since ( and ) have other meanings in DEFINE variables.
DEX
This is the character's DEX modifier.
DEXSCORE
This is the character's actual Dexterity score.
ENCUMBERANCE
This is a value representing the character's current encumbrance level
(0=Light, 1=Medium 2=Heavy, 3=Over-Loaded).
GRAPPLESIZEMOD
This is the character's Grappling Size Mod.
HASDEITY:
This returns 1 if the character has the named deity, otherwise 0.
HASFEAT:
This returns 1 if the character has the named feat, otherwise 0.
HD
This is the character's HD (Starting HD or Monster HD. Not HD from classes).
HIDESIZEMOD
This is the character's Hide Size Mod.
INT
This is the character's INT modifier.
INTSCORE
This is the character's actual Intelligence score.
MOVEBASE
This is the character's racial-based movement.
SHIELDACCHECK
This is the total AC Check penalty from shields.
SIZE
This is a value representing the character's current size.
SIZEMOD
This is the modifier for the character's current size.
SKILLRANK=name
This is the character's Ranks in the named skill replacing { with ( and } with ). e.g.
SKILLRANK=Craft {Woodworking} would return the ranks of Craft (Woodworking)
since ( and ) have other meanings in DEFINE variables. If used within a JEP formula you will need to enclose it in a variable function
e.g. var("SKILLRANK=Craft {Woodworking}")
SPELLLEVEL
This is a global variable that is set by the spell's level.
STR
This is the character's STR modifier.
STRSCORE
This is the character's actual Strength score.
TL
Total Level of character.
VARDEFINED:
This returns 1 if the character has the named variable, otherwise 0.
WEIGHT.CARRIED
is the weight of all carried equipment.
WEIGHT.EQUIPPED
is the weight of all equipped items.
WEIGHT.PC
is the weight of the PC.
WEIGHT.TOTAL
is the weight of all carried items and PC.
WIS
This is the character's WIS modifier.
WISSCORE
This is the character's actual Wisdom score.
Note: This information has been moved to the Math Operators and Formulas page.