ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/pod/objects.pod
(Generate patch)

Comparing deliantra/server/pod/objects.pod (file contents):
Revision 1.14 by elmex, Wed Dec 20 19:53:10 2006 UTC vs.
Revision 1.15 by elmex, Wed Dec 20 20:25:59 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines