In the tutorial we covered Custom attributes. Now we’re going to cover types, which let you set up common sets of attributes which can be inherited by other objects.
Quest makes extensive use of types internally. There is a container type which gives all container objects standard functionality, such as being able to be opened, and so on. There is a switchable type which allows objects to be switched on and off.
You can see which types an object inherits by going to the Attributes tab and looking under Inherited Types. You can find the type definitions themselves by going Object Types in the tree (under the Advanced section) - click Filter and turn on “Show Library Elements” to show the types that Core.aslx defines.
Note that types themselves can also inherit other types.
When you’re looking at an Attributes tab, you can see the source for an attribute in the right-hand column. For example, click the “table” object in the tutorial game. You can see that it inherits a “transparent” attribute from the surface type. You can also see from the Inherited Types list that the “surface” type itself inherits container_base, which is the source of the “container” attribute.
Attributes that have a source of the object itself are shown in black; all attributes inherited from types (and types inherited from types) are shown in grey.
All objects (including rooms) inherit from the defaultobject type - there is no way to remove this. Similarly, all exits inherit from defaultexit. You can edit these types by selecting them in the tree and then clicking the Copy button to move the definition into your game. Be careful though, as any changes you make here will affect all objects, and so could potentially have far-reaching effects!
You can create your own types via the Add menu. You can then add attributes and inherited types to it, in just the same way as you would for an object. Once created, you can use a type in an object by going to the object’s Attributes tab, and adding the type from the drop-down list.
For more on creating your own types, see the Using Types page.