Pool Target References: Difference between revisions
From HLKitWiki
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 23: | Line 23: | ||
|(Right, Number) Discards all adjustments for the usage pool and resets the value to its initial default. Always returns a value of zero.<br> | |(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 | 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] | |||
|- | |- | ||
|rollback | |rollback | ||
|(Right, Number) Rolls back (i.e. undoes) the | |(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 | 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] | |||
|- | |- | ||
|} | |} |
Revision as of 04:22, 7 December 2008
Context: HL Kit … Kit Reference … 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]