Difference between revisions of "Modding Tutorials/ThingDef"

From RimWorld Wiki
Jump to navigation Jump to search
(Created page with "'''ThingDef''' is a def type for making entities, such as buildings and pawns (NPCs). ==Buildings== Buildings are static entities. They usually require construction and perf...")
 
(Added global attributes)
Line 18: Line 18:
  
 
===Attributes===
 
===Attributes===
 +
 +
==Filth==
 +
Filth is just an image that is overlaid above the floor. It contributes to the "ugly environment" thought in pawns.
  
 
==Global attributes==
 
==Global attributes==
 
These attributes can be used in all ThingDef types.
 
These attributes can be used in all ThingDef types.
 +
 +
{| class="wikitable sortable"
 +
! scope="col"| Attribute
 +
! scope="col"|Function
 +
! scope="col"| Available options
 +
|----
 +
! scope="row"| category
 +
|Designates a category to be used internally.
 +
|Building, Pawn, Plant, Item, Filth
 +
|----
 +
! scope="row"| eType
 +
|Provides a more specific description of an object. This may be equal to the category's name.
 +
|Varies per category
 +
|----
 +
! scope="row"| thingClass
 +
|Provides an attachment to an internal class in the code.
 +
|Varies per category
 +
|----
 +
! scope="row"| selectable
 +
|Specifies whether or not the item can be selected in the atlas.
 +
|true, false
 +
|----
 +
! scope="row"| useStandardHealth
 +
|Determines whether or not health will be calculated normally. (?)
 +
|true, false
 +
|----
 +
! scope="row"| label
 +
|User-friendly name of a Thing
 +
|String
 +
|----
 +
! scope="row"| textureFolderPath
 +
|Specifies location of the textures (root folder is assumed to be Textures)
 +
|String
 +
|----
 +
! scope="row"| altitudeLayer
 +
|Influences whether pawns can walk through the Thing or must travel around it.
 +
|Filth, DoorMoveable, BuildingTall, FloorEmplacement, Waist, Item, LowPlant, Projectile, Floor, PawnState
 +
|----
 +
! scope="row"| flammability
 +
|Influences how likely it is for the Thing to catch fire and take damage.
 +
|0 to 1.0
 +
|----
 +
! scope="row"| maxHealth
 +
|Sets the maximum health of the Thing (if applicable).
 +
|Any value above 0
 +
|----
 +
|}
 +
 +
[[Category:Defs]]

Revision as of 19:44, 20 April 2014

ThingDef is a def type for making entities, such as buildings and pawns (NPCs).


Buildings

Buildings are static entities. They usually require construction and perform a special function.

Attributes

Pawns

Pawns are NPCs.

Items

Items are anything that can be hauled, such as weapons, debris, or resources.

Plants

Plants grow in growing areas, in the landscape, in a hydroponics table, or in a plant pot.

Attributes

Filth

Filth is just an image that is overlaid above the floor. It contributes to the "ugly environment" thought in pawns.

Global attributes

These attributes can be used in all ThingDef types.

Attribute Function Available options
category Designates a category to be used internally. Building, Pawn, Plant, Item, Filth
eType Provides a more specific description of an object. This may be equal to the category's name. Varies per category
thingClass Provides an attachment to an internal class in the code. Varies per category
selectable Specifies whether or not the item can be selected in the atlas. true, false
useStandardHealth Determines whether or not health will be calculated normally. (?) true, false
label User-friendly name of a Thing String
textureFolderPath Specifies location of the textures (root folder is assumed to be Textures) String
altitudeLayer Influences whether pawns can walk through the Thing or must travel around it. Filth, DoorMoveable, BuildingTall, FloorEmplacement, Waist, Item, LowPlant, Projectile, Floor, PawnState
flammability Influences how likely it is for the Thing to catch fire and take damage. 0 to 1.0
maxHealth Sets the maximum health of the Thing (if applicable). Any value above 0