Template Context

From HLKitWiki
Revision as of 16:34, 7 December 2008 by Rob (Talk | contribs)

Jump to: navigation, search

Context: HL KitKit Reference  … Multiple Sources

Jump to: Target References

The "template" context identifies a template within the current hierarchy. Templates can either be used within layouts or within tables, so the parent context of the template within the hierarchy can vary.

Context Transitions

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

parent Transitions to the layout context or table context corresponding to the visual element that contains the tmeplate.

Example: this.parent
NOTE! The "parent" transition can only be utilized a single time, so it is not possible to go upwards two or more levels within the hierarchy.

portal[id] Transitions to the portal context corresponding to the portal within the current template that possesses the id specified. If the portal does not exist within the template, the transition fails to resolve.

Example: this.portal[myportal]
NOTE! Only portals defined directly within the template can be accessed via this transition.

field[id] Transitions to the value context corresponding to the field within the current template that has the id specified. The fields for a template are dictated by the pick or thing that is associated with the template. If the given field does not exist for the pick/thing, the transition fails to resolve.

Example: this.field[myfield]
NOTE! Within templates, all fields are treated as read-only, which is controlled by transitioning to a distinct "value" context instead of "field" context.

container Transitions to the container context corresponding to the container to which the template applies, whether it be an actor or a gizmo.

Example: this.container
NOTE! After transitioning, access within the new container context will be read-only and limited in what information can be retrieved.
NOTE! This transition can only be used as the first transition when within a visual script.

hero Transitions to the hero context corresponding to the hero to which the template applies.

Example: this.hero
NOTE! After transitioning, access within the new hero context will be read-only and limited in what information can be retrieved.
NOTE! This transition can only be used as the first transition when within a visual script.