GPDL Character Variables
There are many variables associated with each character. Age, Sex, and Race are examples. All of the variables are available to the GPDL program. Some of the variables can be modified. Each variable has one function to access the value of the variable and, if the variable is modifiable, one function to set the value. During combat, these functions also work with monsters and NPC's.
All the functions are of the same form:
To access a variable:
$GET_CHAR_xxxxxx(index);
To set the value of a variable:
$SET_CHAR_xxxxxx(index, value);
In both cases, the xxxxxx is the name of the particular variable of interest and index is the zero-based position of the character in the party. See $FIND CHAR NAME to see how the position of a party member can be determined if his name is known. In the $SET_CHAR_xxxxxx functions, the value parameter will be assigned to the character's variable if it is a legal value. You cannot set a character's age to "Very Old", for example. The GPDL conversion of strings to numbers follows the general rules (See Data Type Conversions)
Following is a list of all the $GET and $SET functions associated with a character. The type of value is one of the following:
String - Such as a name.
Integer - Such as an age
Float - A 'real' number such as 3.14159
Each entry in the table also indicates whether the variable can be modified with the corresponding $SET_CHAR_xxxxx function.
Function name data type Settable? ------------- --------- --------- $GET_CHAR_NAME String No $GET_CHAR_AC integer Yes $GET_CHAR_HITPOINTS integer Yes $GET_CHAR_THACO integer Yes $GET_CHAR_RDYTOTRAIN integer Yes $GET_CHAR_CLERICEXP integer Yes $GET_CHAR_MAGICUSEREXP integer Yes $GET_CHAR_FIGHTEREXP integer Yes $GET_CHAR_RANGEREXP integer Yes $GET_CHAR_THIEFEXP integer Yes $GET_CHAR_DRUIDEXP integer Yes $GET_CHAR_PALADINEXP integer Yes $GET_CHAR_AGE integer Yes $GET_CHAR_MAXAGE integer Yes $GET_CHAR_MAXMOVE integer Yes $GET_CHAR_STR integer Yes $GET_CHAR_STRMOD integer Yes $GET_CHAR_INT integer Yes $GET_CHAR_WIS integer Yes $GET_CHAR_DEX integer Yes $GET_CHAR_CON integer Yes $GET_CHAR_CHA integer Yes $GET_CHAR_MAXENC integer Yes $GET_CHAR_ENC integer No $GET_CHAR_GENDER integer Yes $GET_CHAR_CLASS integer Yes $GET_CHAR_ALIGNMENT integer Yes $GET_CHAR_STATUS integer Yes $GET_CHAR_UNDEAD integer Yes $GET_CHAR_SIZE integer Yes $GET_CHAR_MAGICRESIST integer Yes $GET_CHAR_SAVEVSPPDM integer Yes $GET_CHAR_SAVEVSPP integer Yes $GET_CHAR_SAVEVSRSW integer Yes $GET_CHAR_SAVEVSBR integer Yes $GET_CHAR_SAVEVSSP integer Yes $GET_CHAR_CLERICLVL integer No $GET_CHAR_FIGHTERLVL integer No $GET_CHAR_RANGERLVL integer No $GET_CHAR_DRUIDLVL integer No $GET_CHAR_PALADINLVL integer No $GET_CHAR_THIEFLVL integer No $GET_CHAR_MAGUSERLVL integer No $GET_CHAR_CLERICPREVLVL integer No $GET_CHAR_FIGHTERPREVLVL integer No $GET_CHAR_RANGERPREVLVL integer No $GET_CHAR_DRUIDPREVLVL integer No $GET_CHAR_PALADINPREVLVL integer No $GET_CHAR_THIEFPREVLVL integer No $GET_CHAR_MAGUSERPREVLVL integer No $GET_CHAR_CLERICPDLVL integer No $GET_CHAR_FIGHTERPDLVL integer No $GET_CHAR_RANGERPDLVL integer No $GET_CHAR_DRUIDPDLVL integer No $GET_CHAR_PALADINPDLVL integer No $GET_CHAR_THIEFPDLVL integer No $GET_CHAR_MAGUSERPDLVL integer No $GET_CHAR_NBRHITDICE Float No $GET_CHAR_NBRATTACKS Float No $GET_CHAR_MORALE integer Yes $GET_CHAR_OPENDOORS integer Yes $GET_CHAR_OPENMAGICDOORS integer Yes $GET_CHAR_BENDLIF integer Yes $GET_CHAR_PICKPOCKETS integer Yes $GET_CHAR_OPENLOCKS integer Yes $GET_CHAR_FINDTRAPS integer Yes $GET_CHAR_MOVESILENT integer Yes $GET_CHAR_HIDESHADOWS integer Yes $GET_CHAR_HEARNOISE integer Yes $GET_CHAR_CLIMBWALLS integer Yes $GET_CHAR_READLANG integer Yes