- Let’s Cook – A Breaking Bad Scenario. Check Out This Mod. If you’re a fan of Breaking Bad, this is.
- AdvancedEverything 0.0.1 My collection of improvements. Will direct more and more into the future-tech-stuff. Current Feature(s): img/img - Sunlamp Advanced - Big 3x3 Building - Cost: 150 Metal, 300 Silver - Power: 3400 on heat up, 1700.
- An alternative storage for game mods. STAR WARS™ Empire at War: Gold Pack.
|
Mar 25, 2021 Re: Rimworld MarsX: Mars Colony (total conversion mod) « Reply #10 on: March 25, 2021, 10:52:25 am » Yeah I got the 12 hour clock too, didn't actually notice that but it did make doing the work orders confusing at first since they are still in 24 hour format.
Mods (short for modifications) 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. RimWorld mods may make use of XML and C#.
This page is about making mods. For info about using mods, see Installing mods.
- 1Mod-making tutorials
- 4Mod file structure
Mod-making tutorials
Mod-making tutorials are available at the Modding Tutorials page. If you can't find what you need, you should try looking in the forums help section on modding to check if the information you're looking for has been asked previously, before starting your own thread.
Mod-making Templates
What you can mod
RimWorld does not limit what you can or can't do. The only limit is skills and motivation, or patience and willpower. You can mod everything, from defs, to code, images, and sounds. Some examples:
- Defs: XML files containing lists of definitions for use by the game. There are a lot of these. They define every thing, skills, storyteller, and many other types of data. Find them in YourModName/Defs. More about this later.
- Code: You can add .NET assemblies and the game will load them. Place your DLLs in YourModName/Assemblies. There is no API for RimWorld modding, you can make full use of RimWorld's functions. You also have the full power of the .NET Framework 3.5 available. More about this later.
- Images: You can add images.
- Sounds: You can add sound files.
- Patches: Using xpath, you can edit Defs with pinpoint precision to change only the values you need to change while staying as compatible as possible with other mods.
- Jobs: A useful link here https://github.com/Mehni/ExampleJob/wiki - covers JobGivers WorkGivers and Toils
- Higher level, explanation on how pawns think: https://github.com/roxxploxx/RimWorldModGuide/wiki/SHORTTUTORIAL%3A-How-Pawns-Think
The basics: Defs
The most basic kind of RimWorld modding is done by editing Defs.
Definitions each define some piece of the game. Different kinds of definitions can define:
- Weapons
- Buildings
- Plants
- Animals
- Sound
- Research
- Biomes
- Much much more
When the game runs, it collects all the definitions into a database. It then draws from these pools in when appropriate. It will randomly draw guns of a certain category to arm a new enemy mercenary. Or, it will randomly spawn an animal type on the edge of the map. Modding the game with Defs means adding your definitions to these pools and watching the game use them.
A mod could be a pack of new weapons, a new animal, or a total conversion of the game. A mod will usually contain several Defs of various types, as well as content like images and sounds.
The base game is defined in a single mod called Core.
Players can choose which mods to activate. Most players often have several mods active at once. You could use a medieval mod to replace the core mod, and add on a weapons pack created by someone else. The game will run with the medieval mod content, and also randomly spawn in weapons from the extra weapons pack.
Mod file structure
For defining new game content, XML files are used. Here is an example of the format, that applies to most of the definitions:
All rootnodes for Defs start with <Defs>. 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. Root folders have to follow the naming pattern (About, Assemblies, Defs, Sounds, Patches, Textures, Languages) for them to be read by RimWorld. Apart from the Languages Folder, subfolders can have any structure. For the sake of organisation, it is recommended to keep things categorised:
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 size to 1 MB.
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 <graphicPath>, have the complete path relative to your mod, including the filename (but not the file extension). Example for the RoyalBed Testmod:
<graphicPath>Things/Building/RoyalBed</graphicPath>
For textures that have multiple faces, like animals and furniture which can be rotated; You can use the Graphic_Multi class. Immediately following your <graphicPath></graphicPath>. Your Path should point to the folder containing the different textures: Texturename_east (for both east- and west-facing), Texturename_south (front-facing), and Texturename_north (back-facing).
Inside your folder:
Rimworld Mods Steam
For plant textures that have multiple growth stages and/or utilize the Graphic_Random class, the different images for each stage must be in separate folders. These images within must also share the same filenames. For example, the corn plant has one immature form, and two different mature forms that appear at random once the plant is fully grown. Similarly to Graphic_Multi, when using the Graphic_Random class, you will always want to reference the folder containing the images rather than the images themselves. It should be noted that only harvestable plants are able to display an immature image.
An example of how retexturing a plant could work:
Your folder structure:
Even though there is only one image used for the immature corn plant, we must have two copies of it with the same filenames as the mature plant images in order to prevent broken textures in-game.If you wanted to add a leafless variant to a plant (such as the leafless trees in winter), another folder would be added.
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. Note that new workbenches also need a WorkGiver tied to them, otherwise pawns will ignore your new bench.
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:
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:
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.)
- Code injection is generally a bad thing since it leads to mod conflicts. This was a previous practice of altering runtime code but is out of vogue as of ~A17. Use Harmony instead.
I want to make a mod that can...
Or, how do I make my mod do this?
You can find links to tutorials on the Modding Tutorials page. There's also more tutorials about the basics there, so don't miss out on that.
- Save/Load information. See a very useful guide at this page
- For saving settings for your mod, either use a class that extends ModSettings or use HugsLib.
- For saving per-world data, make a Game Component and override ExposeData
- Add a new value to a def
- See ThingComp
- Also helpful: DefModExtensions
References
Notes
See Full List On Rimworldwiki.com
- You can have as many mods as you like, however too many mods may affect performance.
- If the game crashes due to a mod-related reason on startup, or mods conflict with each other, then the game will reset the mods.
- Mods for previous versions may be usable, however most of the time they are not compatible.