Modding Tutorials/ThingDef

From RimWorld Wiki
Revision as of 19:44, 20 April 2014 by Longbyte1 (talk | contribs) (Added global attributes)
Jump to navigation Jump to search

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