Pool Target References: Difference between revisions

From HLKitWiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{context|Kit Reference|Target References}}
{{context|Kit Reference|Target References}}
See Also: [[Pool Context Transitions]]


The "pool" script context corresponds to the contents of a usage pool, whether it be associated with a pick or directly on the actor. The complete list of target references for usage pools is presented in the table below.
The "pool" script context corresponds to the contents of a usage pool, whether it be associated with a pick or directly on the actor. The complete list of target references for usage pools is presented in the table below.
Line 5: Line 7:
:{| class="infotable"
:{| class="infotable"
|class="leftnormal"|name
|class="leftnormal"|name
|(Right, String)  
|(Right, String) Returns the name assigned to the usage pool.<br>
Example: result = this.name
|-
|-
|abbrev
|abbrev
|(Right, String)  
|(Right, String) Returns the abbreviation assigned to the usage pool.<br>
Example: result = this.abbrev
|-
|-
|count
|count
|(Right, Number)  
|(Right, Number) Returns the number of historical entries that currently exist within the usage pool.<br>
Example: result = this.count
|-
|-
|value
|value
|(Right, Number)  
|(Right, Number) Returns the net adjusted value for the usage pool, after applying all of the adjustments that have been assigned.<br>
Example: result = this.value
|-
|-
|empty
|empty
|(Right, Number)  
|(Right, Number) Discards all adjustments for the usage pool and resets the value to its initial default. Always returns a value of zero.<br>
Example: perform this.empty
|-
|adjust[''value'']
|(Right, Number) Applies an adjustment to the usage pool in the amount given by the ''value'' parameter, which can be an arithmetic expression of any type. Always returns a value of zero.<br>
Example: perform this.adjust[42]
|-
|-
|set[''value'']
|set[''value'']
|(Right, Number)  
|(Right, Number) Applies an adjustment to the usage pool that sets the net value of the pool to the new total given by the ''value'' parameter. For example, if the current net value of the pool is 14 and ''value'' is 17, an adjustment of 3 is applied. Always returns a value of zero.<br>
|-
Example: perform this.set[42]
|adjust[''value'']
|(Right, Number)
|-
|-
|rollback
|rollback
|(Right, Number)  
|(Right, Number) Rolls back (i.e. undoes) the most recent adjustment that was applied to the usage pool. Always returns a value of zero.<br>
Example: perform this.rollback
|-
|-
|history[''index'']
|history[''index'']
|(Right, Number)  
|(Right, Number) Returns the value of an individual adjustment in the change history. The specific entry is given by the ''index'' parameter, which can be an arithmetic expression. The index is zero-based, so the index must a value between zero and the total number of entries in the usage pool minus one. The zeroth entry is the most recent adjustment, with an increasing value proceeding further backwards in history. This provides a way to retrieve a report of all of the adjustments in the history of the pool and format them however you want.<br>
Example: result = this.history[3]
|-
|-
|}
|}

Latest revision as of 13:16, 7 December 2008

Context: HL Kit &#133; Kit Reference &#133; Target References 

See Also: Pool Context Transitions

The "pool" script context corresponds to the contents of a usage pool, whether it be associated with a pick or directly on the actor. The complete list of target references for usage pools is presented in the table below.

name (Right, String) Returns the name assigned to the usage pool.

Example: result = this.name

abbrev (Right, String) Returns the abbreviation assigned to the usage pool.

Example: result = this.abbrev

count (Right, Number) Returns the number of historical entries that currently exist within the usage pool.

Example: result = this.count

value (Right, Number) Returns the net adjusted value for the usage pool, after applying all of the adjustments that have been assigned.

Example: result = this.value

empty (Right, Number) Discards all adjustments for the usage pool and resets the value to its initial default. Always returns a value of zero.

Example: perform this.empty

adjust[value] (Right, Number) Applies an adjustment to the usage pool in the amount given by the value parameter, which can be an arithmetic expression of any type. Always returns a value of zero.

Example: perform this.adjust[42]

set[value] (Right, Number) Applies an adjustment to the usage pool that sets the net value of the pool to the new total given by the value parameter. For example, if the current net value of the pool is 14 and value is 17, an adjustment of 3 is applied. Always returns a value of zero.

Example: perform this.set[42]

rollback (Right, Number) Rolls back (i.e. undoes) the most recent adjustment that was applied to the usage pool. Always returns a value of zero.

Example: perform this.rollback

history[index] (Right, Number) Returns the value of an individual adjustment in the change history. The specific entry is given by the index parameter, which can be an arithmetic expression. The index is zero-based, so the index must a value between zero and the total number of entries in the usage pool minus one. The zeroth entry is the most recent adjustment, with an increasing value proceeding further backwards in history. This provides a way to retrieve a report of all of the adjustments in the history of the pool and format them however you want.

Example: result = this.history[3]