Editing Modding Tutorials/Flooring

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}}
+
In this tutorial, we're going to be learning how to add your own flooring too the game using the resource which we created in the last tutorial.
<noinclude>
 
{{modal mark for deletion}}
 
</noinclude>
 
 
 
 
 
In this tutorial, we're going to be learning how to add your own flooring to the game using the resource which we created in the last tutorial.
 
  
 
==Prerequisites==
 
==Prerequisites==
 
You have completed the [[Modding Tutorials/Items|Items]] Tutorial.
 
  
 
You should have read the [[Modding Tutorials/Getting Started|Getting Started]] tutorial, which gets you up to speed with how mods are structured in RimWorld. You should also have a good understanding of where files are located (such as <code>About.xml</code>, def XML files, where you should put textures, and so on).
 
You should have read the [[Modding Tutorials/Getting Started|Getting Started]] tutorial, which gets you up to speed with how mods are structured in RimWorld. You should also have a good understanding of where files are located (such as <code>About.xml</code>, def XML files, where you should put textures, and so on).
  
You should also have a look at the [[TerrainDef]] article, which should clear up any concerns you have on the attributes we'll be using below.
+
== Making the folders ==
  
== Making the folders ==
+
You have completed the [[Modding Tutorials/Items|Items]] Tutorial.
  
 
After you have made your mod folder from the [[Modding Tutorials/Getting Started|Getting Started]] tutorial, you will need to create a new folder in which will contain your new flooring xml. Inside your <code>Defs</code> folder create a new subfolder called <code>TerrainDefs</code>. You're now done as far as creating folders go.
 
After you have made your mod folder from the [[Modding Tutorials/Getting Started|Getting Started]] tutorial, you will need to create a new folder in which will contain your new flooring xml. Inside your <code>Defs</code> folder create a new subfolder called <code>TerrainDefs</code>. You're now done as far as creating folders go.
  
== Creating the new flooring (Titanium example) ==
+
== Creating the new flooring (Wooden flooring example) ==
  
In this example, we'll be making a new titanium flooring using the titanium resource which we created in the last tutorial! Your file should now look like this (if you're making a titanium flooring like me) :
+
In this example, we'll be making a new wooden flooring using the wood which we created in the last tutorial! Your file should now look like this (if you're making a wood flooring like me) :
  
<source lang="xml">
+
<source lang="html4strict"><?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
 
 
<TerrainDefs>
 
<TerrainDefs>
 
<TerrainDef>
 
<TerrainDef>
<defName>TitaniumFloor</defName>
+
<defName>WoodFlooring</defName>
<Label>Titanium Flooring</Label>
+
<Label>Wooden Flooring</Label>
 
<RenderPrecedence>210</RenderPrecedence>
 
<RenderPrecedence>210</RenderPrecedence>
<Description>A lovely</Description>
+
<Description>Wooden planks to liven up your lovely colony.</Description>
 
<TexturePath>Things/Buildings/Floors/WoodFlooring</TexturePath>
 
<TexturePath>Things/Buildings/Floors/WoodFlooring</TexturePath>
 
<Beauty>NiceTiny</Beauty>
 
<Beauty>NiceTiny</Beauty>
Line 43: Line 34:
 
<CostList>
 
<CostList>
 
<li>
 
<li>
<thingDef>Titanium</thingDef>
+
<thingDef>Wood</thingDef>
 
<count>2</count>
 
<count>2</count>
 
</li>
 
</li>
Line 52: Line 43:
 
</TerrainDefs></source>
 
</TerrainDefs></source>
  
To find out what each line does and there options, have a look at [[TerrainDef|TerrainDef]]. There you can also find more lines.
+
== An explanation of all the lines (Global Attributes)! ==
 +
 
 +
'''defName''' - This is the ID for which the TerrainDef will take(Also the reference ID).This MUST be unique otherwise it will cause overrides.
 +
 
 +
