ScriptMacro Element (Data)

From HLKitWiki
Revision as of 02:01, 9 December 2008 by Rob (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Context: HL Kit … Kit Reference … Definition File Reference 

The "scriptmacro" Element

The "scriptmacro" element defines a macro for use within the scripting language to conveniently access object details. Each macro specifies a kind of shorthand notation for a lengthy block of script code that can be used in place of the full code and will be treated as if the full code were entered. Script macros are globally defined and may be used within any script. The complete list of attributes for a "scriptmacro" element is below.

name Text – Name to be used for the macro. May consist solely of alphanumeric characters.
result Text – The resulting text to be generated when the macro is used. Each parameter is spliced into the result appropriately.
param1 (Optional) Text – Name used for the first parameter provided to macro. Used for splicing the value into the "result" given above.
param2 (Optional) Text – Name used for the second parameter provided to macro. Used for splicing the value into the "result" given above.
param3 (Optional) Text – Name used for the third parameter provided to macro. Used for splicing the value into the "result" given above.
param4 (Optional) Text – Name used for the fourth parameter provided to macro. Used for splicing the value into the "result" given above.
param5 (Optional) Text – Name used for the fifth parameter provided to macro. Used for splicing the value into the "result" given above.

Example

The following example demonstrates what a "scriptmacro" element might look like. All default values are assumed for omitted optional attributes.

<scriptmacro
  name="trait"
  param1="trait"
  result="hero.child[#trait].field[trtFinal].value">
  </scriptmacro>