Modding:Objects: Difference between revisions

Add info about the new removal tags
m (Fix description of the Animated part.)
(Add info about the new removal tags)
 
(3 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 138: 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 305: 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}}