Char (object)

From GCAWiki

Jump to: navigation, search

The Char 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.

Contents

[edit] 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

[edit] Properties & functions

[edit] Age

Description: Returns the character's age.

Prototype: Age

Parameters: none

Returns: [String] The character's age.

Example:

Char.Age

[edit] Appearance

Description: Returns the character's appearance.

Prototype: Appearance

Parameters: none

Returns: [String] The character's appearance.

Example:

Char.Appearance

[edit] BaseSw

Description: Returns base swing damage.

Prototype:

Parameters: none

Returns: [String] Base swing damage.

Example:

Char.BaseSw

[edit] BaseSwAdds

Description: Returns base swing adds.

Prototype: BaseSwAdds

Parameters: none

Returns: [Long] Base swing adds.

Example:

Char.BaseSwAdds

[edit] BaseSwDice

Description: Returns base swing dice.

Prototype: BaseSwDice

Parameters: none

Returns: [Long] Base swing dice.

Example:

Char.BaseSwDice

[edit] BaseTh

Description: Returns base thrust damage.

Prototype: BaseTh

Parameters: none

Returns: [String] Base thrust damage.

Example:

Char.BaseTh

[edit] BaseThAdds

Description: Returns base thrust adds.

Prototype: BaseThAdds

Parameters: none

Returns: [Long] Base thrust adds.

Example:

Char.BaseThAdds

[edit] BaseThDice

Description: Returns base thrust dice.

Prototype: BaseThDice

Parameters: none

Returns: [Long] Base thrust dice.

Example:

Char.BaseThDice

[edit] 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

[edit] 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

[edit] 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

[edit] Body

Description: A collection of all character body locations.

Prototype: Body(LocationIdKey)

Parameters:

LocationIdKey 
[Variant] The numeric index (Long) or the collection key (String) of the body location to return.

Returns: [Object Reference] A reference to the Body (object) which contains the selected body location.

Example:

Char.Body(ListId).DR

[edit] Campaign

Description: The character's campaign information.

Prototype: Campaign

Parameters: none

Returns: [Object Reference] A reference to the CampaignInfo (object).

Example:

Char.Campaign.LoggedPoints

[edit] 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)

[edit] 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)

[edit] 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

[edit] 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

[edit] 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

[edit] Description

Description: Returns the character's description.

Prototype: Description

Parameters: none

Returns: [String] The character's description.

Example:

Char.Description

[edit] 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

[edit] 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

[edit] FullName

Description: Returns the character's full name.

Prototype: FullName

Parameters: none

Returns: [String] The character's full name.

Example:

Char.FullName

[edit] Height

Description: Returns the character's height.

Prototype: Height

Parameters: none

Returns: [String] The character's height.

Example:

Char.Height

[edit] 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 0 (zero) on failure.

Example:

ListIdx = Char.ItemPositionByNameAndExt("Guns (Pistol)", TYPE_SKILL)

[edit] 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 0 (zero) on failure.

Example:

ListIdx = Char.ItemPositionByNameOnly("Tech Level", TYPE_STAT)

[edit] 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 0 (zero) on failure.

Example:

ListIdx = Char.ItemPositionBySymbol("HP", TYPE_STAT)

[edit] Items

Description: A collection of all character traits.

Prototype: Items(TraitIdKey)

Parameters:

TraitIdKey 
[Variant] The numeric index (Long) or the collection key (String) of the trait to return.

Returns: [Object Reference] A reference to the Item (object) which contains the selected trait.

Example:

Char.Items(ListId).TagItem("name")

[edit] Name

Description: Returns the character's name.

Prototype: Name

Parameters: none

Returns: [String] The character's name.

Example:

Char.Name

[edit] Notes

Description: Returns the character's notes.

Prototype: Notes

Parameters: none

Returns: [String] The character's notes.

Example:

Char.Notes

[edit] 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

[edit] 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

[edit] 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

[edit] 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

[edit] 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

[edit] Player

Description: Returns the player's name.

Prototype: Player

Parameters: none

Returns: [String] The player's name.

Example:

Char.Player

[edit] 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

[edit] Race

Description: Returns the character's race.

Prototype: Race

Parameters: none

Returns: [String] The character's race.

Example:

Char.Race

[edit] TL

Description: Returns the character's base tech level.

Prototype: TL

Parameters: none

Returns: [Integer] The character's base tech level.

Example:

Char.TL

[edit] 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

[edit] TotalWeight

Description: Returns net weight of all equipment.

Prototype: TotalWeight

Parameters: none

Returns: [Currency] Net weight of all equipment.

Example:

Char.TotalWeight

[edit] 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

[edit] Weight

Description: Returns the character's weight.

Prototype: Weight

Parameters: none

Returns: [String] The character's weight.

Example:

Char.Weight

[edit] See also

Personal tools