Editing Modding Tutorials/Essence

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 6: Line 6:
  
  
==Modding Difficulty==
+
= Modding Difficulty =
  
 
So how hard is it to mod RimWorld? Overall, RimWorld is a modder-friendly platform actively supported by the game's creators.
 
So how hard is it to mod RimWorld? Overall, RimWorld is a modder-friendly platform actively supported by the game's creators.
Line 23: Line 23:
  
  
==So you want to...==
+
= So you want to... =
  
===... Add a new Thing to RimWorld===
+
== ... Add a new Thing to RimWorld ==
  
 
RimWorld uses XML to define the Things in RimWorld, in ThingDef XML entries. So, if you are going to create a new Thing, look in the Core XML files of RimWorld and duplicate a ThingDef entry for a similar item. Then, make the modifications to that entry to achieve your item. Remember, defName needs to be different for all entries.
 
RimWorld uses XML to define the Things in RimWorld, in ThingDef XML entries. So, if you are going to create a new Thing, look in the Core XML files of RimWorld and duplicate a ThingDef entry for a similar item. Then, make the modifications to that entry to achieve your item. Remember, defName needs to be different for all entries.
Line 39: Line 39:
  
  
===...Create new functionality===
+
== ...Create new functionality ==
  
 
The XML files are used to apply and adapt existing functionality in the code base in new ways, but for modders, many times this is not enough. If you need new functionality, you create that with C# code and apply it to your new Things with XML entries.
 
The XML files are used to apply and adapt existing functionality in the code base in new ways, but for modders, many times this is not enough. If you need new functionality, you create that with C# code and apply it to your new Things with XML entries.
Line 53: Line 53:
 
:: Or: Create a custom Comp inheriting from [[Modding Tutorials/ThingComp|ThingComp]] and CompProperties and add it to an existing ThingWithComps. In its XML entry, follow the Class="MyNameSpace.MyCompProperties" structure mentioned previously.
 
:: Or: Create a custom Comp inheriting from [[Modding Tutorials/ThingComp|ThingComp]] and CompProperties and add it to an existing ThingWithComps. In its XML entry, follow the Class="MyNameSpace.MyCompProperties" structure mentioned previously.
  
===...Alter RimWorld code===
+
== ...Alter RimWorld code ==
 
Sometimes, you need to change what existing code does. This can be done in both XML and C# code.
 
Sometimes, you need to change what existing code does. This can be done in both XML and C# code.
  
Line 63: Line 63:
 
: Harmony is the current best approach for enhancing existing RimWorld code by inserting code pre/post to an existing method being called. See [[Modding_Tutorials/Harmony|Harmony]].
 
: Harmony is the current best approach for enhancing existing RimWorld code by inserting code pre/post to an existing method being called. See [[Modding_Tutorials/Harmony|Harmony]].
  
==The true essence of modding==
+
=The true essence of modding=
 
Look, you think anyone of us knows all 200+ valid tags for a ThingDef like the back of their hand, and what every tag means? Or even half of the 3000+ classes in RimWorld, and what they do? Hell no. We all regularly (almost religiously) copy-paste things or re-invent the wheel. There's nothing wrong with that; you don't have to know RimWorld inside out to mod it.<!-- but knowing how it works sure helps when solving problems--> Learning how to mod is more about making the connection of "hey, RimWorld/SomeMod does this like X, can I do Y?" and searching/finding how it does it.
 
Look, you think anyone of us knows all 200+ valid tags for a ThingDef like the back of their hand, and what every tag means? Or even half of the 3000+ classes in RimWorld, and what they do? Hell no. We all regularly (almost religiously) copy-paste things or re-invent the wheel. There's nothing wrong with that; you don't have to know RimWorld inside out to mod it.<!-- but knowing how it works sure helps when solving problems--> Learning how to mod is more about making the connection of "hey, RimWorld/SomeMod does this like X, can I do Y?" and searching/finding how it does it.
  
 
And if you do want to know how RimWorld works inside out? Start modding, and you'll find out soon enough.
 
And if you do want to know how RimWorld works inside out? Start modding, and you'll find out soon enough.
 
 
[[Category:Modding tutorials]]
 

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)

Templates used on this page: