Inheriting behaviour as well as attributes with types

The Pixie
This may not be feasible, but it would be nice if an object's behaviour could be inherited from a type.

What I would envisage is having a food type, and all items that inherit can be eaten because that functionality was set up for the type. You could have a person type, with a load of default responses for ask/tell, and all the actual people in the name override selected responses as appropriate.

Pertex
Do you mean this?

http://quest5.net/wiki/Types

Alex
Yes, types can handle all of this. You may want to set up your default ask/tell stuff for one object in the editor, then go into the attributes (or the code view) and copy them across to your new type.

The Pixie
Oh, okay. I looked at creating a type, and it only seemed to be set up for attributes (and I read the web page Pertex linked to, and that seemed to be about attributes only as well).

Alex
The thing to remember, which I probably haven't made clear in the documentation yet, is that everything is an attribute. You could even edit your entire game via the Attributes tab if you wanted.

The Pixie
I am having problems getting this to work. I am creating a detective story, so the player will be asking X about Y a lot. What I want is some default responses, and types appears to be the way to go.

So I have a character bert:
<object name="bert">
<inherit name="male" />
<inherit name="editor_object" />
<inherit name="person_type" />
<alias>Bert</alias>
... etc

And the person_type is set up like this:

<type name="person_type">
<ask type="scriptdictionary">
<item key="maisy">
msg ("\"You know about Maisy DeValle,\" Vic asked casually.")
msg ("Only what I heard on the news.\"")
</item>
</ask>
</type>

In the editor, person_type is listed as being inherited from, and I can ask Bert about other things in player mode, but not about Maisy. Am I doing something wrong, or is something not working?

Alex
If you're defining an "ask" attribute for Bert, that will override what you've specified in your type.

In the Editor, if you don't have an "ask" attribute for Bert, you will see the inherited value. As soon as you edit, that value from the type will be copied across. So any subsequent edits you make to the type won't be reflected in Bert's version of the "ask" attribute.

This means you should set up your type first, then edit any objects that inherit from the type.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums