Modding:Objects: Difference between revisions

Add info about the new removal tags
(Add a new section on common parts used by objects.)
(Add info about the new removal tags)
 
(13 intermediate revisions by the same user not shown)
Line 31: Line 31:
| <code><nowiki><part></nowiki></code>
| <code><nowiki><part></nowiki></code>
| Indicates that this object should load the part with the specified name. A parts is any C# class that inherits <code>IPart</code>.<br>You don't need to know how to code to add a part though, there are a lot of useful parts already available in the base game that you can steal from other objects.
| Indicates that this object should load the part with the specified name. A parts is any C# class that inherits <code>IPart</code>.<br>You don't need to know how to code to add a part though, there are a lot of useful parts already available in the base game that you can steal from other objects.
|-
| <code><nowiki><removepart></nowiki></code>
| Removes a part that is defined on or inherited by the object
|-
|-
| <code><nowiki><mutation></nowiki></code>
| <code><nowiki><mutation></nowiki></code>
Line 45: Line 42:
|-
|-
| <code><nowiki><inventoryobject></nowiki></code>
| <code><nowiki><inventoryobject></nowiki></code>
|  
| Adds an object to a creature's inventory. <code>Number</code> can be specified to say how many of the object the creature should have. In addition, a blueprint can be prefixed with <code>@</code> to sample the inventory objects from a population table, e.g. <code>Blueprint="@DynamicObjectsTable:EnergyCells:Tier{ownertier}"</code>.
|-
|-
| <code><nowiki><stat></nowiki></code>
| <code><nowiki><stat></nowiki></code>
Line 63: Line 60:
|-
|-
| <code><nowiki><stag></nowiki></code>
| <code><nowiki><stag></nowiki></code>
|  
| Adds an object to a [[Modding: Encounters and Population#DynamicSemanticTable|dynamic semantic table]].
|-
| <code><nowiki><mixin></nowiki></code>
| Adds a "mixin" to an object. This can be used in place of (or in addition to) inheritance to automatically copy parts and tags to an object from another object. <code>mixin</code> supports the following attributes:
* '''Name (string):''' blueprint used in mixin
* '''Include (string):''' comma-delimited string of elements to include
* '''Exclude (string):''' comma-delimited string of elements to exclude
* '''Priority (int):''' mixin priority (lower comes earlier)
* '''Fill (bool):''' whether to add the mixin before or after normal inheritance
|-
|-
|}
|}
The effects of most objects tags can be reverted using a <code>remove*</code> tag. For instance, <code><nowiki><removepart Name="..." /></nowiki></code> will remove a part from an object blueprint; <code><nowiki><removemutation Name="..." /></nowiki></code> can be used to remove a mutation from a creature{{Code Reference|namespace=XRL.World.Loaders|class=ObjectBlueprintLoader.RemovalNode}}.


==Adding the object to encounters==
==Adding the object to encounters==
Line 94: Line 101:
| Short
| Short
| Affects the description of an object when you look at it.
| Affects the description of an object when you look at it.
|-
| DeployWith
| Blueprint, PreferredDirection, SameCell, SolidOkay, SeepingOkay, Chance, CarryOverOwner
| Ensure that the object spawns alongside other objects. This is used, for example, by {{favilink|air well|plural}} to ensure that they spawn with {{favilink|catch basin|plural}}.
|-
|-
| Food
| Food
Line 102: Line 113:
| Key, IfPartOperational, DisplayName, Preposition, Radius, EvenIfInvisible, TranslateToLocation, IconTile, IconRenderString, IconColorString, IconTileColor, IconDetailColor
| 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.
| 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.
|-
| RandomColors
| DetailColor, TileColor
| Selects a random primary and detail color for an object's tile. The <code>DetailColor</code> and <code>TileColor</code> attributes should be comma-separated lists of colors.
|-
|-
| RandomTile
| RandomTile
Line 130: Line 145:
| OnSuccessAmount, OnSuccess
| OnSuccessAmount, OnSuccess
| Can be applied to a creature's corpse to make it [[butchery|butcherable]].
| Can be applied to a creature's corpse to make it [[butchery|butcherable]].
|-
| Consumer
| Chance, WeightThresholdPercentage, SuppressCorpseDrops, Message, FloatMessage
| Causes a creature to destroy objects and creatures in its path. This is used by {{favilink|salt kraken|plural}} and {{favilink|star kraken|plural}} (along with the <code>SlowDangerousMovement</code> and and <code>AIWanderingJuggernaut</code> parts).
|-
|-
| ConversationScript
| ConversationScript
Line 138: Line 157:
| CorpseBlueprint, CorpseRequiresBodyPart, BurntCorpseBlueprint, BurntCorpseRequiresBodyPart, VaporizedCorpseBlueprint, VaporizedCorpseRequiresBodyPart
| CorpseBlueprint, CorpseRequiresBodyPart, BurntCorpseBlueprint, BurntCorpseRequiresBodyPart, VaporizedCorpseBlueprint, VaporizedCorpseRequiresBodyPart
| Specifies the [[corpse]] left by a creature.
| Specifies the [[corpse]] left by a creature.
|-
| Followers
| Table
| Generate followers for a creature from a given population table upon spawning.
|-
| GenerateName
| SpecialType, NamingContext
| Gives the creature a proper name upon spawning.
|-
|-
| GivesRep
| GivesRep
Line 146: Line 173:
|
|
| Gives a creature a [[mental shield]].
| Gives a creature a [[mental shield]].
|-
| SocialRoles
| Roles
| Add a list of "roles" that appear at the end of a creature's name. For instance, non-named creatures living in {{favilink|Yd Freehold}} are given the role "denizen of the Yd Freehold".
|-
| Titles
| Primary, Ordinary
| Add a title that appears after a creature's name. This is used, for example, by {{favilink|Oboroqoru, Ape God}} and {{favilink|Hamilcrab, cyclopean merchant}}.
|}
|}


