Target References: Difference between revisions

From HLKitWiki
Jump to navigationJump to search
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 7: Line 7:
{{note}}If the current script context is invalid, any target reference used within that context. 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.
{{note}}If the current script context is invalid, any target reference used within that context. 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.


==Use of Identity==
==Target Reference Behaviors==


There are a number of target references across different contexts that make use of identity tags. For each of these target references, a tag group is specified, but no actual tag. This is because the script itself implicitly identifies the tag id based on the initial context of the script. The source of the identity tag is dictated by the pick or thing that begins as the initial context, with the unique id of that object being used as the identity tag id. The group in which to locate that identity tag is specified with the target reference. If the resulting identity tag does not exist, a run-time error is reported.
Every target reference is assigned a set of behaviors that dictate how it can be used within scripts. The different behaviors are described in the table below.


The use of identity target references has an important limitation. The identity source is based on the initial script context, and only things and picks possess identity tags. Consequently, identity target references can only be used from within scripts whose initial context is either a thing or a pick. Use from any other script results in a compilation error.
:{| class="infotable"
|class="leftnormal"|Right
|This target reference can be utilized on the right side of an assignment statement or with the "perform" statement. The value returned is specified within its description.
|-
|Left
|This target reference can be utilized on the left side of an assignment statement. It must be assigned a value in accordance with its description.
|-
|Number
|This target reference utilizes a numeric value, either returning a number or expecting to be assigned a number.
|-
|String
|This target reference utilizes a text string, either returning a string or expecting to be assigned a string.
|-
|}


==Topics==
==Topics==
Line 17: Line 30:
The topics below delineate the various target references that are available within each context.
The topics below delineate the various target references that are available within each context.


*{{fl|Container Target References}}
*[[Container Context#references|Container Target References]]
*{{fl|Hero Target References}}
*[[Hero Context#references|Hero Target References]]
*{{fl|Pick Target References}}
*[[Pick Context#references|Pick Target References]]
*{{fl|Thing Target References}}
*[[Thing Context#references|Thing Target References]]
*{{fl|Field Target References}}
*[[Field Context#references|Field Target References]]
*{{fl|Pool Target References}}
*[[Pool Context#references|Pool Target References]]
*{{fl|Scene Target References}}
*[[Scene Context#references|Scene Target References]]
*{{fl|Layout Target References}}
*[[Layout Context#references|Layout Target References]]
*{{fl|Template Target References}}
*[[Template Context#references|Template Target References]]
*{{fl|Portal Target References}}
*[[Portal Context#references|Portal Target References]]
*{{fl|Value Target References}}
*[[Value Context#references|Value Target References]]
*{{fl|Table Target References}}
*[[Table Context#references|Table Target References]]
*{{fl|State Target References}}
*[[State Context#references|State Target References]]

Latest revision as of 23:59, 7 December 2008

Context: HL Kit … Kit Reference 

Overview

When managing data via scripts, the first step is to establish the correct script context. Once you've identified the desired context, you'll then need to specify the appropriate target reference to retrieve or manipulate the specific information you want. Every script context has an assortment of target references that provide access to data pertaining to that context.

NOTE! If the current script context is invalid, any target reference used within that context. 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.

Target Reference Behaviors

Every target reference is assigned a set of behaviors that dictate how it can be used within scripts. The different behaviors are described in the table below.

Right This target reference can be utilized on the right side of an assignment statement or with the "perform" statement. The value returned is specified within its description.
Left This target reference can be utilized on the left side of an assignment statement. It must be assigned a value in accordance with its description.
Number This target reference utilizes a numeric value, either returning a number or expecting to be assigned a number.
String This target reference utilizes a text string, either returning a string or expecting to be assigned a string.

Topics

The topics below delineate the various target references that are available within each context.