Trigger Script

From HLKitWiki
Revision as of 03:38, 14 December 2008 by Rob (Talk | contribs) (New page: {{context|Kit Reference|Script Types}} ==Technical Details== :{| class="scripttable" |class="leftnormal"|Initial Context: |Pick |- |Alternate Context: |None |- |Fields F...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Context: HL KitKit Reference … Script Types 

Technical Details

Initial Context: Pick
Alternate Context: None
Fields Finalized? Yes

The Trigger script utilizes the following special symbols:

-None- There are no special symbols for a Trigger script.


The Trigger script is used in conjunction with the "trigger" action portal, which makes it possible for the user to invoke a one-time operation. The primary use of the Trigger script is for either resetting values (e.g. trackers on the In-Play tab) or applying adjustments to usage pools (e.g. damage tracking). In the latter case, there will typically be an edit portal where the user can enter a value. When the Trigger script is invoked, the value is used when applying the adjustment to the usage pool, and then the field is reset.

When invoked, a Trigger script starts with the pick as its initial context. There is generally no reason to navigate outside the context of the pick, but it is technically allowed. The primary focus will be on the pick and its fields.


We'll use the Trigger script associated with the button to reset all damage on the In-Play tab as an example. In this script, the usage pools for damage tracking are reset.

~if there is no history to undo, notify the user
if (hero.usagepool[DmgNet].count = 0) then
  notify "Undo history is empty"

~empty out both usage pools
perform hero.usagepool[DmgNet].empty
perform hero.usagepool[DmgAdjust].empty