Object Types

Object Types allow you to specify a number of properties and actions which can be easily included in an object by including the relevant type. For example, you might want to create an "edible" type that includes an action for eating the object, plus default values for properties such as hunger satisfaction. You could then make any object edible by going to its "Properties and Actions" window and adding "edible" to the Inherited Types list.

When you add or edit an Object Type, or go to the "Properties and Actions" window for any room or object, the same window comes up. It has tabs for Properties, Actions and Types:

Properties: A property can be either boolean - that is, true or false - or it can take a value. This means that "Not" is only available if your property doesn't have a value, and your property can only take a value if "Not" is not ticked - a property of "not value = 15" doesn't make much sense.

Click "Add" to add a property and type in the property name in the "Name" box. You can then turn the property off by ticking "Not" (you might do this if, for example, an inherited type will add a boolean property that you don't want), or enter a value, if you wish.

Actions: Actions are script commands that you associate with an object, room or object type. In our "edible" example above we would add an action called "eat" to our object type. We might then add a Custom Command which would accept "eat #@object#", and then its script would run #object#'s "eat" action. This would then allow any edible object to be eaten - and if we needed a particular object to do something special when eaten, we could simply override our default "eat" action from our "edible" type by adding a different "eat" action to our particular object.

Types: Specify here any types you want to inherit. We've discussed inheriting types in objects, but you can also inherit types into other types. For example, we might make a "poison" type, which would inherit everything from "edible" but provide its own "eat" action which would kill the player or decrease the player's health.

 

< Back