Properties:
A property is a named location on a database object that holds
information. Both the server and user-created programs reference
properties to obtain the data they need in order to carry out specific
operations. For example, when someone looks at you, the server
references your description property ( _/de ), retrieves
the information stored there (your desc), and displays it to the person
who's looking at you. Properties are often called just `props'.
Props are organized into property directories (often called
`propdirs'). The structure and syntax of property directories are very
much like those of file directories in the UNIX or
DOS operating systems, with props being analogous to files
and propdirs being analogous to directories. A directory can contain
props or additional directories; names of props and directories are
separated by a slash; props and directories are organized in a
hiearchical `tree' structure such that each prop has a unique path name.
So, the desc prop mentioned above, _/de , is actually the
de property in the _ underscore directory.
You can view the props on any object you control by examining it,
syntax ex <object> = <path> . Typing ex me
= / would show the `first level' or `root directory' of props and
directories stored on your character. Typing ex me = sex
would show your sex property. Typing ex me = _page/ would
show properties stored in the propdir created and modified when you use
the page command. Directories will be prefaced by
`dir' and will end with a slash. Properties will be prefaced by
something different (usually str for `string'), and will end with
the value stored in the prop.
Like flags, properties are set and removed with the @set
command, though the syntax is slightly different. The syntax for setting
a prop is @set <object> = <[path/]property>:
<value> . For removing a prop, it's @set
<object> = <[path/]property>: (that is, a property
name followed by just a colon). To clear a directory, it's @set
<object> = <propdir>/: You can remove all the
properties you have set on an object by typing @set <object>
= :clear .
====================================
>@set me = obstreperous:yes
Property set.
>@set me = obstreperous:
Property removed.
>@set me = personality_traits/obstreperous:yes
Property set.
>@set me = personality_traits/lascivious:yes
Property set
>@set me = personality_traits/:
Property removed.
>@set me = :clear
All user owned properties removed. (* oops *)
====================================
It is common practice to separate words in a property name with
underscores (@set me = my_favorite_color:blue ), but spaces
can be used in property names (@set me = my favorite
color:blue ). However, spaces at the beginning and end of property
names are removed when the prop is set. (Spaces at the beginning or end
of a property value are not stripped: you can store a string
beginning or ending with spaces, or even a string consisting of only
spaces.)
The number, names, and content of properties are not pre-defined as
they are in the case of flags. You can't `make up' a new kind of flag
and set it on your character (@set me = G or @set me
= 9 , say), but you can create and set any property you like and
store any information there, as long as the syntax is correct and the
amount of information stored doesn't exceed certain limits . If you
wanted to do @set me = number_of_pickles_in_my_jar:32 , you
could, though the information might not be especially useful. (There are
some restrictions on what properties you can set, discussed in Section 2.1.1)
While you can set virtually any property, the server and user-created
commands will expect specific information to be stored in specific,
predefined properties. The server will always reference the
_/de prop when obtaining a desc; the hand
command will always check your _hand_ok prop. So, using a
program or configuring an object is often a matter of determining what
props are referenced (by reading #help or program documentation, or by
asking players or staff) and setting them appropriately. Important and
frequently used properties are stored in the correct location by server
commands: @desc, @success, @osuccess, @drop, @odrop, @fail,
@ofail , and various @lock commands all store
information in the _/ directory. (Properties in the
_/ directory and their values are often called `messages'
and `locks'. See Sections 2.1.2 and 2.3.)
====================================
>@create Feep
Feep created with number #1237
>@desc feep = A cute little feep.
Description set.
>@succ feep = You pick up the feep. It warbles contentedly.
Message set.
>@osucc feep = picks up the feep. It warbles contentedly.
Message set.
>@fail feep = You try to pick up the feep, but it scuttles away whimpering!
Message set.
>@ofail feep = tries to pick up the feep, but it scuttles away whimpering!
Message set.
>@drop feep = You set the feep down gently. It nuzzles your ankle.
Message set.
>@odrop feep = sets the feep down gently. It nuzzles %p ankle.
Message set.
>@lock feep = me
Locked.
>@chlock feep = me
Chown lock set.
> ex feep = _/
lok /_/chlk:Mistral(#100PWX)
str /_/de:A cute little feep.
str /_/dr:You set the feep down gently. It nuzzles your ankle.
str /_/fl:You try to pick up the feep, but it scuttles away whimpering!
lok /_/lok:Mistral(#100PWX)
str /_/odr:sets the feep down gently. It nuzzles %p ankle.
str /_/ofl:tries to pick up the feep, but it scuttles away whimpering!
str /_/osc:picks up the feep. It warbles contentedly.
str /_/sc:You pick up the feep. It warbles contentedly.
====================================
The properties in the _/ directory trigger events or
messages when the object is used in a certain way. For example, the
@success message is displayed to a player who Successfully uses
the object. If the object is a thing, `successful use' means picking it up.
For a room, `success' means looking at the room. For an exit, it means passing
through the exit or using the exit as a command. The @osuccess
message uses the same definitions of `success', but in this case the message
is shown to Other players present, rather than the triggering player.
@Fail works similarly to @success, but in
this case the message is shown when a player fails to use the
object successfully, usually because it is locked against him (locks are
discussed in Section 2.3), and @ofail
has a similar relationship to @osuccess.
On a thing, a @drop message is shown to a player who
drops the object; the @odrop message is shown to other
players present when the object is dropped. When a @drop
message is set on an exit, the message is shown to the player when he
arrives in the destination room. The @odrop message is
shown to other players in the destination room.
prev |
toc |
top |
next
|