Line 154: Line 189:
! style="width: 40%;" | Attributes
! style="width: 40%;" | Attributes
! Description
! Description
|-
| Animated
| ChanceOneIn
| Makes an item [[animated]] with a probability given by the <code>ChanceOneIn</code> attribute.
|-
| BootSequence
| BootTime, VariableBootTime, ReadoutInName, ReadoutInDescription, AlwaysObvious, ObviousIfUnderstood, TextInDescription, VerbOnBootInitialized, VerbOnBootDone, VerbOnBootAborted, SoundOnBootInitialized, SoundOnBootDone, SoundOnBootAborted
| Forces an item to undergo a "boot sequence" before its effects are activated. Examples of items that use this part include {{favilink|thermo cask}}, {{favilink|ganglionic teleprojector}}, and {{favilink|telemetric visor}}.
|-
|-
| Chat
| Chat
Line 178: Line 221:
| InitialLiquid, MaxVolume, StartVolume, ManualSeal, LiquidVisibleWhenSealed
| InitialLiquid, MaxVolume, StartVolume, ManualSeal, LiquidVisibleWhenSealed
| Allows an item to hold [[liquid]].
| Allows an item to hold [[liquid]].
|-
| MutationOnEquip
| Level, ClassName, Constructor, Describe
| Grants a creature the mutation specified by the class name and constructor upon equipping the item (or increases the rank of the mutation if it's already present).
('''Note:''' <code>Constructor</code> is typically used to differentiate between alternate versions of the same mutation; for instance, {{favilink|Stinger (Paralyzing Venom)}}, {{favilink|Stinger (Confusing Venom)}}, and {{favilink|Stinger (Poisoning Venom)}} all use the same class, but have different constructors.)
|-
|-
| TinkerItem
| TinkerItem
Line 190: Line 239:
! style="width: 40%;" | Attributes
! style="width: 40%;" | Attributes
! Description
! Description
|-
| Interior
| Cell, WX, WY, X, Y, Z, FallDistance, CarriedWeight, Unique
| Gives an object an interior zone, which may be entered from outside.
|-
|-
| Metal
| Metal
Line 201: Line 254:
| Springy
| Springy
| Factor
| Factor
| Affects the "springiness" of an object. Objects with higher springiness have a higher kinetic absorption.
| Affects the "springiness" of an object. Objects with higher springiness have a higher kinetic absorption, which reduces knockback taken from [[explosions]].
|}
|}


Line 214: Line 267:
| AV, DV, MA, Acid, Elec, Cold, Heat, Strength, Agility, Toughness, Intelligence, Ego, Willpower, ToHit, SpeedPenalty, SpeedBonus, CarryBonus, WornOn
| 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.
| 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.
|-
| BioAmmoLoader
| MaxCapacity, Available, TurnsToGenerate, ReloadEnergy, ProjectileObject, TurnsToGenerateComputePowerFactor, TurnsGenerating
| Affects ammo capacity and ammo regeneration speed when applied to a missile weapon. <code>BioAmmoLoader</code> is typically used by natural missile weapons; for instance, {{favilink|slugsnout|plural}} use it to regenerate slugs, and {{favilink|Svardym Scrounge|plural}} use it for their ranged "spit" attack.
|-
|-
| CooldownAmmoLoader
| CooldownAmmoLoader
Line 259: Line 316:
*<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>
*<span class="plugin_pagetree_children_span" id="childrenspan25690130-0"> [[Modding: Ranged Weapons|Ranged Weapons]] </span>
*<span class="plugin_pagetree_children_span" id="childrenspan25690130-0"> [[Modding: Ranged Weapons|Ranged Weapons]] </span>
== References ==
<references />


{{Modding Navbox}}
{{Modding Navbox}}