Difference between revisions of "Modding"

From RimWorld Wiki
Jump to navigation Jump to search
(More copy editing)
(Focus on mod making. Link modding tutorials.)
Line 1: Line 1:
 
'''Mods''' (short for modification) are small packages that add to or otherwise affect gameplay in RimWorld. They include art packs (for reskinning the game), more weapons, more incidents, furniture, and game-balancing mods.
 
'''Mods''' (short for modification) are small packages that add to or otherwise affect gameplay in RimWorld. They include art packs (for reskinning the game), more weapons, more incidents, furniture, and game-balancing mods.
  
==Storage==
+
This page is about making mods. For info about using mods, see [[Installing mods]].
[[File:Folders-OS-Windows-8-Metro-icon.png|36px|link=]] [[File:Folders-OS-Linux-Metro-icon.png|36px|link=]] [[File:Folders-OS-Apple-Metro-icon.png|36px|link=]]
 
Mods are stored in:
 
<code>RimWorld/Mods</code>
 
  
==Getting started==
+
==Mod-making tutorials==
===Installation===
+
Mod-making tutorials are available at the [[Modding Tutorials]] page.
Finding and installing mods which is short for modification to RimWorld is a very easy task to do if you want to add some new content to your game. First, you need to look online and find a mod that you want to try out. Remember, the main source for finding mods is the [http://ludeon.com/forums/index.php?board=15.0 forum] in the mod release section. Once you find a mod you like that is '''compatible''' with the version of RimWorld you have, or even a few mods you like you can download them from their individual threads. Once you have downloaded them and opened up your zip files you just got, it's just a simple case of drag and dropping the extracted zip files into your RimWorld mods folder, starting up your game, and activating the mods. However, be aware that many mods require you to start a new game before the new content is available.
 
  
===Editing mods folder===
+
Contributions are appreciated and will help new modders like you.
When editing your mods folder, you should '''always''' make a backup somewhere (such as your desktop) in case you come across errors. This way, you will always be able to undo a mistake that may occur. It is also very important to never delete the ThingCategories.xml file in your mod pack; doing this will result in a black screen when trying to start the game up.
 
  
===Compatibility===
 
Not all mods work with each other. You will know if you have incompatible mods if you are having serious gameplay issues, such as unplaceable items, graphical issues, colonists getting stuck, etc.
 
  
 
==Mod structure==
 
==Mod structure==
Line 113: Line 106:
 
*The tilde key (` or ~) brings up the development console, which will report any errors or warnings it encounters when a mod loads or during gameplay. This is the quickest way to see what, if any, errors exist in your mod. (You don't need to turn on development mode for this.)
 
*The tilde key (` or ~) brings up the development console, which will report any errors or warnings it encounters when a mod loads or during gameplay. This is the quickest way to see what, if any, errors exist in your mod. (You don't need to turn on development mode for this.)
 
*Use development mode (found in the options menu) to help debug your mod, spawn items related to your mod, or fire incidents at will. (Or just mess around, if you'd like.)
 
*Use development mode (found in the options menu) to help debug your mod, spawn items related to your mod, or fire incidents at will. (Or just mess around, if you'd like.)
 
==Further reading==
 
Tutorials are available [[Modding Tutorials|here]]. Contribution is appreciated and will help new players like you in their learning experience.
 
  
 
== References ==
 
== References ==

Revision as of 05:32, 30 April 2014

Mods (short for modification) are small packages that add to or otherwise affect gameplay in RimWorld. They include art packs (for reskinning the game), more weapons, more incidents, furniture, and game-balancing mods.

This page is about making mods. For info about using mods, see Installing mods.

Mod-making tutorials

Mod-making tutorials are available at the Modding Tutorials page.

Contributions are appreciated and will help new modders like you.


Mod structure

Format of files

For defining new game content, XML files are used. Here is an example of the format, that applies to most of the definitions:

<?xml version="1.0" encoding="utf-8" ?>
<SomeDefs>
   <SomeDef>
      <defName>MyNewDefinitionOfContent</defName>
      <!-- more tags will appear depending on what are you defining -->
   </SomeDef>
</SomeDefs>

Remember, that the word Some must be replaced by the name of whatever are you defining. For thing it's <ThingDef>.

The RimWorld mods use the following directory structure:

┌About 
├╴About.xml (Contains info about the mod)
├╴Preview.png (Image that appears above the mod info in game. Max width 600px.)
│
├Assemblies (If your mod uses any DLL files put them here)
├╴MyMod.dll
│
├Defs (Contains xml definitions of the mod)
├┬ThingDefs
│├╴Things.xml
│└╴Buildings.xml
├┬ResearchProjectDefs
│└╴MyProjects.xml
│the folder name must be specific here. Look in Core mod to see what are other names supposed to be
│
├Sounds
│
├Source
├╴MyMod.cs (Optionally, put the source code of your mod here)
│
├Strings
│
├Textures (Put any image textures here, preferably in .png format.)
└┬Things
 ├╴MyMod_ImageA.png
 └╴MyMod_ImageB.png

Mod info

This is found in MODNAME/About

  • The contents of About.xml are plain text. HTML Markup tags cause NullRef's.
  • You can have an image for your mod. Restrict the image width to 600 pixels

Textures

These are found in MODNAME/Textures

  • You can have any path you want from this point on.
  • When referencing textures in your mod, using <TexturePath>, have the complete path relative to your mod, including the filename (but not the file extension). Example for the RoyalBed Testmod: <TexturePath>Things/Building/RoyalBed</TexturePath>
  • You can randomize textures within a folder using a <textureFolderPath> pointing at a folder with multiple textures inside. Each Thing of the given def will have a random texture from the folder.

Interactive "things"

A thing is anything that exists in the game world. It includes resources, races (humanoid and animal), buildings, furniture, and many others.

These are defined in MODNAME/Defs/ThingDefs If you make a new workbench, you'll need to define a recipe for it. This is a list, so you can have many new recipes listed.

The recipes themselves are defined in: MODNAME/Defs/RecipeDefs In here you can define what ingredients/resources are required, what can be used, and what the default recipe is.

Any new resources will need to be defined in: MODNAME/Defs/ThingDefs

Turrets

These are defined in two files in: MODNAME/Defs/ThingDefs Buildings_Big.xml and Weapons_Guns.xml (Remember, these can be named anything)

Buildings_Big.xml defines the structure of the turret itself. For example:

<building>
	<turretGunDef>Gun_TurretImprovised</turretGunDef>
	<burstCooldownTicks>300</burstCooldownTicks>
</building>

Weapons_Gun.xml defines the weapon the turret uses. Anything can be used as a weapon for turrets, including grenades.

Resources

These are defined in: MODNAME/Defs/ThingDefs/Resources.xml

Research projects

These are found in: MODNAME/Defs/ResearchProjectDefs

You can have research trees as well, where additional research projects get unlocked as you move through. This is how to add prerequisites:

<prerequisites>
	<li>-this is the <defName> of the prerequisite-</li>
</prerequisites>

Because it's a list, you can have multiple prerequisites for a research project.

Advice

  • The tilde key (` or ~) brings up the development console, which will report any errors or warnings it encounters when a mod loads or during gameplay. This is the quickest way to see what, if any, errors exist in your mod. (You don't need to turn on development mode for this.)
  • Use development mode (found in the options menu) to help debug your mod, spawn items related to your mod, or fire incidents at will. (Or just mess around, if you'd like.)

References