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.28 by root, Sun Oct 5 14:16:13 2008 UTC vs.
Revision 1.40 by root, Thu Apr 15 00:36:51 2010 UTC

33This document does explain the behaviour of the objects and the meaning of 33This document does explain the behaviour of the objects and the meaning of
34their fields in the server engine, which are derived from archetypes. 34their fields in the server engine, which are derived from archetypes.
35 35
36This is an example of an archetype: 36This is an example of an archetype:
37 37
38 Object button_trigger 38 object button_trigger
39 name button 39 name button
40 type 30 40 type 30
41 face button_sma.111 41 face button_sma.x11
42 anim 42 anim
43 button_sma.111 43 button_sma.x11
44 button_sma.112 44 button_sma.x12
45 mina 45 mina
46 is_animated 0 46 is_animated 0
47 exp 30 47 exp 30
48 no_pick 1 48 no_pick 1
49 walk_on 1 49 walk_on 1
111For non-player objects this field is not changed by server ticks. 111For non-player objects this field is not changed by server ticks.
112 112
113=item I<glow_radius> <number> 113=item I<glow_radius> <number>
114 114
115This field indicates how far an object glows. Default is a radius of 0 (no 115This field indicates how far an object glows. Default is a radius of 0 (no
116glowing at all). 116glowing at all). Negative glow radii darken areas - currently, negative
117glow radii are stronger than positive ones.
117 118
118=item I<speed> <number> 119=item I<speed> <float>
119 120
120If this field is greater than MIN_ACTIVE_SPEED (~0.0001) the object is placed 121If this field is greater than MIN_ACTIVE_SPEED (~0.0001) the object is placed
121on the active object list and will be processed each tick (see also speed_left!). 122on the active object list and will be processed each tick (see also speed_left!).
122 123
123If I<speed> drops below the MIN_ACTIVE_SPEED the object is removed 124If I<speed> drops below the MIN_ACTIVE_SPEED the object is removed
124from the active object list and it won't experience any processing per tick. 125from the active object list and it won't experience any processing per tick.
125 126
127Negative speed settings in archetypes and files cause a speed_left
128randomisation on load or instantiatian, but for calculations, the absolute
129value is used always.
130
126=item I<speed_left> <number> 131=item I<speed_left> <float>
127 132
128If this field is greater than 0 and the object is on the 133If this field is greater than 0 and the object is on the
129active list (mostly means it's speed is also greater than 0): 134active list (mostly means it's speed is also greater than 0):
130 135
131 - speed_left is decreased by 1 136 - speed_left is decreased by 1
137 142
138This means: the lower I<speed> is (but still above MIN_ACTIVE_SPEED) 143This means: the lower I<speed> is (but still above MIN_ACTIVE_SPEED)
139the more seldom the object is processed. And the higher I<speed> is 144the more seldom the object is processed. And the higher I<speed> is
140the more often the object is processed. 145the more often the object is processed.
141 146
142=item I<connected> <number> 147=item I<connected> <identifier>
143 148
144When this field is set the object will be linked to a connection with the 149When this field is set the object will be linked to a connection with the
145id <number>. What happens when the connection is 'activated' depends on the 150same <identifier>. What happens when the connection is 'activated' depends on the
146type of the object. 151type of the object.
147 152
148FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE they will control 153FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE they will control
149when to activate the object, see description of these below for further details. 154when to activate the object, see description of these below for further details.
150 155
213This field had a special meaning for crossedit, which used parts 218This field had a special meaning for crossedit, which used parts
214of the server code for editing. Wherever you see this field being 219of the server code for editing. Wherever you see this field being
215set in an archetype ignore it and/or remove it. No code interprets this 220set in an archetype ignore it and/or remove it. No code interprets this
216field anymore. 221field anymore.
217 222
223=item I<last_heal>, I<last_sp>
224
225For monsters and other living stuff that heals or regenarates hp or sp,
226these contain the fractional part of any healing that couldn't be applied
227to hp and sp yet.
228
218=back 229=back
219 230
220=head3 Flags 231=head3 Flags
221 232
222Here are the effects of the flags described. 233Here are the effects of the flags described.
263will be generated. 274will be generated.
264 275
265After the new object is created the I<hp> field from the old object is copied into 276After the new object is created the I<hp> field from the old object is copied into
266the new one. 277the new one.
267 278
268When the old object was a B<LAMP> it's I<food> fields value less 1 will be copied
269to the new object.
270
271=item FLAG_IS_A_TEMPLATE (internal use) 279=item FLAG_IS_A_TEMPLATE (internal use)
272 280
273This flag is set on the inventory of generators like B<CREATOR>s and B<CONVERTER>s, 281This flag is set on the inventory of generators like B<CREATOR>s and B<CONVERTER>s,
274or other objects that have the flags FLAG_GENERATOR and FLAG_CONTENT_ON_GEN set. 282or other objects that have the flags FLAG_GENERATOR and FLAG_CONTENT_ON_GEN set.
275 283
330=item FLAG_IS_LIGHTABLE 338=item FLAG_IS_LIGHTABLE
331 339
332This flag indicates whether a B<LIGHTER> can light this object. See also the 340This flag indicates whether a B<LIGHTER> can light this object. See also the
333description of the B<LIGHTER> type. How easy you can light an item depends 341description of the B<LIGHTER> type. How easy you can light an item depends
334partially on the material of the object. 342partially on the material of the object.
343
344=item FLAG_MONSTER
345
346Enables NPC behaviour in general (both monster AI and friendly AI). Numerous fields
347change their meaning, including:
348
349=over 4
350
351=item I<wis>
352
353Governs the "wake-up radius" - the radius within a monster detects an enemy.
354
355Also, I<wis> governs pathfinding intelligence: 8 and up means the monster
356will partake in basic smell finding. 10 and up additionally spreads smell
357knowledge, and 15 and up additionally will try to perturb the path as to
358find shortcuts.
359
360=back
335 361
336=back 362=back
337 363
338=head2 Description of type specific fields and behaviour 364=head2 Description of type specific fields and behaviour
339 365
446This field has some special meaning in potions, currently the 472This field has some special meaning in potions, currently the
447bits for AT_DEPLETE and AT_GODPOWER control whethere this is a 473bits for AT_DEPLETE and AT_GODPOWER control whethere this is a
448restoration potion or improvement potion. 474restoration potion or improvement potion.
449See include/attackinc.h for the bits of these types. 475See include/attackinc.h for the bits of these types.
450 476
451If AT_DEPLETE is set the player will be restored and the ARCH_DEPLETION 477If AT_DEPLETE is set the player will be restored and the "depletion"
452will be removed from him. If the potion has FLAG_CURSED or FLAG_DAMNED 478will be removed from him. If the potion has FLAG_CURSED or FLAG_DAMNED
453set the player will be drained a random stat by inserting an ARCH_DEPLETION 479set the player will be drained a random stat by inserting an "depletion"
454into him. 480into him.
455 481
456If AT_GODPOWER is enabled the player will gain +1 maxvalue in his hp, sp or grace stat. 482If AT_GODPOWER is enabled the player will gain +1 maxvalue in his hp, sp or grace stat.
457When the potion has FLAG_CURSED or FLAG_DAMNED set he will loose one in one of these stats. 483When the potion has FLAG_CURSED or FLAG_DAMNED set he will loose one in one of these stats.
458 484
500 526
501=back 527=back
502 528
503=back 529=back
504 530
505=head3 B<FOOD> - type 6 - Eatable stuff 531=head3 B<FOOD> - type 6 - Edible stuff
506 532
507This is for objects that are representing general eatables like 533This is for objects that are representing general eatables like
508beef or bread. 534beef or bread.
509 535
510The main difference between B<FOOD>, B<FLESH> and B<DRINK> is that they 536The main difference between B<FOOD>, B<FLESH> and B<DRINK> is that they
610 636
611=head3 B<CLOCK> - type 9 - Clocks 637=head3 B<CLOCK> - type 9 - Clocks
612 638
613This type of objects just display the time when being applied. 639This type of objects just display the time when being applied.
614 640
641=head3 B<VEIN> - type 10 - item veins for mining
642
643Provides a place to apply to mining skill to.
644
645=item I<other_arch> <archname>
646
647The architecture to create on a successful mine.
648
649=item I<food> <number>
650
651The number of items to produce from this vein.
652
653=item I<ac> <percentage>
654
655The base chance of getting an item.
656
657=item I<race> <identifier>
658
659Race of required extraction tools.
660
661=back
662
615=head3 B<LIGHTNING> - type 12 - Lightnings (DEPRECATED: see B<SPELL_EFFECT> subtype SP_BOLT) 663=head3 B<LIGHTNING> - type 12 - Lightnings (DEPRECATED: see B<SPELL_EFFECT> subtype SP_BOLT)
616 664
617This is a spell effect of a moving bolt. It moves straigt forward 665This is a spell effect of a moving bolt. It moves straigt forward
618through the map until something blocks it. 666through the map until something blocks it.
619If FLAG_REFLECTING is set it even reflects on walls. 667If FLAG_REFLECTING is set it even reflects on walls.
731The minimum I<speed> of an arrow is 1.0. 779The minimum I<speed> of an arrow is 1.0.
732 780
733While flying the arrows I<speed> is decreased by 0.05 each time it's moved. 781While flying the arrows I<speed> is decreased by 0.05 each time it's moved.
734 782
735If the I<speed> is above 10.0 it goes straight through the creature it hits and 783If the I<speed> is above 10.0 it goes straight through the creature it hits and
736it's I<speed> is reduced by 1. If the I<speed> is lower or equal 10.0 the arrow is 784its I<speed> is reduced by 1. If the I<speed> is lower or equal 10.0 the arrow is
737stopped and either sticked into the victim (see I<weight> field description) or 785stopped and either stuck into the victim (see I<weight> field description) or
738put on it's map square (if it didn't break, see description of the I<food> field). 786put on its map square (if it didn't break, see description of the I<food> field).
739 787
740=item I<weight> <number> 788=item I<weight> <number>
741 789
742This field is the weight of the arrow, if I<weight> is below or equal 5000 (5 kg) 790This field is the weight of the arrow, if I<weight> is below or equal 5000 (5 kg)
743the arrow will stick in the victim it hits. Otherwise it will fall to the ground. 791the arrow will stick in the victim it hits. Otherwise it will fall to the ground.
955=item I<hp> <number> 1003=item I<hp> <number>
956 1004
957If FLAG_LIVE_SAVE is not set it is the absolute number of times the creator can 1005If FLAG_LIVE_SAVE is not set it is the absolute number of times the creator can
958be used. 1006be used.
959 1007
960=item I<speed> <number> 1008=item I<speed> <float>
961 1009
962If I<speed> is set the creator will create an object periodically, 1010If I<speed> is set the creator will create an object periodically,
963see I<speed> and I<speed_left> fields in the general object field description 1011see I<speed> and I<speed_left> fields in the general object field description
964for more details. 1012for more details.
965 1013
970=item I<other_arch> <string> 1018=item I<other_arch> <string>
971 1019
972If the inventory of the creator is empty new objects will be derived from the 1020If the inventory of the creator is empty new objects will be derived from the
973archetype named by <string>. 1021archetype named by <string>.
974 1022
975=item I<connected> <number> 1023=item I<connected> <identifier>
976 1024
977See generic object field description. 1025See generic object field description.
1026
1027=back
1028
1029=head3 B<SKILL> - type 43 - Skills
1030
1031This type is basically for representing skills in the game.
1032
1033=over 4
1034
1035=item I<subtype> <skill number>
1036
1037=item I<skill> <string>
1038
1039The skill identifier used by other items, usually the skill name
1040
1041=item I<level> <percentage>
1042
1043not used?
1044
1045=item I<exp> <number>
1046
1047Base amount of experience in a skill, for skills not starting at zero.
1048
1049=item I<expmul> <float>
1050
1051Experience is multiplied by this factor.
1052
1053=item I<cached_sp> <integer>
1054
1055Used internally by the server (cannot be used in files).
978 1056
979=back 1057=back
980 1058
981=head3 B<DRINK> - type 54 - Drinkable stuff 1059=head3 B<DRINK> - type 54 - Drinkable stuff
982 1060
1029=item I<race> <string> 1107=item I<race> <string>
1030 1108
1031If this field is set the inventory checker will search for an object which 1109If this field is set the inventory checker will search for an object which
1032has the archetype name that matches <string>. 1110has the archetype name that matches <string>.
1033 1111
1034=item I<connected> <connection id> 1112=item I<connected> <identifier>
1035 1113
1036This is the connection that will be activated. The connection is 1114This is the connection that will be activated. The connection is
1037'pushed' when someone enters the space with the inventory checker, 1115'pushed' when someone enters the space with the inventory checker,
1038and it is 'released' when he leaves it. 1116and it is 'released' when he leaves it.
1039 1117
1040See also the description of the I<connected> field in the generic object field 1118See also the description of the I<connected> field in the generic object
1041section. 1119field section.
1042 1120
1043=back 1121=back
1044 1122
1045=head3 B<MOOD_FLOOR> - type 65 - change mood of monsters 1123=head3 B<MOOD_FLOOR> - type 65 - change mood of monsters
1046 1124
1064 1142
1065=head3 B<MISC_OBJECT> - type 79 - Misc. objects 1143=head3 B<MISC_OBJECT> - type 79 - Misc. objects
1066 1144
1067A type for any object that has no special behaviour. 1145A type for any object that has no special behaviour.
1068 1146
1069=head3 B<LAMP> - type 82 - A lamp
1070
1071This object represents a lamp, that can be carried and switched
1072on and off and has a certain amount of fuel in it.
1073
1074A lamp consists of two archetypes: the 'on' archetype and the 'off' archetype.
1075Each of them should point at the other one with it's I<other_arch> field.
1076
1077See the I<other_arch> field for the behaviour of a lamp object when it is applied.
1078
1079If this object has FLAG_IS_LIGHTABLE set the lamp can be turned on and off
1080with a B<LIGHTER>, see also the description of FLAG_IS_LIGHTABLE.
1081
1082=over 4
1083
1084=item I<glow_radius> <number>
1085
1086The radius of the light that the lamp emits, see also I<glow_radius> in the
1087generic object flags description.
1088
1089=item I<speed> <number>
1090
1091If FLAG_CHANGING is set the I<speed> field will indicate how fast the
1092lamp burns it's fuel (I<food>).
1093
1094Setting FLAG_CHANGING makes only sense on the archetype which represents
1095the 'on' state of the lamp.
1096
1097See also the description of FLAG_CHANGING.
1098
1099Lamps which have no FLAG_CHANGING set would also make sense and represent
1100lamps that never burn up.
1101
1102=item I<other_arch> <number>
1103
1104This is the field that points to the 'other' archetype which represents the
1105opposite state of the lamp. The newly from I<other_arch> derived object will
1106replace the current object and will get the value of I<food> of the replaced object.
1107
1108Rationale:
1109
1110When the lamp (on) is applied a new object is derived from the archetype
1111in I<other_arch> and the I<food> value is copied to it ('the fuel is
1112transferred'). The new lamp (off) object has to have a I<other_arch> field
1113which points to the archetype from which a lamp (on) can be derived.
1114
1115=item I<food> <number>
1116
1117This fields stands for the fuel of the lamp.
1118
1119=back
1120
1121=head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators 1147=head3 B<DUPLICATOR> - type 83 - Duplicators or: Multiplicators
1122 1148
1123This type of objects multiplies objects that are above it when it is activated. 1149This type of objects multiplies objects that are above it when it is activated.
1124You can even multiply by 0, which will destroy the object. 1150You can even multiply by 0, which will destroy the object.
1125 1151
1131 1157
1132=item I<other_arch> <string> 1158=item I<other_arch> <string>
1133 1159
1134The archetype name of the objects that should be multiplied. 1160The archetype name of the objects that should be multiplied.
1135 1161
1136=item I<connected> <number> 1162=item I<connected> <identifier>
1137 1163
1138See generic object field description. 1164See generic object field description.
1139 1165
1140=back 1166=back
1141 1167
1159when the connection is activated. This field only has effect when the 1185when the connection is activated. This field only has effect when the
1160connection is triggered. So if you put a closed hole on a map, and the 1186connection is triggered. So if you put a closed hole on a map, and the
1161connection is deactivated, and I<maxsp> is 1 the hole will remain closed until the 1187connection is deactivated, and I<maxsp> is 1 the hole will remain closed until the
1162connection was triggered once. 1188connection was triggered once.
1163 1189
1164=item I<connected> <connection id> 1190=item I<connected> <identifier>
1165 1191
1166This is the connection id, which lets the hole opening or closing when 1192This is the connection id, which lets the hole opening or closing when
1167activated. The flags FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE control 1193activated. The flags FLAG_ACTIVATE_ON_PUSH and FLAG_ACTIVATE_ON_RELEASE control
1168at which connection state the object is activated. 1194at which connection state the object is activated.
1169 1195

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines