Context Transitions: Difference between revisions
No edit summary |
|||
Line 206: | Line 206: | ||
==Special Contexts== | ==Special Contexts== | ||
Within some scripts, special contexts are supported. These special contexts behave the same way within any script that uses them. However, what they correspond to may be different within each script. The specific scripts where special contexts can be used will explicitly cite the availability of the context in their description. Alternately, some special contexts can be established within a script via certain language mechanisms (e.g. "eachpick"). The behavior of these contexts is outlined below. | |||
:{| class="infotable" | :{| class="infotable" | ||
Line 219: | Line 219: | ||
|- | |- | ||
|} | |} | ||
{{important}}All special contexts must be specified at the '''start''' of an identifier. If not, they will not be acknowledged by the compiler. For example, if the "altpick" special context is supported by a script, the reference "altpick.field[livename].text" would work perfectly. However, the reference "this.altpick.field[livename].text" would fail to compile, since "altpick." is not given as the initial context for the identifier. |
Revision as of 23:49, 4 December 2008
Context: HL Kit … Kit Reference
Overview
Every script begins with an initial context that is dictated by the particular script. Quite often, though, you'll want to access information somewhere else within the data hierarchy. That's when context transitions come into play. A context transition allows you to move through the hierarchy, progressing to objects either above or below the current context. These transitions can be chained, allowing you to move through a sequence of contexts to reach the desired destination.
From within a given context, you are only able to transition to a specific set of other contexts. The sections below identify what the valid transitions are for each context.
NOTE! If transitions are utilized that result in an invalid (i.e. non-existent) context, any subsequent target reference will be invalid. If this occurs during run-time, the operation will be ignored and the target identifier will return zero. A suitable error will generally be displayed, but not always. An example of an invalid context is when a pick attempts to transition to a field that does not exist within that pick.
Using "this"
Container Context
From within a "container" context, you can utilize the following set of valid context transitions:
Hero Context
From within a "hero" context, you can utilize the following set of valid context transitions:
Pick Context
From within a "pick" context, you can utilize the following set of valid context transitions:
Thing Context
From within a "thing" context, you can utilize the following set of valid context transitions:
Field Context
From within a "field" context, you can utilize the following set of valid context transitions:
Pool Context
From within a "pool" context, you can utilize the following set of valid context transitions:
Scene Context
From within a "scene" context, you can utilize the following set of valid context transitions:
Layout Context
From within a "layout" context, you can utilize the following set of valid context transitions:
Template Context
From within a "template" context, you can utilize the following set of valid context transitions:
Portal Context
From within a "portal" context, you can utilize the following set of valid context transitions:
Value Context
From within a "value" context, you can utilize the following set of valid context transitions:
State Context
From within a "state" context, you can utilize the following set of valid context transitions:
Special Contexts
Within some scripts, special contexts are supported. These special contexts behave the same way within any script that uses them. However, what they correspond to may be different within each script. The specific scripts where special contexts can be used will explicitly cite the availability of the context in their description. Alternately, some special contexts can be established within a script via certain language mechanisms (e.g. "eachpick"). The behavior of these contexts is outlined below.
IMPORTANT! All special contexts must be specified at the start of an identifier. If not, they will not be acknowledged by the compiler. For example, if the "altpick" special context is supported by a script, the reference "altpick.field[livename].text" would work perfectly. However, the reference "this.altpick.field[livename].text" would fail to compile, since "altpick." is not given as the initial context for the identifier.