player.parent and object .article what do they mean?

While studying the Cloak of Darkness I come across words such as player.parent and object.article, what do they mean? Is there somewhere in the Quest help that tells me more about these words?


article is (by default) either "him", "her", ot "it".

It's useful for messages that say something like "You can't eat {object.article}." so that it makes the message look right. Similarly, you can use the attribute gender to get "he", "she", or "it". A lot of the built in messages use these attributes to make sure they are grammatically correct.


parent is one of the most used attributes. It tells you what the object's parent object is; one level up on the tree to the left of the editor.

The parent may be:

  • The player object (for objects in the inventory)
  • A container object (for objects in a container)
  • The room that the object is in

The utility function MoveObject (apple, bowl) is just shorthand for setting apple.parent = bowl

(it is worth noting that changing the parent of an object may cause it to appear in the appropriate pane in the sidebar if you've got it turned on, but will not display a message to let the player know that an object has appeared. If you're moving objects around, it's best to notify the player about that. But if you change the player object's parent, it will run the appropriate room exit/room enter scripts and display the description of the room you've moved them into. This is handled by the changedparrent script, which is run automatically whenever an object's parent attribute's value changes.)


Is there somewhere in the Quest help that tells me more about these words?

There's a list on the docs site - that lists a whole lot of attributes, but not all of them apply to all objects.

Unfortunately this documentation is somewhat lacking. There are a few things on the attributes list that aren't attributes (such as "Male", which is a type), and some of the descriptions don't make it clear which object they are an attribute of. For example, autodescription tells you what it is, but not that it is an attribute of the game element (so will always be referred to as game.autodescription).

Almost every input in the GUI has a corresponding attribute. Some of the names are obvious, some of them less so.


Thanks meangel.
I might experiment a bit to get use to these things.


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

Support

Forums