| 1 |
& ATTRIBUTE FLAGS |
|---|
| 2 |
Attribute flags are set on an object's attributes using @set, or applied |
|---|
| 3 |
to attributes globally using @attrib. Their names (and, when applicable, |
|---|
| 4 |
the character used in examine as shorthand for the flag) include: |
|---|
| 5 |
|
|---|
| 6 |
no_command ($) Attribute will not be checked for '$' commands and |
|---|
| 7 |
'^' listen patterns. |
|---|
| 8 |
visual (v) Attribute can be seen by anyone via get(), eval(), |
|---|
| 9 |
ufun(), zfun(), and similar functions. |
|---|
| 10 |
no_inherit (i) Attribute will not be inherited by the children of |
|---|
| 11 |
this object. |
|---|
| 12 |
no_clone (c) Attribute will not be copied if the object is @clone'd. |
|---|
| 13 |
regexp (R) Match $-commands and ^-listens using regular expressions. |
|---|
| 14 |
See 'help regexps'. |
|---|
| 15 |
case (C) Match $-commands and ^-listens case sensitively. |
|---|
| 16 |
safe (S) Attribute may not be modified, without unsetting this flag. |
|---|
| 17 |
mortal_dark (m) Attribute cannot be seen by mortals. This flag can only |
|---|
| 18 |
be set by royalty and wizards. "hidden" is a synonym. |
|---|
| 19 |
|
|---|
| 20 |
Continued in 'help attribute flags2' |
|---|
| 21 |
& ATTRIBUTE FLAGS2 |
|---|
| 22 |
noname (N) Attribute won't show name in @o-* messages. |
|---|
| 23 |
nospace (s) Attribute won't append a space in @o-* messages. |
|---|
| 24 |
wizard (w) Attribute can only be set by wizards. |
|---|
| 25 |
This flag can only be set by royalty and wizards. |
|---|
| 26 |
veiled (V) Attribute value will not be shown on default examine, |
|---|
| 27 |
but is still otherwise accessible (for spammy attribs). |
|---|
| 28 |
debug (b) Show debug output when this attribute is evaluated. |
|---|
| 29 |
nearby (n) Even if this attribute is visual, it can only be |
|---|
| 30 |
retrieved if you're co-located with the object. |
|---|
| 31 |
public (p) This attribute can be evaluated by any object, even |
|---|
| 32 |
if safer_ufun is in use. DANGEROUS! AVOID! |
|---|
| 33 |
aahear (A) ^-listens on this attribute match like @aahear |
|---|
| 34 |
amhear (M) ^-listens on this attribute match like @amhear |
|---|
| 35 |
|
|---|
| 36 |
Continued in 'help attribute flags3' |
|---|
| 37 |
& ATTRIBUTE FLAGS3 |
|---|
| 38 |
prefixmatch When a user attempts to set an attribute using @<attrib>, |
|---|
| 39 |
this attribute will be matched down to its unique |
|---|
| 40 |
prefixes. This flag is primarily used internally. |
|---|
| 41 |
` This attribute is a branch. See: help ATTRIBUTE TREES |
|---|
| 42 |
& ATTRIBUTE TREES |
|---|
| 43 |
& ATTR TREES |
|---|
| 44 |
& ATTRIB TREES |
|---|
| 45 |
& ` |
|---|
| 46 |
Attributes can be arranged in a hierarchical tree; these are called |
|---|
| 47 |
"attribute trees", and a conceptually similar to the way that |
|---|
| 48 |
files and directories/folders are organized on computer filesystems. |
|---|
| 49 |
Attribute trees can be used to reduce spam when examining and to |
|---|
| 50 |
provide organized control over permissions for related attributes. |
|---|
| 51 |
|
|---|
| 52 |
Attribute trees use the backtick (`) character to separate their |
|---|
| 53 |
components (much as filesystems use / or \). For example, the |
|---|
| 54 |
following attribute name would be a couple levels down in its tree: |
|---|
| 55 |
|
|---|
| 56 |
CHAR`SKILLS`PHYSICAL |
|---|
| 57 |
|
|---|
| 58 |
Attribute names may not start or end with the backtick, and may not |
|---|
| 59 |
contain two backticks in a row. |
|---|
| 60 |
|
|---|
| 61 |
All attributes are either branch attributes or leaf attributes. |
|---|
| 62 |
A branch attribute is an attribute that has other branches or leaves |
|---|
| 63 |
beneath it; a leaf attribute is one that does not. Any attribute may |
|---|
| 64 |
act as a branch. If you try to create an unsupported leaf, branch |
|---|
| 65 |
attributes will be created as needed to support it. |
|---|
| 66 |
|
|---|
| 67 |
See 'help attribute trees2' for more information and examples. |
|---|
| 68 |
|
|---|
| 69 |
& ATTRIBUTE TREES2 |
|---|
| 70 |
& ATTR TREES2 |
|---|
| 71 |
& ATTRIB TREES2 |
|---|
| 72 |
& `2 |
|---|
| 73 |
Attribute trees provide two immediate benefits. First, they reduce |
|---|
| 74 |
spam when examining objects. The usual * and ? wildcards for attributes |
|---|
| 75 |
do not match the ` character; the new ** wildcard does. Some |
|---|
| 76 |
examples of using examine: |
|---|
| 77 |
examine obj displays top-level attributes (plus object header) |
|---|
| 78 |
examine obj/* displays top-level attributes |
|---|
| 79 |
examine obj/BRANCH` displays only attributes immediately under BRANCH |
|---|
| 80 |
examine obj/BRANCH`* displays only attributes immediately under BRANCH |
|---|
| 81 |
examine obj/BRANCH`** displays entire tree under BRANCH |
|---|
| 82 |
examine obj/** displays all attributes of object |
|---|
| 83 |
|
|---|
| 84 |
The same principles apply to lattr(). @decompile obj is a special case, |
|---|
| 85 |
and displays all attributes. |
|---|
| 86 |
|
|---|
| 87 |
Branch attributes will be displayed with a ` in the attribute flags |
|---|
| 88 |
on examine. |
|---|
| 89 |
|
|---|
| 90 |
See 'help attribute trees3' for more information and examples. |
|---|
| 91 |
|
|---|
| 92 |
& ATTRIBUTE TREES3 |
|---|
| 93 |
& ATTR TREES3 |
|---|
| 94 |
& ATTRIB TREES3 |
|---|
| 95 |
& `3 |
|---|
| 96 |
The second benefit of attributes trees is convenient access control. |
|---|
| 97 |
Attribute flags that restrict attribute access or execution |
|---|
| 98 |
(no_inherit, no_command, mortal_dark, wizard) propagate down |
|---|
| 99 |
attribute trees, so if a branch is set mortal_dark, mortals can |
|---|
| 100 |
not read any of its leaves or subbranches either. |
|---|
| 101 |
|
|---|
| 102 |
Attribute flags that grant access (e.g. visual) do NOT propagate down |
|---|
| 103 |
trees. |
|---|
| 104 |
|
|---|
| 105 |
These properties make attribute trees ideal for data attributes: |
|---|
| 106 |
&DATA bank = Data for each depositor is stored here, by dbref |
|---|
| 107 |
@set bank/DATA = no_command |
|---|
| 108 |
&DATA`#30 bank = $2000 savings:$1000 loan @ 5% |
|---|
| 109 |
... |
|---|
| 110 |
|
|---|
| 111 |
They're also handy for things like character attributes: |
|---|
| 112 |
@attribute/access CHAR = wizard mortal_dark no_clone no_inherit |
|---|
| 113 |
&CHAR #30 = Character data |
|---|
| 114 |
&CHAR`SKILLS #30 = coding:3 documentation:1 obfuscation:5 |
|---|
| 115 |
... |
|---|
| 116 |
|
|---|
| 117 |
See 'help attribute trees4' for information about @parent and attribute trees. |
|---|
| 118 |
|
|---|
| 119 |
& ATTRIBUTE TREES4 |
|---|
| 120 |
& ATTR TREES4 |
|---|
| 121 |
& ATTRIB TREES4 |
|---|
| 122 |
& `4 |
|---|
| 123 |
Attribute trees interact with @parent in several ways. |
|---|
| 124 |
|
|---|
| 125 |
As usual, children inherit attributes from their parent unless the |
|---|
| 126 |
child has its own overriding attribute. However, children that wish |
|---|
| 127 |
to override a leaf attribute must also have their own (overriding) |
|---|
| 128 |
copy of all branches leading to that leaf. This means that when you do: |
|---|
| 129 |
|
|---|
| 130 |
&BRANCH parent = a branch |
|---|
| 131 |
&BRANCH`LEAF parent = a leaf |
|---|
| 132 |
&BRANCH`LEAF child = a new leaf |
|---|
| 133 |
|
|---|
| 134 |
In this case, a new BRANCH attribute will be created on the child, |
|---|
| 135 |
so '-[get(child/BRANCH)]-' will return '--'. This may not be what |
|---|
| 136 |
you actually want. |
|---|
| 137 |
|
|---|
| 138 |
If a branch on the parent is set no_inherit, it will not be inherited, |
|---|
| 139 |
regardless of any other flags that may be present. If a branch is |
|---|
| 140 |
inherited, the child object can not loosen any access restrictions to |
|---|
| 141 |
inherited attributes that are set by the parent (although it may loosen |
|---|
| 142 |
access restrictions to its own attributes on the same branch). The child |
|---|
| 143 |
object may impose stricter restrictions, however, and these may prevent |
|---|
| 144 |
access to inherited parent data. |
|---|
| 145 |
& NONAME |
|---|
| 146 |
& NOSPACE |
|---|
| 147 |
@o-* Attributes set NONAME will not prepend the enactor's name to their |
|---|
| 148 |
message. Similarily, attributes set NOSPACE will not append a space |
|---|
| 149 |
to the enactor's name in their message. |
|---|
| 150 |
|
|---|
| 151 |
> @create anvil |
|---|
| 152 |
> @lock anvil=#false |
|---|
| 153 |
> @ofailure anvil=s strength is not enough to pick up the anvil. |
|---|
| 154 |
> @set anvil/ofailure=nospace |
|---|
| 155 |
> get anvil |
|---|
| 156 |
(spectators see:) |
|---|
| 157 |
Walkers strength is not enough to pick up the anvil. |
|---|
| 158 |
|
|---|
| 159 |
> @ofailure anvil=The anvil is too heavy for %N to pick up. |
|---|
| 160 |
> @set anvil/ofailure=noname |
|---|
| 161 |
> get anvil |
|---|
| 162 |
(spectators see:) |
|---|
| 163 |
The anvil is too heavy for Walker to pick up. |
|---|