Using Templates
<template> tag
Specifies text that is printed, for example:
<template name="UnresolvedObject">I can't see that.</template>
Using templates
You can use a template anywhere by surrounding the name with square brackets. The text will be replaced by the contents of the template.
For example, in Core.aslx in the definition for the default type we have:
<displayverbs type="list">[LookAt];[Take];[SpeakTo]</displayverbs>
Which means that the default displayverbs is specified by the contents of the three templates named LookAt, Take and SpeakTo. So when the ASL file is loaded, this effectively becomes:
<displayverbs type="list">Look at;Take;Speak to</displayverbs>
Dynamic Templates
Templates are used for all the standard output from Core.aslx. This includes the standard error messages, such as "I don’t understand your command".
A dynamic template is a template that can call functions and read attributes. This is useful for dynamic responses such as when the player tries to take an untakeable object. Usually, a response of "You can’t take it" is sufficient, but what if the object is a female character? Dynamic templates to the rescue – they are essentially functions that return a string value, for example:
<dynamictemplate name="TakeUnsuccessful"> "You can't take " + object.article + "." </dynamictemplate>
A female character should have their "article" attribute set to "her", so this will print "You can’t take her."
To print this from a script, call the DynamicTemplate function, which takes two parameters:
msg (DynamicTemplate("TakeUnsuccessful", object))
See also: Random default answers