Editing Modding Tutorials/Furniture

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{BackToTutorials}}
 
 
 
Buildings and Furniture are distinct mainly by how tall they are defined. Otherwise, both types of objects are usually usable by colonists. For example, both the Comms Console and the Kitchen Stove are used to perform tasks. But the Comms Console is considered a building because it is taller than a colonist while the Kitchen Stove has a counter that is not as tall as the colonist.
 
Buildings and Furniture are distinct mainly by how tall they are defined. Otherwise, both types of objects are usually usable by colonists. For example, both the Comms Console and the Kitchen Stove are used to perform tasks. But the Comms Console is considered a building because it is taller than a colonist while the Kitchen Stove has a counter that is not as tall as the colonist.
  
 
==Making Furniture Interactive==
 
==Making Furniture Interactive==
  
The first thing most modders want to do when they create new furniture or buildings is to make the object interactive. Interactive objects have a yellow circle indicator that shows where the colonist stands when using the object.
+
The first thing most modders want to do when they create new furniture or buildings is to make the object interactive. Interactive objects have a yellow circle indicator that shows where the colonist stands when using the object. If you have completed the Simple Block tutorial open this file again and add the following .xml tags: (to do)
 
 
The [[Modding_Tutorials/Smelter|Smelter]] tutorial is intended to get you started with making interactive buildings that function like work benches.
 
 
 
 
 
==Building XML Codes==
 
'''Common Stuff (needed for all Buildings):'''
 
 
 
  <nowiki><ThingDef Name="BuildingBase" Abstract="True">
 
    <category>Building</category>
 
    <soundImpactDefault>BulletImpactMetal</soundImpactDefault>
 
    <selectable>true</selectable>
 
    <drawerType>MapMeshAndRealTime</drawerType>
 
    <terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
 
    <repairEffect>Repair</repairEffect>
 
    <leaveResourcesWhenKilled>true</leaveResourcesWhenKilled>
 
    <filthLeaving>BuildingRubble</filthLeaving>
 
  </ThingDef>
 
</nowiki>
 
 
 
 
 
 
 
'''Example Building: Barbed Wire (out of elStrange's DefendThatColony!, modified by Cefwyn):'''
 
<nowiki>
 
<ThingDef ParentName="BuildingBase">
 
<defName>WallWire</defName>
 
<label>Barbed Wire</label>
 
<thingClass>Building</thingClass>
 
<category>Building</category>
 
<description>[DTC!] A cheap and easy defence system that is impassable</description>
 
</nowiki>
 
The above defines a new object 'WallWire' that inherited all previously defined qualities of the object 'BuildingBase' (see above).
 
In game it will be labeled as 'Barbed Wire', and have the indicated description on mouse-over.
 
 
 
<nowiki>
 
        <rotatable>false</rotatable>
 
<selectable>true</selectable>
 
<neverMultiSelect>true</neverMultiSelect>
 
<placingDraggableDimensions>1</placingDraggableDimensions>
 
<terrainAffordanceNeeded>Light</terrainAffordanceNeeded>
 
<designationCategory>Security</designationCategory>
 
</nowiki>
 
DesignationCategory defines the in-game tab the new building can be found under
 
 
 
<nowiki>
 
<staticSunShadowHeight>0.5</staticSunShadowHeight>
 
<constructEffect>ConstructDirt</constructEffect>
 
<repairEffect>ConstructDirt</repairEffect>
 
</nowiki>
 
staticSunShadowHeight defines how much of a shadow the strucure casts ('''Range: 0.0 - 1.0''')
 
 
 
<nowiki>
 
<graphicData>
 
<texPath>Things/Buildings/BarbedWire_Atlas</texPath>
 
    <graphicClass>Graphic_Single</graphicClass>
 
<linkType>CornerFiller</linkType>
 
    <linkFlags>
 
    <li>Sandbags</li>
 
    </linkFlags>
 
</graphicData>
 
</nowiki>
 
New in A11: <br>
 
<graphicData> opens a new strucure that contains the above parts <br>
 
<texPath> includes the Path to the texture graphic - either graphic already included in the base game, or alternatively included with the mod <br>
 
 
 
<nowiki>
 
<linkFlags>
 
  <li>STRUCTURE</li>
 
</linkFlags>
 
</nowiki>
 
This part defines structures which our Barbed Wire directly connects to. <br>
 
Options include '''Walls, Sandbags, Rocks''', and more. Just replace STRUCTURE with the desired option. <br> Add another row with <nowiki><li>STRUCTURE</li></nowiki> for each option. <br>
 
 
 
 
 
<nowiki>
 
    <blueprintGraphicData>
 
<texPath>Things/Building/Linked/Sandbags_Blueprint_Atlas</texPath>
 
</blueprintGraphicData>
 
</nowiki>
 
This part is also new in A11, and replaces the previous single-line <nowiki><blueprintgraphicsPath>.</nowiki> <br>
 
It defines which texture is used to display the planed structure before pawns start building it.
 
<nowiki>
 
<uiIconPath>Things/Buildings/BarbedWire_Icon</uiIconPath>
 
<statBases>
 
    <MaxHitPoints>250</MaxHitPoints>
 
    <Beauty>-10</Beauty>
 
    <WorkToMake>200</WorkToMake>
 
    <Flammability>0</Flammability>
 
</statBases>
 
    <pathCost>500</pathCost>
 
<passability>Impassable</passability>
 
<altitudeLayer>FloorEmplacement</altitudeLayer>
 
<castEdgeShadows>false</castEdgeShadows>
 
<fillPercent>0.3</fillPercent>
 
    <costList>
 
    <WoodLog>1</WoodLog>
 
    <Steel>1</Steel>
 
</costList>
 
</ThingDef>
 
</nowiki>
 
 
 
[[Category:Modding tutorials]][[Category:Modding]][[Category:Defs]]
 

Please note that all contributions to RimWorld Wiki are considered to be released under the CC BY-SA 3.0 (see RimWorld Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Template used on this page: