Modding Tutorials/ThingDef

From RimWorld Wiki
Revision as of 08:01, 1 May 2014 by Jpwrunyan (talk | contribs) (→‎Global attributes: -> element)
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 elements

These elements can be used in all ThingDef types.

Element 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
tickerType Decides the tick type. Never, Normal (60 Ticks a second), Rare (1 Tick every 4.17 seconds or 1 tick every 250 normal ticks)