GPDL Overview
GPDL List of Functions
Utility Functions | |
$DEBUG( String ) | Writes the string to the engine debug file "UafErr_Engine.txt" and /Data/interp.log. See $DEBUG |
$DebugWrite( String ) | Writes the string to the engine debug file "UafErr_Engine.txt". You should supply your own linefeed characters. |
$DUMP_CHARACTER_SAS( Actor ) | Lists all Special Abilities for a given actor. |
Numeric Functions | |
See also: GPDL Expressions | |
$PLUS( String, String ) | Infinite precision - performs addition on the two strings, which should be numbers for best results |
$MINUS( String, String ) | Infinite precision - performs subtraction on the two strings with the second number being subtracted from the first |
$TIMES( String, String ) | Infinite precision - performs multiplication on the two strings |
$DIV( String, String ) | Infinite precision - performs division on the two strings, with the first number being divided by the second |
$MOD( String, String ) | Infinite precision - performs modulo with the two strings, with the first number being divided by the second |
$EQUAL( String, String ) | Infinite precision - compares the two strings for equality |
$LESS( String, String ) | Infinite precision - compares the two strings for the first being less than the second |
$GREATER( String, String ) | Infinite precision - compares the two strings for the first being greater than the second |
$NOT( String ) | Infinite precision - performs the logical opposite of the string |
$LENGTH( String ) | returns the length of a string, characters and spaces |
$NUMERIC( String ) | returns a string's numeric value |
$MIDDLE( String, String, String ) | Extracts characters from the middle of a string. See $MIDDLE |
$RANDOM( String ) | Returns a random number, with the string as the range. See $RANDOM |
The following functions deal with the GREP pattern matching engine. See More Regular Expressions | |
$GREP( String, String ) | See $GREP |
$WIGGLE( String ) | performs a GREP search in the previously GREPped range. See $WIGGLE |
$LISTEN | See $LISTEN |
$SAY | See $SAY |
$LISTENTEXT | See $LISTENTEXT |
Actors | |
Actors create actions. For scripting purposes, an Actor is an entity, not an object. Example: a = $TargetContext( ) will produce an error because "a = " will set "a" to equal a string, but "$TargetContext( )" is an Actor, not a string, and will not return a string. |
|
$AttackerContext( ) | Initiator of the current combat or spell action |
$CharacterContext( ) | Recipient of the current action |
$CombatantContext( ) | (Combat only) Recipient of the current action |
$TargetContext( ) | Recipient of the current combat or spell action |
$Myself( ) | Initiator of the current action |
$Name( String ) | Actor identified by name. ( String ) contains the name of the Actor. For PCs, there will only be one. All Monsters of the type named (such as "Orc") would be addressed by $Name(Orc). |
These are selected by condition or prior actions. Friendly or Enemy is referenced to the party. | |
$LAST_ATTACKER_OF( Actor ) | (Combat only) |
$LAST_HITTER_OF( Actor ) | (Combat only) |
$LAST_TARGETER_OF( Actor ) | (Combat only) |
$LEAST_DAMAGED_ENEMY( ) | (Combat only) |
$LEAST_DAMAGED_FRIENDLY( ) | (Combat only) |
$MOST_DAMAGED_ENEMY( ) | (Combat only) |
$MOST_DAMAGED_FRIENDLY( ) | (Combat only) |
$NEAREST_ENEMY_TO( Actor ) | (Combat only) |
$NEAREST_TO( Actor ) | (Combat only) |
Indices of Actors | |
Each Actor has and index. For PCs, the index is a number assigned (starting with 0) when the character is added to the party. The index will not change for the duration of the game. During combat, each additional combatant is assigned an index for the duration of the combat. If the last party member has "5", the first monster is assigned "6". For functions that address aspects of Actors, but require an index (i.e. String), use $IndexOf(Actor) to return the Actor's index. $IndexOf($Myself( )) is equivalent to $MyIndex( ). |
|
$IndexOf( Actor ) | Returns the index of the Actor |
$MyIndex( ) | Returns the index of $Myself( ) |
Non-Actor ContextsSee also: SA Special Abilities Scripts | |
$AbilityContext( ) | The name of the ability in the ability context |
$ClassContext( ) | The name of the class in the class context |
$ItemContext( ) | The name of the item in the current SA item context |
$MonsterTypeContext( ) | The name of the monster type in the monsterType context |
$RaceContext( ) | The name of the race in the race context. |
$SpellContext( ) | The name of the spell in the current SA spell context |
$SpellgroupContext( ) | The name of the spellgroup in the spellgroup context |
$TraitContext( ) | The name of the trait in the trait context |
Read-only Functions Set in Monster Editor | |
$GET_ISANIMAL( Actor ) | Returns 1 (true) or 0 (false) |
$GET_ISMAMMAL( Actor ) | Returns 1 (true) or 0 (false) Set to 1 for PCs |
$GET_ISSNAKE( Actor ) | Returns 1 (true) or 0 (false) |
$GET_ISGIANT( Actor ) | Returns 1 (true) or 0 (false) |
$GET_ISALWAYSLARGE( Actor ) | Returns 1 (true) or 0 (false) |
$GET_HASPOISONIMMUNITY( Actor ) | Returns 1 (true) or 0 (false) |
$GET_HASDEATHIMMUNITY( Actor ) | Returns 1 (true) or 0 (false) |
$GET_HASCONFUSIONIMMUNITY( Actor ) | Returns 1 (true) or 0 (false) |
$GET_HASVORPALIMMUNITY( Actor ) | Returns 1 (true) or 0 (false) |
$GET_HASDWARFACPENALTY( Actor ) | Returns 1 (true) or 0 (false) |
$GET_HASGNOMEACPENALTY( Actor ) | Returns 1 (true) or 0 (false) |
$GET_HASDWARFTHAC0PENALTY( Actor ) | Returns 1 (true) or 0 (false) |
$GET_HASGNOMETHAC0PENALTY( Actor ) | Returns 1 (true) or 0 (false) |
$GET_HASRANGERDMGPENALTY( Actor ) | Returns 1 (true) or 0 (false) |
$GET_CANBEHELDORCHARMED( Actor ) | Returns 1 (true) or 0 (false) Set to 1 for PCs |
$GET_AFFECTEDBYDISPELEVIL( Actor ) | Returns 1 (true) or 0 (false) |
Read-only | |
$Alignment( Actor ) | Returns alignment (e.g. Lawful Good) |
$AlignmentChaotic( Actor ) | Returns 1 (true) or "" (false) |
$AlignmentEvil( Actor ) | Returns 1 (true) or "" (false) |
$AlignmentGood( Actor ) | Returns 1 (true) or "" (false) |
$AlignmentLawful( Actor ) | Returns 1 (true) or "" (false) |
$AlignmentNeutral( Actor ) | Returns 1 (true) or "" (false) |
$Gender( Actor ) | Returns Male or Female |
$HitPoints( Actor ) | Returns current hit points |
$Status( Actor ) | Returns status. See Tables |
$IsUndead( Actor ) | Returns 1 (true) or "" (false) |
$IS_AFFECTED_BY_SPELL( Actor, String ) | String is the spell name such as "Find Traps". Returns 1 if present or "" if absent. |
$CHAR_DISPELMAGIC( Actor, String ) | Dispels magic of a certain spell level |
$CHAR_REMOVEALLITEMCURSE( Actor ) | Unreadies items marked "Cursed" in the item editor. |
$CHAR_REMOVEALLSPELLS( Actor, String ) | Remove all spells of a particular level |
Read-only Character Functions | |
$GET_CHAR_NAME( String ) | Returns character or monster name |
$GET_CHAR_NBRHITDICE( String ) | Monster only - Returns the number of hit dice possessed |
$GET_CHAR_TYPE( String ) | Returns @PC@ (PC), @NPC@ (NPC), or |
$GET_CHAR_ENC( String ) | Returns encumbrance as computed by the engine |
$GET_CHAR_NBRATTACKS( String ) | Returns the number of attacks allowed per round |
Read-write Character Functions | |
Abilities - numeric | |
$GET_CHAR_PERM_CHA( String ) | Gets Charisma value |
$GET_CHAR_ADJ_CHA( String ) | Gets Perm Charisma value plus any modifications |
$GET_CHAR_LIMITED_CHA( String ) | Gets Adjusted Charisma value with a min and max value - 1 and 25, respectively |
$SET_CHAR_PERM_CHA( String, String ) | Sets Perm Charisma value |
$GET_CHAR_PERM_CON( String ) | Gets Constitution value |
$GET_CHAR_ADJ_CON( String ) | Gets Perm Constitution value plus any modifications |
$GET_CHAR_LIMITED_CON( String ) | Gets Adjusted Constitution value with a min and max value - 1 and 25, respectively |
$SET_CHAR_PERM_CON( String, String ) | Sets Perm Constitution value |
$GET_CHAR_PERM_DEX( String ) | Gets Dexterity value |
$GET_CHAR_ADJ_DEX( String ) | Gets Perm Dexterity value plus any modifications |
$GET_CHAR_LIMITED_DEX( String ) | Gets Adjusted Dexterity value with a min and max value - 1 and 25, respectively |
$SET_CHAR_PERM_DEX( String, String ) | Sets Perm Dexterity value |
$GET_CHAR_PERM_INT( String ) | Gets Intelligence value |
$GET_CHAR_ADJ_INT( String ) | Gets Perm Intelligence value plus any modifications |
$GET_CHAR_LIMITED_INT( String ) | Gets Adjusted Intelligence value with a min and max value - 1 and 25, respectively |
$SET_CHAR_PERM_INT( String, String ) | Sets Perm Intelligence value |
$GET_CHAR_PERM_STR( String ) | Gets Strength value |
$GET_CHAR_ADJ_STR( String ) | Gets Perm Strength value plus any modifications |
$GET_CHAR_LIMITED_STR( String ) | Gets Adjusted Strength value with a min and max value - 1 and 25, respectively |
$SET_CHAR_PERM_STR( String, String ) | Sets Perm Strength value |
$GET_CHAR_PERM_STRMOD( String ) | Gets Strength Mod value |
$GET_CHAR_ADJ_STRMOD( String ) | Gets Perm Strength Mod value plus any modifications |
$GET_CHAR_LIMITED_STRMOD( String ) | Gets Adjusted Strength Mod value with a min and max value - 1 and 100, respectively |
$SET_CHAR_PERM_STRMOD( String, String ) | Sets Perm Strength Mod value |
$GET_CHAR_PERM_WIS( String ) | Gets Wisdom value |
$GET_CHAR_ADJ_WIS( String ) | Gets Perm Wisdom value plus any modifications |
$GET_CHAR_LIMITED_WIS( String ) | Gets Adjusted Wisdom value with a min and max value - 1 and 25, respectively |
$SET_CHAR_PERM_WIS( String, String ) | Sets Perm Wisdom value |
$MODIFY_CHAR_ATTRIBUTE( String, String, String, String, String, String, String ) | This function modifies character attributes and can be seen in $GET_CHAR_ADJ_XXX() and $GET_CHAR_LIMITED_XXX(). First string is the target, second string is the three letter abbreviation for an attribute such as "STR" or "WIS". The third string is the amount to modify. The fourth string is the name of the units of time for modification to last (currently only "MINUTES"), and the fifth string is the length of time. The sixth string is an artbitrary string of text to describe the modification (may be left blacnk) and the final string is the name of the modification. |
$REMOVE_CHAR_MODIFICATION( String, String ) | This function removes specific modifications made to character attributes. The first string is the target and the second string is the name of the modification (string #7 in the function directly above). Wild cards are supported in the second string. |
Ability Related - numeric, may equal 0 | |
$GET_CHAR_HITBONUS( String ) | Gets strength to-hit bonus |
$SET_CHAR_HITBONUS( String, String) | Sets strength to-hit bonus |
$GET_CHAR_DAMAGEBONUS( String ) | Gets strength damage bonus |
$SET_CHAR_DAMAGEBONUS( String, String ) | Sets strength damage bonus |
$GET_CHAR_MAXENC( String ) | Gets strength maximum encumbrance value |
$SET_CHAR_MAXENC( String, String ) | Sets strength maximum encumbrance value |
$SkillAdj( actor, string, string, string, string ) | This function is used to adj skills for a given character. The first string is the name of the skill to be adjusted. The second string is the id of the skill adjustment. The third string is the type of adjustment (see below) and the fourth string is the amount of the adjustment. Types of adjustments: "+" - addition; "-" - subtraction; "*" - multiplication; "D" - delete the named adjustment; "%" - adjustment is a percentile; "=" - set to an absolute value, "F" - final skill value after all modifications applied; "A" - returns the named adjustment and if none exists returns "NoSkill"; "B" - returns highes skill value before any adjustments applied; |
Class Related - numeric, may equal 0 | |
$GET_CHAR_CLASS( String ) | Gets class. See Tables |
$SET_CHAR_CLASS( String, String ) | Sets class. See Tables |
$GET_CHAR_Exp( String, String ) | Gets experience total, (index, class) |
$SET_CHAR_Exp( String, String, String ) | Sets experience total, (index, class, value) |
Trait, etc. - numeric, or as noted | |
$GET_CHAR_AC( String ) | Gets armor class |
$SET_CHAR_AC( String, String ) | Sets armor class |
$GET_CHAR_ADJAC( String ) | Gets adjusted armor class |
$GET_CHAR_EFFAC( String ) | Gets effective armor class |
$GET_CHAR_AGE( String ) | Gets age |
$SET_CHAR_AGE( String, String ) | Sets age |
$GET_CHAR_ALIGNMENT( String ) | Gets alignment. See Tables |
$SET_CHAR_ALIGNMENT( String, String ) | Sets alignment. See Tables |
$GET_CHAR_GENDER( String ) | Gets gender 0 (Male) or 1 (Female) |
$SET_CHAR_GENDER( String, String ) | Sets gender 0 (Male) or 1 (Female) |
$GET_CHAR_HITPOINTS( String ) | Gets current hit points |
$SET_CHAR_HITPOINTS( String, String ) | Sets current hit points |
$GET_CHAR_MAGICRESIST( String ) | Gets Magic Resistance percentage |
$SET_CHAR_MAGICRESIST( String, String ) | Sets Magic Resistance percentage |
$GET_CHAR_MAXAGE( String ) | Gets maximum age |
$SET_CHAR_MAXAGE( String, String ) | Sets maximum age |
$GET_CHAR_MAXHITPOINTS( String ) | Gets maximum hit points |
$SET_CHAR_MAXHITPOINTS( String, String ) | Sets maximum hit points |
$GET_CHAR_MAXMOVE( String ) | Gets maximum (adjusted) movement rate |
$SET_CHAR_MAXMOVE( String, String ) | Sets maximum movement rate in Min/Max Format |
$GET_CHAR_MORALE( String ) | Gets morale value |
$SET_CHAR_MORALE( String, String ) | Sets morale value |
$GET_CHAR_RACE( String ) | Gets the race name (Human, Elf, etc.) |
$SET_CHAR_RACE( String, String ) | Sets race by name |
$GET_CHAR_RDYTOTRAIN( String ) | Gets Ready to Train, returns 1 (true) or 0 (false) |
$SET_CHAR_RDYTOTRAIN( String, String ) | Sets Ready to Train, 1 (true) or 0 (false) |
$GET_CHAR_SEX( String ) | Returns Male or Female |
$SET_CHAR_SEX( String, String ) | Sets "Male" or "Female" |
$GET_CHAR_SIZE( String ) | Returns size, 0 small, 1 man-sized, 2 large |
$SET_CHAR_SIZE( String, String ) | Sets size, 0 small, 1 man-sized, 2 large |
$GET_CHAR_STATUS( String ) | Gets Status. See Tables |
$SET_CHAR_STATUS( String, String ) | Sets Status. See Tables |
$GET_CHAR_THAC0( String ) | Gets To Hit Armor Class Zero base number |
$GET_CHAR_ADJTHAC0( String ) | Gets adjusted To Hit Armor Class Zero number |
$SET_CHAR_THAC0( String, String ) | Sets To Hit Armor Class Zero number |
$GET_CHAR_UNDEAD( String ) | Returns the name of the undead type, as defined in the Monster Editor. A string returning "none" indicates the monster is not 'undead'. |
$SET_CHAR_UNDEAD( String, String ) | Gets undead type. See Tables |
Character ASLs - Formats (index, "ASL Name") or (index, "ASL Name", value) | |
$GET_CHAR_ASL( String, String ) | returns value of ASL, where first string is index of target, and second string is name of ASL |
$SET_CHAR_ASL( String, String, String ) | sets value of ASL, where first string is index of target, second string is name of ASL, and third string is value |
$IF_CHAR_ASL( String, String ) | Same as $GET_CHAR_ASL above |
Character Items and Item Groups | |
$ForEachPartyMember (SpecialAbilityName, ScriptName) | For each character in the party, this function runs the script described by the two parameters. The script will run with $CharacterContext defined for that character. |
$ForEachPossession(actor, scriptName) | For each item in the character' possession, this function will search the item's Special Abilities and run any scripts with the given name. The scripts will run with $CharacterContext and $ItemContext. The $ItemContext will be specific for each possession so that if the character possesses two items with the same name, the script will be run twice and each $ItemContext will indicate one item the first time and a different item the second time. |
$GET_CHAR_Ready( Actor, bodyPosition, num ) | Gets the name of the item readied at the given body position and the number of the item if applicable (numbering starts at 0). |
$SET_CHAR_Ready( Actor, bodyPosition, itemName, num ) | Readies the named item at the given bodyPosition. 'itemName' may be blank to unready any item at that position and num refers tot he number of the item if applicable (numbering starts at 0). |
$GIVE_CHAR_ITEM( Actor, itemName ) | Gives the named item to the actor. |
$TAKE_CHAR_ITEM( Actor, itemName ) | Takes the named item from the actor. |
Party Functions | |
$PARTYSIZE( ) | Returns # in party |
$InParty( Actor ) | Is Actor in the party? Returns 1 (true) "" (false) |
$GET_PARTY_ACTIVECHAR( ) | Returns index of active character |
$SET_PARTY_ACTIVECHAR( String ) | Sets ID'd character active |
$GET_PARTY_MINUTES( ) | returns current minutes of in-game time |
$SET_PARTY_MINUTES( String ) | sets current minutes of in-game time |
$GET_PARTY_HOURS( ) | returns current hours of in-game time |
$SET_PARTY_HOURS( String ) | sets current hours of in-game time |
$GET_PARTY_DAYS( ) | returns current days of in-game time |
$SET_PARTY_DAYS( String ) | sets current days of in-game time |
$GET_PARTY_TIME( ) | returns current value for in-game time |
$SET_PARTY_TIME( String ) | set value for current in-game time |
$GET_PARTY_FACING( ) | returns direction party is facing as numeric value; 0 = north, 1 = east, 2 = south, 3 = west |
$SET_PARTY_FACING( String ) | sets directoin party is facing (numeric value); 0 = north, 1 = east, 2 = south, 3 = west |
$GET_PARTY_MONEYAVAILABLE( String ) | returns the amount of money that the party has available |
$GET_PARTY_ASL( String ) | returns value of ASL where string is the name of the ASL |
$SET_PARTY_ASL( String, String ) | sets value of ASL where the first string is the name of the ASL and the second string is the value |
$IF_PARTY_ASL( String ) | Same as $GET_PARTY_ASL above |
$DELETE_PARTY_ASL( String ) | deletes party ASL, where string is the name of the ASL |
Global Functions | |
$CALL_GLOBAL_SCRIPT( saName, ScriptName ) | |
$GET_GLOBAL_ASL( String ) | returns the value of global ASL, where the string is the name of the ASL |
$SET_GLOBAL_ASL( String, String ) | sets value of global ASL; where first string is the name of the ASL and the second string is the value |
Level Functions | |
$GET_EVENT_Attribute(depth, name) | In general there is always an event active. Even while the party is wandering around the dungeon, an “Adventure” event is active, although it is not editable. Events can have a list of attributes (See the first page of the Event Editor). This function allows a script to retrieve the value of an Event Attribute. The depth parameter will generally be zero, to retrieve an attribute from the active event. On occasion one event will start another event and wait for its results. The event that is waiting is at depth one. 'name' is the name of the attribute and the function returns the value of that attribute of “-?-?-” if no such attribute is found. |
$GET_LEVEL_STATS_ASL( String, String ) | returns the value of level stats ASL; where the first string is the number of the level and the second string is the name of the ASL |
$IF_LEVEL_STATS_ASL( String, String ) | Same as $GET_LEVEL_STATS_ASL above |
Currency Functions | |
$COINNAME( String ) | String is number of coin in Global editor. |
$COINRATE( String ) | String is number of coin in Global editor. |
$COINCOUNT( Target, String ) | Target is who is checked and string is the coin number in the Global editor. |
$GET_VAULT_MONEYAVAILABLE( String ) | returns the money available in a vault; where the string is the number of the vault |
Combat Related Functions | |
$COMBATANT_AVAILATTACKS( Actor, String, String ) | Strings are integers representing the location to be checked, almost always "0" and "1", respectively. |
$AddCombatant( monsterName, friendlyFlag ) | Adds a monster to the combat. Eg: $AddCombatant("Ettin",0) |
$CombatantLocation( ID, value ) | The ID is the combatant for whom you wish to know the location. The value is either "X" or "Y", depending on whether you wish to ascertain the x or y coordinates. This function will return the x or y coordinate of the combatant depending upon the value chosen. |
$ComputeAttackDamage( attackerID, targetID ) | Both IDs are combatant IDs. Perform the standard ToHit and Damage computations as if the attacker had attacked the target. Returns resultant HitPoint damage. |
$GetCombatRound( ) | Returns the current Round number. This number starts at zero and in incremented for each round of combat. The turn number can be computed by dividing the round number by 10. |
$IsLineOfSight( x1, y1, x2, y2, unused ) | Returns “” or “1” depending on whether a character can see the location (x2,y2) from (x1,y1). The unused parameter may be used someday to add flags such as “Character can see over Orcs less than two inches tall”. |
$ListAdjacentCombatants( combatantID ) | List the 'combatantID's of all combatants that are immediately adjacent to the parameter combatant. The result is a 'Delimited String'. For Example “|2|4|5|8”. |
$NextCreatureIndex( creatureIndex, filter ) | Given a creatureIndex, this function returns the next index or the empty string if there are no more. To get the index of the first creature, start with an empty string. The filter parameter allows you to skip over certain creatures. A value of 1 skips over dead creatures. A value of 2 skips over creatures friendly to the party. A value of 4 skips over creatures that are non-friendly. A value of 8 skips over creatures that are off the map. You add these values to skip over combinations. To skip over dead creatures and creatures off the map, specify 9. Other filter functions can be added if you find something useful. So, to look through all the living creatures you should start with an empty string and do $NextCreatureIndex until you get another empty string. index = $NextCreatureIndex("", 1) $WHILE (index != "") { index = $NextCreatureIndex(index, 1) }; |
$SetFriendly( combatantID, value ) | Value 0=No modification (default) 1=Unconditionally friendly 2=Unconditionally un-friendly 3=Toggle default friendly any other=no change returns old value |
$TeleportCombatant( id, x, y ) | In combat only. 'id' is the 'combatant id' of the combatant to teleport to location (x,y). Eg: $TeleportCombatant($IndexOf($Myself()),12,22) |
$VisualDistance( ID1, ID2 ) | This function gives the distance between ID1 and ID2, where the IDs are the indeces of combatants. |
Special Ability Functions | |
$DELETE_CHARACTER_SA( object, Name ) | 'Name' is a string containing a special ability name 'object' is an 'actor' which contains the SA $DELETE_X_SA removes the special ability conpletely if it exists |
$DELETE_COMBATANT_SA( object, Name ) | |
$GET_ABILITY_SA (object, Name) | 'Name' is a string containing a special ability name 'object' is a string naming the object except that for characters and combatants it is an 'actor' fetches the parameter value of the special ability, if no such special ability exists then the function returns the value “-?-?-” |
$GET_BASECLASS_SA (object, Name) | |
$GET_CHARACTER_SA (object, Name) | |
$GET_CLASS_SA (object, Name) | |
$GET_COMBATANT_SA (object, Name) | |
$GET_ITEM_SA (object, Name) | |
$GET_MONSTERTYPE_SA (object, Name) | |
$GET_RACE_SA (object, Name) | |
$GET_SPELL_SA (object, Name) | |
$SA_ABILITY_GET (Name) | 'Name' is a string containing a special ability name 'object' is a string naming the object except that for characters and combatants it is an 'actor' uses the script context to search for special abilities; for example, $SA_ITEM_GET will only work if the script is running in the context of an item and it will search that item for the named special ability |
$SA_CHARACTER_GET (Name) | |
$SA_CLASS_GET (Name) | |
$SA_COMBATANT_GET (Name) | |
$SA_ITEM_GET (Name) | |
$SA_MONSTERTYPE_GET (Name) | |
$SA_RACE_GET (Name) | |
$SA_SPELL_GET (Name) | |
$SA_SPELLGROUP_GET (Name) | |
$SA_TRAIT_GET (Name) | |
$SA_NAME( ) | Retruns the name of Special Ability which holds the function. |
$SA_SOURCE_NAME( ) | Retrns the name of the thing which calls the Special Ability which holds the functions, such as a spell name "Bless". |
$SA_SOURCE_TYPE( ) | Returns the type of thing which calls the Special Ability which holds the function, such as ITEM. |
$SET_CHARACTER_SA (object, Name, value) | 'Name' is a string containing a special ability name 'object' is a string naming the object except that for characters and combatants it is an 'actor' either replaces the parameter value of the named special ability if it already exists or inserts a new special ability with the specified parameter value |
$SET_COMBATANT_SA (object, Name, value) | |
$SA_PARAM_GET( ) | Get parameter value for the special ability that triggered this script |
$SA_PARAM_SET( value ) | Set the parameter value of the special ability that triggered this script |
$SA_REMOVE( ) | Remove the Special Ability that triggered this script |
$SA_SA_GET( ) | Get the name of the Special Ability that triggered this script |
Hook Parameters | |
$GET_HOOK_PARAM( n ) | Fetch the value of Hook_Parameter[n] |
$SET_HOOK_PARAM( n, value ) | Set the value of Hook_Parameter[n] |
Other Functions | |
$Capitalize( string ) | make the first letter of the string capital - example: $Capitalize( "hello" ) = "Hello" |
$CURR_CHANGE_BY_VAL( ) | read-only function that returns value of Spell Editor -> Affected Character Attribute "Change By" amount |
$DAT_Baseclass_Experience( class, level ) | Fetches information from the 'baseclass.dat' file |
$DAT_Baseclass_Level( class, experience ) | fetches the minimum experience requirement for a particular class and level |
$DAT_Class_Baseclasses( class ) | returns a delimited list of baseclasses |
$DAT_Item_AttackBonus( item ) | Returns the attack bonus of an item, i.e. +1, +2, etc. |
$DAT_Item_CommonName( ID name ) | fetches the common name for an item, that is the name befor an item has been identified |
$DAT_Item_DamageLarge( item ) | Returns damage done to large targets by item, in the format %n%s%b, where n is the number of dice, s is teh sides per die, and b is the bonus. |
$DAT_Item_DamageSmall( item ) | Returns damage done to small targets by item, in the format %n%s%b, where n is the number of dice, s is teh sides per die, and b is the bonus. |
$DAT_Item_IDName( unique name ) | fetches the ID name for an item |
$DAT_Item_MaxRange( item ) | Returns the maximum range of an item. |
$DAT_Item_MediumRange( item ) | Returns the medium range of an item. |
$DAT_Item_Priority( item ) | Returns the priority of the item. |
$DAT_Item_ShortRange( item ) | Returns the short range of an item. |
$DAT_Race_Height( actor ) | fetches a value for actor's height based on race database |
$DAT_Race_Weight( actor ) | fetches a value for actor's weight based on race database |
$DelimitedStringAdd( ds, head, delimiter ) | Adds a substring to a string. ds is the delimited string, head is the substring, and delimiter is the delimiter. |
$DelimitedStringCount( String ) | first character of the string is the delimiter - this function counts the number of delimiters in the string |
$DelimitedStringFilter( ds, dsF, filter ) | Used to filter a delimited string. ds is the delimited string, dsF is the substring which is filtered, and filter is currently onnly able to be "AndNot" which means teh result will be a delimited string that does not contain whatever you used in dsF. |
$DelimitedStringHead( string ) | Returns the first substring of a string. |
$DelimitedStringSubstring( String, n ) | first character of the string is the delimiter; it returns the text following the nth delimiter; the first delimiter is number zero |
$DelimitedStringTail( string ) | Returns everything but the first stubstring of a string. |
$DownCase( string ) | make all letters in string lower case - example: $DownCase( "CoCoAsPuD" ) = "cocoaspud" |
$GET_GAME_CURRLEVEL( ) | retrieves the current level of the design |
$GET_GAME_VERSION( ) | retrieves the version of the game (set in Editor) |
$SpellAdj(actor,school,id,first,last,p,b) | Used to adjust the outcome of a spell. The school is the name of the spell school or the wildcard "*" for all. Id is a unique name in case more than one adjustment is to be applied to the spell. First is a numeric value for the first spell level to change, and last is a numeric value for the last level to change. P is the percentage to change and B is the bonus. |
$GET_SPELL_CanBeDispelled( String ) | determines if spell can be dispelled; where the string is the index of the spell |
$GET_SPELL_Level( String ) | retrieves level of spell named in the string |
$GET_CHAR_Lvl( String, String ) | The first string is the target of the funcion, and the second string is the class which you wish to check. |
$CastSpellOnTarget( Actor, String ) | The actor is the target of the script and the string is the name of the spell in quotations. |
$CastSpellOnTargetAs( Actor, String, Actor ) | The first actor is the target of the script and the string is the name of the spell in quotations, anf the second actor the caster.. |
$RUN_CHAR_SCRIPTS( creatureIndex, scriptName ) | See $IsLegalCreature for the meaning of 'creatureIndex'. This function searches the specified creature's Special Abilities for scripts of the given name. Any that are found are run until one of them returns a value starting with 'N'. If none returns an 'N' then, in combat mode, the associated combatant's Special Abilities are similarly searched and scripts are run in the same way. The scripts that are found share the Hook Parameters with the script containing this function call. Thus you can pass parameters to the called scripts and receive results back via the $GET/SET_HOOK_PARAM functions. The value returned by this function is currently undefined. |
$UpCase( string ) | make all letters in string upper case - example: $UpCase( "CoCoAsPuD" ) = "COCOASPUD" |
$SET_QUEST( questName, string ) | The questName is the name of the quest you wish to manipulate and the string is the value you wish to modify it by or set it to. For example, "+10" adds 10 to the current stage of the quest, while "10" would set the stage to 10. There is no 'GET' equivalent for this function. To use this to retrieve a value, set the string to "+0" (include quotation marks) |
$GET_CONFIG( value ) | Used to obtain any value listed in the “config.txt” file. Value is keyword on left of equal sign, returns data on right of equal sign |
Graphic Drawing Functions | |
Set of functions used to control display for Character View screen (at this time). For complete description, see Graphics Drawing Functions | |
$GrSet(name, integer, integer) | Sets the named variable to the value of the two integers. Either or both integers can be replaced with a vname. The appropriate value of vname will be used. |
$GrPrint(text) | Display text |
$GrPrtLF(text) | Display text and tne add linefeed value |
$GrMove(vname) | Add a new value |
$GrMoveTo(vname) | Set to value named |
$GrColor(color_name) | Set color of text to: BLUE, GREEN, ORANGE, RED, WHITE, YELLOW |
$GrMark(vname) | Sets vname to the current value of “Cursor” |
$GrTab(vname) | Move a preset amount |
AURA | |
$AURA_AddSA(saName, saParameter) | Adds a Special Ability to the AURA. Result value undefined. |
$AURA_Attach(attachType) | Define how the AURA is attached to the battlefield. Possible values are:
“Combatant” - The AURA originates at the cell occupied by a combatant. Angle zero is to the east. “CombatantFacing” is the same as “Combatant” except that angle zero is in the direction the combatant is facing (usually the direction of most recent movement). “XY” - The AURA is attached to a fixed point on the battlefield. Angle zero is to the east. |
$AURA_Combatant(combatantIndex) | If the attachment type is “Combatant” then this defines the combatant index of the combatant to which the AURA is attached. Otherwise, this is ignored. |
$AURA_Destroy() | Removes the AURA from the battlefield. Result value undefined. |
$AURA_GetData(index, data) | Gets one of the ten available user data variables. Return value is the value of the variable. |
$AURA_GetSA(saName) | Result value is the parameter associated with the Special Ability. IF no such Special Ability exists then the result value is “-?-?-”. |
$AURA_Location(x, y) | If the attachment type is “XY” then this defines the point on the battlefield to which the AURA is attached. Otherwise, this location is ignored. |
$AURA_RemoveSA(saName) | Removes the Special Ability from the AURA. Result value is the same as for $AURA_GetSA(saName); |
$AURA_SetData(index, data) | Sets one of the ten available user data variables. Return value is the previous value of the variable. |
$AURA_Shape(shape) | Defines the shape of the AURA. Possible values are: “AnnularSector” - The AURA is shaped like a circle with an interior circle removed....like a 2-dimensional doughnut. The four size parameters (see $AURA_Size) determine its size as follows: s1 is the radius of the interior circle; s2 is the radius of the outer circle; s3 is the starting angle; s4 is the included angle. Angles are measured starting with a line as described in the description of $AURA_Attach and extending counter-clockwise. The units are degrees. Examples: (0,6,77,360) would be a full circle with radius 6. (0,6,90,90) would be a quarter-circle to the northwest. (5,6,0,360) would be a full doughnut with internal radius 5 and external radius 6. “None” - The AURA remains on the battlefield but it has no extent. The size parameters are unchanged but are ignored. |
$AURA_Size(s1, s2, s3, s4) | Defines the size of the AURA. See the function $AURA_Shape for a discussion of how the four parameters are interpreted. |
$AURA_Spell(spellName) | Defines a spell whose “Linger Graphic” will be used to show the cells affected by the AURA. |
$AURA_Wavelength(waveType) | Defines the wavelength of the radiation used to determine the AURA's extent. The engine starts at the AURA's source and illuminates each of (up to) 104 directions. Different wavelengths of radiation are interrupted by different objects. Possible values for waveType: “Visible” - This radiation is interrupted by combatants or walls. “Xray” - This radiation passes through combatants but is stopped by walls. “Neutrino” - This radiation passes through combatants and walls. |
Back to GPDL Overview