Modding:Objects: Difference between revisions

7,877 bytes added ,  21:44, 24 September 2023
Add a new section on common parts used by objects.
(fixed file location for object blueprints)
(Add a new section on common parts used by objects.)
Line 69: Line 69:
==Adding the object to encounters==
==Adding the object to encounters==
Once you've created your item, check out this page for information on how to introduce it to dynamic encounters: [[Modding: Encounters and Population|Encounter and Population Modding]]
Once you've created your item, check out this page for information on how to introduce it to dynamic encounters: [[Modding: Encounters and Population|Encounter and Population Modding]]
== Parts ==
The game implements a wide variety of parts in <code>XRL.World.Parts</code> that can be applied to objects. These parts can be added to an object by adding a <code>part</code> tag to their definition in XML, supplying the name of the part and any other relevant attributes. For example:
<syntaxhighlight lang="xml">
<object Name="Snapjaw" Load="Merge">
  <part Name="Corpse" CorpseChance="90" CorpseBlueprint="Snapjaw Corpse" />
</object>
</syntaxhighlight>
Parts can also be ''removed'' from an object through the use of the <code>removepart</code> XML tag, e.g. <code>&lt;removepart Name="Corpse" /&gt;</code>.
Below is an (incomplete) list of some of the most common and important parts used by creatures and items in the game.
=== General parts ===
{| class="wikitable"
! style="width: 20%;" | Name
! style="width: 40%;" | Attributes
! Description
|-
| Description
| Short
| Affects the description of an object when you look at it.
|-
| Food
| Message, Satiation, Thirst, Healing
| Makes an object edible. This part also affects the message that pops up when you eat a given item, as well as its impact on your [[hitpoints (HP)]] and [[thirst]].
|-
| Interesting
| Key, IfPartOperational, DisplayName, Preposition, Radius, EvenIfInvisible, TranslateToLocation, IconTile, IconRenderString, IconColorString, IconTileColor, IconDetailColor
| Whether or not an object is considered "interesting" in the current zone. Objects marked as interesting can be automatically moved to through the "move to point of interest" selector.
|-
| RandomTile
| Tiles
| Changes the tile used by a creature to be a random tile from a comma-separated list given by the <code>Tiles</code> attribute.
|-
| Render
| DisplayName, RenderString, RenderLayer, RenderIfDark, DetailColor, ColorString
| Change the color and tile used to render an object, as well as the name of the object as it appears in-game.
|}
=== Creature- and corpse-specific parts ===
{| class="wikitable"
! style="width: 20%;" | Name
! style="width: 40%;" | Attributes
! Description
|-
| Body
| Anatomy
| The [[Modding:Bodies|body type]] used by a creature.
|-
| Brain
| Hostile, Factions
| Used to specify a creature's default hostility state, as well as the [[factions]] that it belongs to.
|-
| Butcherable
| OnSuccessAmount, OnSuccess
| Can be applied to a creature's corpse to make it [[butchery|butcherable]].
|-
| ConversationScript
| ConversationID, Quest, PreQuestConversationID, InQuestConversationID, PostQuestConversationID, ClearLost, Filter
| Used to specify a creature's script for conversations, using an ID from <code>Conversations.xml</code>. Conversation scripts can be static, or can be dynamically selected conditional on what quests the player is currently undertaking.
|-
| Corpse
| CorpseBlueprint, CorpseRequiresBodyPart, BurntCorpseBlueprint, BurntCorpseRequiresBodyPart, VaporizedCorpseBlueprint, VaporizedCorpseRequiresBodyPart
| Specifies the [[corpse]] left by a creature.
|-
| GivesRep
| repValue
| When given to a creature, allows the player to perform the [[water ritual]] with that creature.
|-
| MentalShield
|
| Gives a creature a [[mental shield]].
|}
=== Item- and furniture-specific parts ===
{| class="wikitable"
! style="width: 20%;" | Name
! style="width: 40%;" | Attributes
! Description
|-
| Chat
| Says, ShowInShortDescription
| Adds writing to an object, which appears in the object's description when interacting with it. This is often used, for instance, by the signs outside of merchants' tents at the {{favilink|Six Day Stilt}}.
|-
| Commerce
| Value
| Controls the trade value of a given object.
|-
| CyberneticsBaseItem
| Slots, Cost, BehaviorDescription
| Makes an item an implantable [[cybernetics|cybernetic]].
|-
| EnergyCellSocket
| SlotType, SlottedType, ChanceSlotted, ChanceFullCell, ChanceDestroyCellOnForcedUnequip
| Controls whether or not an item can be slotted with an energy cell, as well as whether or not it spawns with an energy cell by default.
|-
| Examiner
| Complexity, Difficulty, Unknown, Alternate, Understanding
| Determines the [[artifact examination]] difficulty for an item.
|-
| LiquidVolume
| InitialLiquid, MaxVolume, StartVolume, ManualSeal, LiquidVisibleWhenSealed
| Allows an item to hold [[liquid]].
|-
| TinkerItem
| Bits, CanDisassemble, CanBuild, Ingredient, SubstituteBlueprint, RepairCost, RustedRepairCost
| Controls whether or not an item can be built and disassembled with [[tinkering]] skills, as well as what bits and special ingredients it may require.
|}
=== Object materials and physical properties ===
{| class="wikitable"
! style="width: 20%;" | Name
! style="width: 40%;" | Attributes
! Description
|-
| Metal
|
| Controls whether or not an object is made of [[metal]].
|-
| Physics
| Weight, Conductivity, FlameTemperature, VaporTemperature, FreezeTemperature, BrittleTemperature, Solid, IsReal, Owner, Takeable, Category
| Defines a variety of physical properties of objects, including their weight, the temperatures at which they are set on fire and freeze, how much they conduct electricity, and so on. Can also be used to indicate which faction owns an object.
|-
| Springy
| Factor
| Affects the "springiness" of an object. Objects with higher springiness have a higher kinetic absorption.
|}
=== Armor- and weapon-specific parts ===
{| class="wikitable"
! style="width: 20%;" | Name
! style="width: 40%;" | Attributes
! Description
|-
| Armor
| AV, DV, MA, Acid, Elec, Cold, Heat, Strength, Agility, Toughness, Intelligence, Ego, Willpower, ToHit, SpeedPenalty, SpeedBonus, CarryBonus, WornOn
| Used to specify different stat bonuses provided by an armor type upon being equipped, as well as the body part on which that armor can be equipped.
|-
| CooldownAmmoLoader
| ProjectileObject, Cooldown, Readout
| Used by missile weapons that have a cooldown after shooting (e.g. {{favilink|spaser rifle|plural}}). Can also be used to specify the projectile shot by those weapons.
|-
| EnergyAmmoLoader
| ProjectileObject, ChargeUse, IsPowerLoadSensitive
| Used by missile weapons that consume energy from [[energy cell|energy cells]]. Can be used to specify the projectile shot by those weapons.
|-
| LiquidAmmoLoader
| ProjectileObject, Liquid, ShotsPerDram, ShowDamage
| Used by missile weapons that consume a liquid when firing, e.g. {{favilink|flamethrower|plural}}.
|-
| MagazineAmmoLoader
| ProjectileObject, AmmoPart, MaxAmmo
| Used to indicate that a missile weapon needs ammo to fire, and to specify the projectile shot by that weapon.
|-
| MeleeWeapon
| MaxStrengthBonus, BaseDamage, Skill, Stat, Slot
| Defines the amount of damage that can be dealt by a weapon, what body slot it can be equipped on, and what skill tree it falls under (e.g., [[Long Blade]], [[Cudgel]], etc.)
|-
| MissileWeapon
| AnimationDelay, ShotsPerAction, AmmoPerAction, ShotsPerAnimation, AimVarianceBonus, WeaponAccuracy, MaxRange, VariableMaxRange, AmmoChar, NoWildfire, bShowShotsPerAction, FiresManually, ProjectilePenetrationStat, SlotType, EnergyCost, RangeIncrement, Modifier, Skill
| Allows an item to be equipped as a [[missile weapon]]. Controls various aspects of missile weapon behavior, including projectile range and animations used.
|-
| Projectile
| BasePenetration, StrengthPenetration, PenetrateCreatures, PenetrateWalls, Quiet, BaseDamage, ColorString, Attributes, PassByVerb, RenderChar
| Used by projectiles shot by missile weapons. Defines the damage done by those weapons as well as other attributes of the projectiles that they shoot.
|}
=== Miscellaneous ===
{| class="wikitable"
! style="width: 20%;" | Name
! style="width: 40%;" | Attributes
! Description
|-
| Harvestable
| DestroyOnHarvest, OnSuccess, OnSuccessAmount, RipeColor, RipeTileColor, RipeDetailColor, UnripeColor, UnripeTileColor, UnripeDetailColor, StartRipeChance
| Allows an object to be [[harvestry|harvested]].
|}
==Detailed Topics==
==Detailed Topics==
*<span class="plugin_pagetree_children_span" id="childrenspan25690143-0"> [[Modding: Giving Creatures Inventory Items|Giving Creatures Inventory Items]] </span>
*<span class="plugin_pagetree_children_span" id="childrenspan25690143-0"> [[Modding: Giving Creatures Inventory Items|Giving Creatures Inventory Items]] </span>