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 and a subset of User-defined variables (that have been created by PCGen Data Monkeys) are listed below.
Variable Names:
This is the total AC Check penalty from armor and shield.
This is the total AC Check penalty from armor.
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.
This is the mod for the class's base spell stat.
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. Replace { with ( and } with ). e.g. BL=Cleric {Special} would return the bonus levels of Cleric (Special) 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("BL=Cleric {Special}")
CASTERLEVEL is a special variable for use within some Spell tags. See the CASTERLEVEL tag entry on the Spell tag page.
This is the character's CHA modifier.
This is the character's actual Charisma score.
Class Level of this class.
Class Level of the named class.
Update:
This can now be done with the classlevel() JEP function.
Returns a 1 if the character has the named class, otherwise 0. Replace { with ( and } with ). e.g. CLASS=Ranger {Special} would check for Ranger (Special) 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("CLASS=Ranger {Special}")
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. If used within a JEP formula you will need to enclose it in a variable function e.g. var("CLASSLEVEL=Warrior {Ruby}")
This is the character's CON modifier.
This is the character's actual Constitution score.
This is the character's number of classes.
This is the character's number of domains.
This is the number of feats of the given name. Great for multiple feats that grant bonuses based on the number of times taken.
This is the character's number of optionally chosen feats (not automatic or virtual).
This is the character's total number of feats (includes automatic and virtual).
This is the character's number of feats matching specified type.
This is the character's number of Followers.
This is the character's number of languages.
This is the character's number of unique special abilities.
This is the character's number of skills.
This is the character's number of spellcasting classes.
This is the number of defined stats.
This is the character's Challenge Rating.
This is the character's DEX modifier.
This is the character's actual Dexterity score.
This is the character's Effective Character Level. It is the sum of all class levels plus any level adjustment the character might have.
This is a value representing the character's current encumbrance level (0=Light, 1=Medium 2=Heavy, 3=Over-Loaded).
*** Updated 5.11.4
This returns 1 if the character has the named deity, otherwise 0.
This returns 1 if the character has the named feat, otherwise 0.
This is the character's HD (Starting HD or Monster HD. Not HD from classes).
This is the character's maximum total hit points.
This is the character's adjustment to initiative excluding any dexterity modifier.
This is the character's adjustment to initiative (including dexterity modifier and +4 if you have the Improved Initiative feat).
This is the character's INT modifier.
This is the character's actual Intelligence score.
This is the character's racial-based movement.
This is the total AC Check penalty from shields.
This is a value representing the character's current size. Fine=0, Diminutive=1, Tiny=2, Small=3, Medium=4, Large=5, Huge=6, Gargantuan=7, Colossal=8. The size designations, including abbreviations, are dependant upon the gamemode used and may be redefined in the sizeadjustments.lst file.
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}")
Update:
This can now be done with the skillinfo() JEP function.
This is the character's total in the named skill replacing ( with { and ) with }. e.g. SKILLTOTAL=Craft {Woodworking} would return the total 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("SKILLTOTAL=Craft {Woodworking}")
Update:
This can now be done with the skillinfo() JEP function.
This is the character's spell failure percentage for all equipped armor.
This is the character's spell resistance.
This is the character's STR modifier.
This is the character's actual Strength score.
Total Level of character, this includes all PC, NPC and Monster class levels. It does not include any level adjustments the character may have
This returns 1 if the character has the named variable, otherwise 0.
is the weight of all carried equipment.
is the weight of all equipped items.
is the weight of the PC.
is the weight of all carried items and PC.
This is the character's WIS modifier.
This is the character's actual Wisdom score.
Note: This is not a definitive list, but a subset showing some of the common user defined variables that PCGen uses.
Ability to take Extra Turning if >= 1
Ability to use a Holy Avenger as a Paladin if >= 1
Ability to use Bardic Knowledge if >= 1
Ability to use Bardic Music if >= 1
Ability to Turn Undead if >= 1
Note: This information has been moved to the Math Operators and Formulas page.