Difference between revisions of "Pool Context"

From HLKitWiki
Jump to: navigation, search
(New page: {{context|Kit Reference|Context Transitions}} See Also: Pool Target References From within a "pool" context, you can utilize the following set of valid context transitions: :{| clas...)
 
Line 1: Line 1:
{{context|Kit Reference|Context Transitions}}
+
{{contextmulti|Kit Reference}}
  
See Also: [[Pool Target References]]
+
Jump to: [[#references|Target References]]
 +
 
 +
The "pool" context represents any usage pool associated with either the actor or a specific pick.
 +
 
 +
==Context Transitions{{anchor|transitions}}==
  
 
From within a "pool" context, you can utilize the following set of valid context transitions:
 
From within a "pool" context, you can utilize the following set of valid context transitions:
Line 8: Line 12:
 
|class="leftnormal"|-None-
 
|class="leftnormal"|-None-
 
|There are no transitions from within a pool context.
 
|There are no transitions from within a pool context.
 +
|-
 +
|}
 +
 +
==Target References{{anchor|references}}==
 +
 +
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.
 +
 +
:{| class="infotable"
 +
|class="leftnormal"|name
 +
|(Right, String) Returns the name assigned to the usage pool.<br>
 +
Example: result = this.name
 +
|-
 +
|abbrev
 +
|(Right, String) Returns the abbreviation assigned to the usage pool.<br>
 +
Example: result = this.abbrev
 +
|-
 +
|count
 +
|(Right, Number) Returns the number of historical entries that currently exist within the usage pool.<br>
 +
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.<br>
 +
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.<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'']
 +
|(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]
 +
|-
 +
|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.<br>
 +
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.<br>
 +
Example: result = this.history[3]
 
|-
 
|-
 
|}
 
|}

Revision as of 16:28, 7 December 2008

Context: HL KitKit Reference  … Multiple Sources

Jump to: Target References

The "pool" context represents any usage pool associated with either the actor or a specific pick.

Context Transitions

From within a "pool" context, you can utilize the following set of valid context transitions:

-None- There are no transitions from within a pool context.

Target References

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]