Character (object)
From GCAWiki
The Character object is primarily used in the Char variable and the Chars collection. It is used to access the base character data and is the base interface object from which all other character data collections and objects are accessed.
Trait type constants
GCA defines some constants, used by some of the character interface objects, for the various types of traits available to characters. The trait type constants are:
| Constant | Trait Type | |
|---|---|---|
| 1 | Statistics/Attributes | |
| 2 | Advantages (includes: Languages and Cultural Familiarities) | |
| 3 | Disadvantages | |
| 4 | Quirks | |
| 5 | Perks (under GURPS 3e this ID was defined as a Power) | |
| 6 | Skills (includes: Techniques and Ritual Magic Paths) | |
| 7 | Spells | |
| 8 | Equipment | |
| 9 | Templates/Meta-traits |
Properties & functions
Age
Description: Returns the character's age.
Prototype: Age
Parameters: none
Returns: [String] The character's age.
Example:
Char.Age
Appearance
Description: Returns the character's appearance.
Prototype: Appearance
Parameters: none
Returns: [String] The character's appearance.
Example:
Char.Appearance
BaseSw
Description: Returns base swing damage.
Prototype:
Parameters: none
Returns: [String] Base swing damage.
Example:
Char.BaseSw
BaseSwAdds
Description: Returns base swing adds.
Prototype: BaseSwAdds
Parameters: none
Returns: [Long] Base swing adds.
Example:
Char.BaseSwAdds
BaseSwDice
Description: Returns base swing dice.
Prototype: BaseSwDice
Parameters: none
Returns: [Long] Base swing dice.
Example:
Char.BaseSwDice
BaseTh
Description: Returns base thrust damage.
Prototype: BaseTh
Parameters: none
Returns: [String] Base thrust damage.
Example:
Char.BaseTh
BaseThAdds
Description: Returns base thrust adds.
Prototype: BaseThAdds
Parameters: none
Returns: [Long] Base thrust adds.
Example:
Char.BaseThAdds
BaseThDice
Description: Returns base thrust dice.
Prototype: BaseThDice
Parameters: none
Returns: [Long] Base thrust dice.
Example:
Char.BaseThDice
BlockIdKey
Description: Returns the ID Key of the trait being used for blocking, as selected in the GCA Protection window.
Prototype: BlockIdKey
Parameters: none
Returns: [Long] The ID Key of the trait being used for blocking.
Example:
Char.BlockIdKey
BlockScore
Description: Returns the score of the trait being used for blocking, as selected in the GCA Protection window.
Prototype: BlockScore
Parameters: none
Returns: [Integer] The score of the trait being used for blocking.
Example:
Char.BlockScore
BlockUsing
Description: Returns the name of the trait being used for blocking, as selected in the GCA Protection window.
Prototype: BlockUsing
Parameters: none
Returns: [String] The name of the trait being used for blocking.
Example:
Char.BlockUsing
Body
Description: A collection of all character body parts.
Prototype: Body
Parameters: none
Returns: [Object Reference] A reference to a collection of all character body parts via the BodyPartCollection (object).
Example:
Char.Body
Campaign
Description: The character's campaign information.
Prototype: Campaign
Parameters: none
Returns: [Object Reference] A reference to the CampaignInfo (object).
Example:
Char.Campaign
Cost()
Description: Returns the net point value of all of the traits of the specified type.
Prototype: Cost(TraitType)
Parameters:
TraitType- [Integer] Trait type.
Returns: [Currency] The net point value of all of the traits of the specified type.
Example:
Char.Cost(TYPE_SKILL)
Count()
Description: Returns the number of traits of the specified type.
Prototype: Count(TraitType)
Parameters:
TraitType- [Integer] Trait type.
Returns: [Long] The number of traits of the specified type.
Example:
Char.Count(TYPE_SKILL)
CurrentLoad
Description: Returns the net weight of the currently active loadout.
Prototype: CurrentLoad
Parameters: none
Returns: [Currency] The net weight of the currently active loadout.
Example:
Char.CurrentLoad
CurrentLoadOut
Description: Returns the name of the currently active loadout.
Prototype: CurrentLoadOut
Parameters: none
Returns: [String] The name of the currently active loadout or the empty string (""), if no loadout has been selected, which means that all items unassigned to any other loadout will be included.
Example:
Char.CurrentLoadOut
DateCreated
Description: Returns the date upon which the character was created.
Prototype: DateCreated
Parameters: none
Returns: [String] The date upon which the character was created.
Example:
Char.DateCreated
Description
Description: Returns the character's description.
Prototype: Description
Parameters: none
Returns: [String] The character's description.
Example:
Char.Description
DollarCost
Description: Returns the net monetary cost of the character.
Prototype: DollarCost
Parameters: none
Returns: [Currency] The net monetary cost of the character.
Example:
Char.DollarCost
EncumbranceLevel
Description: Returns the current encumbrance level of the character.
Prototype: EncumbranceLevel
Parameters: none
Returns: [Integer] The current encumbrance level of the character.
Example:
Char.EncumbranceLevel
FullName
Description: Returns the character's full name.
Prototype: FullName
Parameters: none
Returns: [String] The character's full name.
Example:
Char.FullName
Height
Description: Returns the character's height.
Prototype: Height
Parameters: none
Returns: [String] The character's height.
Example:
Char.Height
ItemPositionByNameAndExt()
Description: Searches the Items collection for the selected trait and returns its index, if found.
Prototype: ItemPositionByNameAndExt(ItemNameAndExt [, TypeWanted [, StartPos]])
Parameters:
ItemNameAndExt- [String] The full name, name and parenthesized name extension, of the trait to search for.
TypeWanted- [Integer] Optional: The trait type to limit the search to.
StartPos- [Long] Optional: The index to begin the search at.
Returns: [Long] Either the index in the Items collection of the first matching trait or zero (0) on failure.
Example:
ListIdx = Char.ItemPositionByNameAndExt("Guns (Pistol)", TYPE_SKILL)
ItemPositionByNameOnly()
Description: Searches the Items collection for the selected trait and returns its index, if found. As this function is not as specific in its search criteria as ItemPositionByNameAndExt(), it is recommended that you use it only when necessary.
Prototype: ItemPositionByNameOnly(ItemName [, TypeWanted [, StartPos]])
Parameters:
ItemName- [String] The name of the trait to search for.
TypeWanted- [Integer] Optional: The trait type to limit the search to.
StartPos- [Long] Optional: The index to begin the search at.
Returns: [Long] Either the index in the Items collection of the first matching trait or zero (0) on failure.
Example:
ListIdx = Char.ItemPositionByNameOnly("Tech Level", TYPE_STAT)
ItemPositionBySymbol()
Description: Searches the Items collection for the selected trait and returns its index, if found. As this function searches trait symbols, which are generally only set for statistics/attributes in the official data files, it is recommended that you use it only when necessary.
Prototype: ItemPositionBySymbol(ItemSymbol [, TypeWanted [, StartPos]])
Parameters:
ItemSymbol- [String] The symbol of the trait to search for.
TypeWanted- [Integer] Optional: The trait type to limit the search to.
StartPos- [Long] Optional: The index to begin the search at.
Returns: [Long] Either the index in the Items collection of the first matching trait or zero (0) on failure.
Example:
ListIdx = Char.ItemPositionBySymbol("HP", TYPE_STAT)
Items
Description: A collection of all character traits.
Prototype: Items
Parameters: none
Returns: [Object Reference] A reference to a collection of all character traits via the SortedItemCollection (object).
Example:
Char.Items
ItemsByType
Description: A collection of per trait type character trait collections.
Prototype: ItemsByType(TypeWanted)
Parameters:
TypeWanted- [Integer] The trait type collection of character traits to return.
Returns: [Object Reference] A reference to the selected trait type collection of character traits via the SortedItemCollection (object).
Example:
Char.ItemsByType(TYPE_AD)
Name
Description: Returns the character's name.
Prototype: Name
Parameters: none
Returns: [String] The character's name.
Example:
Char.Name
Notes
Description: Returns the character's notes.
Prototype: Notes
Parameters: none
Returns: [String] The character's notes.
Example:
Char.Notes
OtherDB
Description: Returns the other DB notes value, as entered in the GCA Protection window.
Prototype: OtherDB
Parameters: none
Returns: [String] Other DB notes.
Example:
Char.OtherDB
OtherDR
Description: Returns the other DR notes value, as entered in the GCA Protection window.
Prototype: OtherDR
Parameters: none
Returns: [String] Other DR notes.
Example:
Char.OtherDR
ParryIdKey
Description: Returns the ID Key of the trait being used for parrying, as selected in the GCA Protection window.
Prototype: ParryIdKey
Parameters: none
Returns: [Long] The ID Key of the trait being used for parrying.
Example:
Char.ParryIdKey
ParryScore
Description: Returns the score of the trait being used for parrying, as selected in the GCA Protection window.
Prototype: ParryScore
Parameters: none
Returns: [Integer] The score of the trait being used for parrying.
Example:
Char.ParryScore
ParryUsing
Description: Returns the name of the trait being used for parrying, as selected in the GCA Protection window.
Prototype: ParryUsing
Parameters: none
Returns: [String] The name of the trait being used for parrying.
Example:
Char.ParryUsing
Player
Description: Returns the player's name.
Prototype: Player
Parameters: none
Returns: [String] The player's name.
Example:
Char.Player
Portrait
Description: Returns the path to the character's portrait image.
Prototype: Portrait
Parameters: none
Returns: [String] The path to the character's portrait image.
Example:
Char.Portrait
Race
Description: Returns the character's race.
Prototype: Race
Parameters: none
Returns: [String] The character's race.
Example:
Char.Race
TL
Description: Returns the character's base tech level.
Prototype: TL
Parameters: none
Returns: [Integer] The character's base tech level.
Example:
Char.TL
TotalPoints
Description: Returns the net point value of the character.
Prototype: TotalPoints
Parameters: none
Returns: [Currency] The net point value of the character.
Example:
Char.TotalPoints
TotalWeight
Description: Returns net weight of all equipment.
Prototype: TotalWeight
Parameters: none
Returns: [Currency] Net weight of all equipment.
Example:
Char.TotalWeight
UnspentPoints
Description: Returns the net points remaining to be spent by the character.
Prototype: UnspentPoints
Parameters: none
Returns: [Currency] The net points remaining to be spent by the character, will be negative if the character has overspent.
Example:
Char.UnspentPoints
Weight
Description: Returns the character's weight.
Prototype: Weight
Parameters: none
Returns: [String] The character's weight.
Example:
Char.Weight