… | |
… | |
7 | |
7 | |
8 | This documentation is in a sketchy state. It's mostly |
8 | This documentation is in a sketchy state. It's mostly |
9 | used to collect notes about the internal behaviour of the |
9 | used to collect notes about the internal behaviour of the |
10 | objects. |
10 | objects. |
11 | |
11 | |
|
|
12 | =head2 About the notation and terms |
|
|
13 | |
|
|
14 | The term 'archetype' stands for a collection of fields. |
|
|
15 | The term 'object' stands for an archetype instance. |
|
|
16 | The term 'field' is used for an object fields and archetype fields. |
|
|
17 | |
|
|
18 | Field names will be displayed like I<this>. |
|
|
19 | |
12 | =head2 About archetypes and objects |
20 | =head2 About archetypes and objects |
13 | |
21 | |
14 | Field denotes an attribute of an archetype. |
22 | Archetypes are 'templates' of objects. If an object is derived |
|
|
23 | from an archetype the object fields will be set to the corresponding |
|
|
24 | fields in the archetype. |
|
|
25 | |
|
|
26 | When a map is instanciated (loaded), the 'object' description on the |
|
|
27 | map are considered patches of the archetype. |
|
|
28 | |
|
|
29 | This document does explain the behaviour of the objects and the meaning of |
|
|
30 | their fields in the server engine, which are derived from archetypes. |
|
|
31 | |
15 | This is an example of an archetype: |
32 | This is an example of an archetype: |
16 | |
33 | |
17 | Object button_trigger |
34 | Object button_trigger |
18 | name button |
35 | name button |
19 | type 30 |
36 | type 30 |
… | |
… | |
30 | editable 48 |
47 | editable 48 |
31 | visibility 50 |
48 | visibility 50 |
32 | weight 1 |
49 | weight 1 |
33 | end |
50 | end |
34 | |
51 | |
35 | This archetype has the name 'button_trigger' and the objects that |
52 | The first B<field> is I<name>: 'button_trigger', which basically means that |
36 | inherit from this archetype have the name 'button'. |
53 | instances (objects) that are created/derived from this archetype have the |
|
|
54 | name 'button' (which means that the field I<name> of the object will be set |
|
|
55 | to the same value as the archetypes field I<name>). |
37 | |
56 | |
38 | The next field 'type' decides the main behaviour of this archetype. |
57 | The next field I<type> decides the behaviour of objects derived from this archetype. |
39 | For a comprehensive list of types see include/define.h. For this case |
58 | For a comprehensive list of types see include/define.h. For this case |
40 | you might find a line like: |
59 | you might find a line like: |
41 | |
60 | |
42 | #define TRIGGER_BUTTON 30 |
61 | #define TRIGGER_BUTTON 30 |
43 | |
62 | |
44 | The server internally works with objects that 'inherit' attributes from |
63 | The behaviour of objects is further determined by B<Flags>, like FLAG_APPLIED. |
45 | an archetype. They have a similar set of attributes. |
64 | For more information on this look in the Flags subsection in the next section |
46 | |
65 | |
47 | The following documentation will also document the meaning of code internal |
66 | The following documentation will also document the meaning of internal used |
48 | attributes of objects. These attributes are marked as '(internal)' and can't |
67 | fields of objects. These fields are marked as (internal) and can't |
49 | or shouldn't be set by an archetype. If the internal names differs the |
68 | or shouldn't be set by an archetype. |
50 | external name (for the archetypes) for the attribute is written behind it. |
|
|
51 | |
69 | |
52 | =head2 Description of generic archetype and object attributes |
70 | =head2 Description of (mostly) generic object fields |
53 | |
71 | |
54 | These are the fields that most of the objects have and/or their |
72 | These are the fields that most of the objects have and/or their |
55 | default behaviour. |
73 | default behaviour. |
56 | |
74 | |
57 | =over 4 |
75 | =over 4 |
… | |
… | |
134 | =item is_used_up (0|1) |
152 | =item is_used_up (0|1) |
135 | |
153 | |
136 | Sets the flag FLAG_IS_USED_UP. |
154 | Sets the flag FLAG_IS_USED_UP. |
137 | See Flags section below. |
155 | See Flags section below. |
138 | |
156 | |
|
|
157 | =item changing (0|1) |
|
|
158 | |
|
|
159 | Sets the flag FLAG_CHANGING. |
|
|
160 | See Flags section below. |
|
|
161 | |
139 | =item auto_apply (0|1) |
162 | =item auto_apply (0|1) |
140 | |
163 | |
141 | Sets the flag FLAG_AUTO_APPLY. |
164 | Sets the flag FLAG_AUTO_APPLY. |
142 | See Flags section below. |
165 | See Flags section below. |
143 | |
166 | |
… | |
… | |
172 | See Flags section below. |
195 | See Flags section below. |
173 | |
196 | |
174 | =item editable (more than deprecated) |
197 | =item editable (more than deprecated) |
175 | |
198 | |
176 | This field had a special meaning for crossedit, which used parts |
199 | This field had a special meaning for crossedit, which used parts |
177 | of the server code for editing. Wherever you see this attribute being |
200 | of the server code for editing. Wherever you see this field being |
178 | set in an archetype ignore it and/or remove it. No code interprets this |
201 | set in an archetype ignore it and/or remove it. No code interprets this |
179 | field anymore. |
202 | field anymore. |
180 | |
203 | |
181 | =back |
204 | =back |
182 | |
205 | |
… | |
… | |
209 | this object is removed or not, see the Force type below for the meaning |
232 | this object is removed or not, see the Force type below for the meaning |
210 | of the duration field in this context. |
233 | of the duration field in this context. |
211 | |
234 | |
212 | If FLAG_APPLIED is not set the object is destroyed. |
235 | If FLAG_APPLIED is not set the object is destroyed. |
213 | |
236 | |
|
|
237 | =item FLAG_CHANGING |
|
|
238 | |
|
|
239 | If the 'state' field of the object is 0 the object will be processed periodically. |
|
|
240 | Otherwise it won't "change"; |
|
|
241 | |
214 | =item FLAG_IS_A_TEMPLATE (internal use) |
242 | =item FLAG_IS_A_TEMPLATE (internal use) |
215 | |
243 | |
216 | This flag is set on the inventory of generators like CREATORs and CONVERTERs, |
244 | This flag is set on the inventory of generators like CREATORs and CONVERTERs, |
217 | or other objects that have the flags FLAG_GENERATOR and FLAG_CONTENT_ON_GEN set. |
245 | or other objects that have the flags FLAG_GENERATOR and FLAG_CONTENT_ON_GEN set. |
218 | |
246 | |
… | |
… | |
270 | This flag indicates whether something reflects spells, like spell reflecting |
298 | This flag indicates whether something reflects spells, like spell reflecting |
271 | amuletts. |
299 | amuletts. |
272 | |
300 | |
273 | =back |
301 | =back |
274 | |
302 | |
275 | =head2 Description of type specific attributes |
303 | =head2 Description of type specific fields and behaviour |
276 | |
304 | |
277 | The beginning of the headers of the following subsection |
305 | The beginning of the headers of the following subsection |
278 | are the server internal names for the objects types, see include/define.h. |
306 | are the server internal names for the objects types, see include/define.h. |
279 | |
307 | |
280 | =head3 TRANSPORT - type 2 - Player transports |
308 | =head3 TRANSPORT - type 2 - Player transports |
281 | |
309 | |
282 | This type is implemented by the transport extension and has currently no special |
310 | This type is implemented by the transport extension and has currently no special |
283 | attributes that affect it. |
311 | fields that affect it. |
284 | |
312 | |
285 | =head3 ROD - type 3 - Rods that fire spells |
313 | =head3 ROD - type 3 - Rods that fire spells |
286 | |
314 | |
287 | Rods contain spells and can be fired by a player. |
315 | Rods contain spells and can be fired by a player. |
288 | |
316 | |
289 | =over 4 |
317 | =over 4 |
290 | |
318 | |
291 | =item level <number> |
319 | =item level <number> |
292 | |
320 | |
293 | This attribute is used for calculating the spell level that can be fired |
321 | This field is used for calculating the spell level that can be fired |
294 | with this rod, it's also the maximum level of the spell that can be fired. |
322 | with this rod, it's also the maximum level of the spell that can be fired. |
295 | The level of the spell that is being fired depends mostly on |
323 | The level of the spell that is being fired depends mostly on |
296 | the 'use magic item' skill level of the player and 1/10 of the level of the |
324 | the 'use magic item' skill level of the player and 1/10 of the level of the |
297 | rod is added as bonus. |
325 | rod is added as bonus. |
298 | |
326 | |
… | |
… | |
874 | =back |
902 | =back |
875 | |
903 | |
876 | =head3 CREATOR - type 42 - Object creators |
904 | =head3 CREATOR - type 42 - Object creators |
877 | |
905 | |
878 | Once a creator is activated by a connection it creates a number of objects |
906 | Once a creator is activated by a connection it creates a number of objects |
879 | (cloned from it's inventory or a new archetype from the other_arch slot). |
907 | (cloned from it's inventory or a new object derived from the archetype |
|
|
908 | named in the other_arch slot). |
880 | |
909 | |
881 | If FLAG_LIVESAFE is set the number of uses is unlimited. |
910 | If FLAG_LIVESAFE is set the number of uses is unlimited. |
882 | |
911 | |
883 | =over 4 |
912 | =over 4 |
884 | |
913 | |
… | |
… | |
888 | be used. |
917 | be used. |
889 | |
918 | |
890 | =item speed <number> |
919 | =item speed <number> |
891 | |
920 | |
892 | If speed is set the creator will create an object periodically, |
921 | If speed is set the creator will create an object periodically, |
893 | see speed and speed_left fields in general object attribute description |
922 | see speed and speed_left fields in general object field description |
894 | for more details on how this period works. |
923 | for more details on how this period works. |
895 | |
924 | |
896 | =item slaying <string> |
925 | =item slaying <string> |
897 | |
926 | |
898 | If set the generated object's name and |
927 | If set the generated object's name and |
899 | title will be set to this. |
928 | title will be set to this. |
900 | |
929 | |
901 | =item other_arch <string> |
930 | =item other_arch <string> |
902 | |
931 | |
903 | If the inventory of the creator is empty objects of the |
932 | If the inventory of the creator is empty new objects |
904 | archetype <string> will be generated. |
933 | will be derived from the archetype named by <string>. |
905 | |
934 | |
906 | =item connected <number> |
935 | =item connected <number> |
907 | |
936 | |
908 | See generic object attribute section. |
937 | See generic object field section. |
909 | |
938 | |
910 | =back |
939 | =back |
911 | |
940 | |
912 | =head3 DRINK - type 54 - Drinkable stuff |
941 | =head3 DRINK - type 54 - Drinkable stuff |
913 | |
942 | |
… | |
… | |
966 | |
995 | |
967 | This is the connection that will be activated. The connection is |
996 | This is the connection that will be activated. The connection is |
968 | 'pushed' when someone enters the space with the inventory checker, |
997 | 'pushed' when someone enters the space with the inventory checker, |
969 | and it is 'released' when he leaves it. |
998 | and it is 'released' when he leaves it. |
970 | |
999 | |
971 | See also the description of the connected field in the generic object attribute |
1000 | See also the description of the connected field in the generic object field |
972 | section. |
1001 | section. |
973 | |
1002 | |
974 | =back |
1003 | =back |
975 | |
1004 | |
976 | =head3 FLESH - type 72 - Organs and body parts |
1005 | =head3 FLESH - type 72 - Organs and body parts |
… | |
… | |
978 | See FOOD description. |
1007 | See FOOD description. |
979 | |
1008 | |
980 | =head3 MISC_OBJECT - type 79 - Misc. objects |
1009 | =head3 MISC_OBJECT - type 79 - Misc. objects |
981 | |
1010 | |
982 | A type for any object that has no special behaviour. |
1011 | A type for any object that has no special behaviour. |
|
|
1012 | |
|
|
1013 | =head3 LAMP - type 82 - A lamp |
|
|
1014 | |
|
|
1015 | This object makes light. |
983 | |
1016 | |
984 | =head3 DUPLICATOR - type 83 - Duplicators or: Multiplicators |
1017 | =head3 DUPLICATOR - type 83 - Duplicators or: Multiplicators |
985 | |
1018 | |
986 | This type of objects multiplies objects that are above it when it is activated. |
1019 | This type of objects multiplies objects that are above it when it is activated. |
987 | You can even multiply by 0, which will destroy the object. |
1020 | You can even multiply by 0, which will destroy the object. |
… | |
… | |
992 | |
1025 | |
993 | The multiplicator, if set to 0 or lower it will destroy the objects above it. |
1026 | The multiplicator, if set to 0 or lower it will destroy the objects above it. |
994 | |
1027 | |
995 | =item other_arch <string> |
1028 | =item other_arch <string> |
996 | |
1029 | |
997 | The archetype name of the objects which will be multiplied. |
1030 | The archetype name of the objects that should be multiplied. |
998 | |
1031 | |
999 | =item connected <number> |
1032 | =item connected <number> |
1000 | |
1033 | |
1001 | See generic object attribute section. |
1034 | See generic object field section. |
1002 | |
1035 | |
1003 | =back |
1036 | =back |
1004 | |
1037 | |
1005 | =head3 HOLE - type 94 - Holes |
1038 | =head3 HOLE - type 94 - Holes |
1006 | |
1039 | |
… | |
… | |
1061 | =over 4 |
1094 | =over 4 |
1062 | |
1095 | |
1063 | =item dam <number> |
1096 | =item dam <number> |
1064 | |
1097 | |
1065 | Each time the poisoning is processed (which is determined by the speed and speed_left |
1098 | Each time the poisoning is processed (which is determined by the speed and speed_left |
1066 | fields, see the general object attributes above) it hits the player with |
1099 | fields, see the general object fields above) it hits the player with |
1067 | <number> damage and the AT_INTERNAL attacktype (means: it will simply |
1100 | <number> damage and the AT_INTERNAL attacktype (means: it will simply |
1068 | hit the player with no strings attached). |
1101 | hit the player with no strings attached). |
1069 | |
1102 | |
1070 | =item food <number> |
1103 | =item food <number> |
1071 | |
1104 | |
… | |
… | |
1083 | inventory. |
1116 | inventory. |
1084 | |
1117 | |
1085 | Forces only take effect on the player if they have set FLAG_APPLIED. |
1118 | Forces only take effect on the player if they have set FLAG_APPLIED. |
1086 | |
1119 | |
1087 | Whether the duration field is processed or not a tick is controlled via the |
1120 | Whether the duration field is processed or not a tick is controlled via the |
1088 | speed and speed_left field. Look above at the generic description of these |
1121 | speed and speed_left field. Look above in the generic object field description. |
1089 | fields. |
|
|
1090 | |
1122 | |
1091 | NOTE: Setting FLAG_IS_USED_UP on an force will also consider the 'food' field |
1123 | NOTE: Setting FLAG_IS_USED_UP on an force will also consider the 'food' field |
1092 | like stated above in the FLAG_IS_USED_UP description. BUT: If the food field reaches |
1124 | like stated above in the FLAG_IS_USED_UP description. BUT: If the food field reaches |
1093 | 0 before duration and FLAG_APPLIED is set, the force will last for 'duration'. |
1125 | 0 before duration and FLAG_APPLIED is set, the force will last for 'duration'. |
1094 | If the FLAG_APPLIED is not set the force is removed when food reaches 0. |
1126 | If the FLAG_APPLIED is not set the force is removed when food reaches 0. |