'''Label''' - This is the display name or the visual name (The name in which the game will show you when selecting or looking at the flooring).
 +
 
 +
'''RenderPrecedence''' - This is render importance of the flooring (Sand = 350, Soil = 340, Gravel = 330, Carpet = 300-298).
 +
 
 +
'''Description''' - This is some information about the flooring.
 +
 
 +
'''TexturePath''' - This is the path in which the texture of your flooring is located inside of Textures, Do not include Textures/ in the path.
 +
 
 +
'''Beauty''' - This is how nice the flooring looks to the colonists (Choices, from nice to horrible - Enchanting, Gorgeous, Nice, NiceTiny, Neutral, UglyTiny, Ugly, Hideous, Horrifying)
 +
 
 +
'''SurfacesSupported''' - What surfaces it can be placed on (Choices - Any, Light, Heavy, GrowSoil, Diggable, SmoothHard, SmoothableStone)
 +
 
 +
'''WorkToBuild''' - This is how many ticks in-game it takes for 1 tile of the flooring to be built. (60 ticks = 1 real life second)
 +
 
 +
'''DesignationCategory''' - This is what Architect Tab you would like this flooring to be available in. (Tabs available in Alpha 3 are - Zone, Building, Orders, Structure, Furniture, Security. You can remove the whole line if you don't want it to be in any Architect Tab.)
 +
 
 +
'''Fertility''' - This is the fertility rating of the flooring. (Soil = 1.0, SoilRich = 1.4, Gravel = 0.7, Sand = 0.06)
 +
 
 +
'''CostList''' - This is the cost to make each tile of flooring. (Flooring can cost multiple resources, as demonstrated in above)
 +
 
 +
'''ConstructionEffect''' - This is the effect for which colonists will build it (Stick with ConstructDig for all)
 +
 
 +
'''AcceptTerrainSourceFilth''' - This decides whether the flooring can collect filth on it or not.
 +
 
 +
== A few more lines (Global Attributes) you can add on! ==
 +
 
 +
'''<TakeFootprints>True</TakeFootprints>''' - Decides whether or not the flooring can accept footprints for colonists. (Options - False, True)
 +
 
 +
'''<EdgeType>Fade</EdgeType>''' - Give the tile a fade effect towards the edges (Options - Fade, Hard) If not included it is Hard by default.
 +
 
 +
'''<ResearchPrerequisite>ResearchName</ResearchPrerequisite>''' - If you want the flooring to be available only after a certain Research.
  
 
== Testing ==
 
== Testing ==
  
 
Let’s test our new mod! Fire up RimWorld, making sure to turn on <code>Development mode</code> in the options menu. Open the mods menu and make sure your mod is ticked (For active), and then press the tilde key (~) to check for any errors thrown on runtime. That’s right, no errors! Enjoy your new flooring!
 
Let’s test our new mod! Fire up RimWorld, making sure to turn on <code>Development mode</code> in the options menu. Open the mods menu and make sure your mod is ticked (For active), and then press the tilde key (~) to check for any errors thrown on runtime. That’s right, no errors! Enjoy your new flooring!
 
==Download==
 
 
The latest working package of this tutorial can be found [https://github.com/oldmud0/rwmd/tree/tutorial_flooring1 here] ([https://github.com/oldmud0/rwmd/archive/tutorial_flooring1.zip download]).
 
  
 
== Conclusion ==
 
== Conclusion ==
Line 66: Line 87:
 
You now know how to:  
 
You now know how to:  
 
* make a simple flooring
 
* make a simple flooring
* know most of the TerrainDef's global attributes and their functions with the optional choices
+
* know most of the terrainDef's global attributes and their functions with the optional choices
 +
 
 +
Tutorial brought to you by Cala13er, If you have any questions about this tutorial. Message either Cala13er or Tynan on the forums.
 +
 
 +
Next we'll learn how to make a weapon!

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)