State Context

From HLKitWiki
Revision as of 23:50, 7 December 2008 by Rob (talk | contribs)
Jump to navigationJump to search

Context: HL Kit … Kit Reference  … Multiple Sources

Jump to: Target References

The "state" context provides access to overall state information that pertains to the portfolio as a whole or general information about the evaluation cycle.

Context Transitions

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

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

Target References

The "state" context is a general context that maintains information outside the normal data hierarchy. The target references for this context span a wide range of details that may prove useful within your scripts. The complete list of target references for the "state" context is presented in the table below.

isfocus (Right, Number) Returns non-zero if a focus pick has been properly established via the "setfocus" target reference.

Example: result = state.isfocus

clearfocus (Right, Number) Clears any focus pick that has been established and resets to a state where there is no focus pick.

Example: perform state.clearfocus

timing (Right, String) Returns the phase and priority timing during which the current script is being invoked in an effort to simplify debugging of data files.

Example: result = state.timing

iscreate (Right, Number) Returns non-zero if the character is currently in creation mode.

Example: result = state.iscreate

isadvance (Right, Number) Returns non-zero if the character is currently in advancement mode.

Example: result = state.isadvance

issell (Right, Number) Returns non-zero if the user is currently in the midst of a sell transaction.

Example: result = state.issell

isload (Right, Number) Returns non-zero if the loading of a saved portfolio is currently in progress.

Example: result = state.isload

isoutput (Right, Number) Returns non-zero if the rendering of character sheet output is currently in progress.

Example: result = state.isoutput

isdossierstyle[style] (Right, Number) Returns whether the user selected text output to be formatted in the style given by the style parameter. The style parameter must be one of the following values: "plain", "html", or "bbcode".

Example: result = state.isdossierstyle[html]

istext (Right, Number) Returns non-zero if the render of text output is currently in progress.

Example: result = state.istext

iscombat (Right, Number) Returns non-zero if combat mode is currently enabled within the Tactical Console.

Example: result = state.iscombat

isendturn (Right, Number) Returns non-zero if all combatants have taken their allotted actions and it is valid to end the current combat turn.

Example: result = state.isendturn

combatturn (Right, Number) Returns the current combat turn that is underway within the Tactical Console.

Example: result = state.combatturn

initchange (Right, Number) Returns non-zero if any actor has a user-modified initiative value.

Example: result = state.initchange

actorcount (Right, Number) Returns the total number of actors within the portfolio, including all minions.

Example: result = state.actorcount

reload[table] (Right, Number) Forces a re-load and re-sort of the table portal whose id is given by the table parameter. This target reference is only accessible from within a Trigger Script.

Example: result = state.reload[myportal]