ScriptMacro Element (Data): Difference between revisions
From HLKitWiki
Jump to navigationJump to search
New page: {{context|Kit Reference|Definition File Reference}} ==The "scriptmacro" Element== Each phase within the evaluation cycle must be individually specified and th... |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
==The "scriptmacro" Element== | ==The "scriptmacro" Element== | ||
The "scriptmacro" element defines a [[Employing Script Macros|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. | |||
:{| class="infotable" | :{| class="infotable" | ||
|class="leftnormal"| | |class="leftnormal"|name | ||
| | |Text – Name to be used for the macro. May consist solely of alphanumeric characters. | ||
|- | |- | ||
| | |result | ||
|Text – | |Text – The resulting text to be generated when the macro is used. Each parameter is spliced into the result appropriately. | ||
|- | |- | ||
| | |param1 | ||
|(Optional) Text – | |(Optional) Text – Name used for the first parameter provided to macro. Used for splicing the value into the "result" given above. | ||
|- | |- | ||
| | |param2 | ||
|(Optional) | |(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. | |||
|- | |- | ||
|} | |} | ||
Line 23: | Line 31: | ||
==Example== | ==Example== | ||
The following example demonstrates what a " | The following example demonstrates what a "scriptmacro" element might look like. All default values are assumed for omitted optional attributes. | ||
<pre> | <pre> | ||
< | <scriptmacro | ||
name="trait" | |||
param1="trait" | |||
result="hero.child[#trait].field[trtFinal].value"> | |||
</ | </scriptmacro> | ||
</pre> | </pre> |
Latest revision as of 02:01, 9 December 2008
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>