Description Script

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

Context: HL Kit … Kit Reference … Script Types 

Technical Details

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

The Description script utilizes the following special symbols:

text (String) Entry: Contains the default description for the object, which consists of the basic description text assigned to the object and any failed pre-requisites.

Exit: Contains the text to be displayed to the user as the description. The final text may contain encoding.

ispick (Number) Entry: Indicates whether the text is being rendered for a thing (zero) or a pick (non-zero), allowing different handling to be performed for the two separate cases.

Exit: Ignored.

Description

Whenever the user is presented with a selection list to choose from, the list of available items is shown on the left and a description area is provided on the right. The description area contains all the details for the currently highlighted item. By default, this consists of the basic description text assigned to the item and any pre-requisites failed by the item. However, the author can present more detailed information via the use of a Description script. This allows the author to factor in context-driven material, such as pertinent field values and adjusted values due to the influence of previous selections.

NOTE!  The Description script is read-only. Within this script, virtually all aspects of the structural hierarchy can be accessed, but nothing can be changed.

Example

When displaying weapons, it's useful to show the damage and range. This can be easily appended to the default text for display.

@text &= "\n"
@text &= "Damage: " & field[wpDamage}.text & "\n"
@text &= "Range: " & field[wpRange].text & "\n"