|
|
(54 intermediate revisions by 27 users not shown) |
Line 1: |
Line 1: |
− | {{See also|Mods}} | + | <!--Top Nav Box--> |
− | '''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.
| + | {| align=center |
| + | | {{Basics_Nav}} |
| + | |} |
| + | ---- |
| | | |
− | This page is about making mods. For info about using mods, see [[Installing mods]].
| + | '''Game modifications''' (or '''mods''') are a way of altering the way the game functions by adding, changing, or removing content such as items, textures, sounds, or more. RimWorld has built-in support for modding, including Steam Workshop support. |
| | | |
− | ==Mod-making tutorials== | + | == Using Mods == |
− | Mod-making tutorials are available at the [[Modding Tutorials]] page. If you can't find what you need, you should try looking in [[Modding/Random Bits of Information|Random Bits of Information]] to check if the information you're looking for has been found but just hasn't been organized into the correct article yet.
| |
| | | |
− | ==What you can mod==
| + | If you own RimWorld on Steam, then the easiest way of finding and downloading mods is by using [https://steamcommunity.com/app/294100/workshop/ Steam Workshop]. Steam Workshop automates the process of downloading and installing mods, as well as keeping them up to date with new releases. |
− | You can mod defs, code, images, and sounds.
| |
| | | |
− | * '''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.
| + | Even if you do not own RimWorld on Steam, Workshop can still be used to discover new mods; while some mods are released on [https://www.nexusmods.com/rimworld Nexus Mods], no other mod site has close to the same amount of mods available. You can use tools such as [https://github.com/rimpy-custom/RimPy/releases RimPy] and [https://github.com/RimSort/RimSort RimSort] to download and install mods from Steam Workshop and GitHub instead. |
− | * '''Code''': You can add .NET assemblies and the game will load them. Place your DLLs in YourModName/Defs. More about this later.
| |
− | * '''Images''': You can add images.
| |
− | * '''Sounds''': You can add sound files.
| |
| | | |
| + | === Manual Installation === |
| | | |
− | ==The basics: Defs==
| + | You can install mods manually by unzipping them into subfolders within your local Mods folder. This location varies by operating system: |
− | 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:
| + | {| class="wikitable" style="margin-right:auto" |
− | Sound
| + | |- |
− | Weapons
| + | ! Operating System !! Default Folder Location |
− | Buildings
| + | |- |
− | Plants
| + | | Windows || <code>C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods</code> |
− | Animals
| + | |- |
− | More (to be determined)
| + | | Mac || <code>Library/Application Support/Steam/steamapps/common/RimWorld</code> |
| + | |- |
| + | | Linux (standalone) || <code>~/.steam/steam/steamapps/common/RimWorld/Mods</code> |
| + | |- |
| + | | Linux (GoG) || <code>/home/<user>/GOG/Games/RimWorld/game/Mods/</code> |
| + | |} |
| | | |
− | When the game runs, it collects all the definitions into pools. It then semi-randomly draws from these pools in various circumstances. 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 means adding your definitions to these pools and watching the game use them in this way.
| + | === Activating Mods === |
| | | |
− | Definitions are organized into packages. Each package is saved as a single XML file.
| + | Once you have installed mods, you can select the '''Mods''' option from the main menu of RimWorld to activate them. Activating or deactivating mods requires RimWorld to restart. |
| | | |
− | Groups of packages are organized into mods. A mod is a unit of interlinked functionality and content. It could be a pack of new weapons, a new animal, or a total conversion of the game. A mod will usually contain several packages of various types, as well as content like images and sounds.
| + | == Making Mods == |
− | | |
− | The base game is defined in a single mod called Core.
| |
− | | |
− | Players can choose which mods to activate. In some cases, several mods can be 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, '''[[wikipedia:XML|XML]]''' files are used. Here is an example of the format, that applies to most of the definitions:
| |
− | <source lang="xml">
| |
− | <?xml version="1.0" encoding="utf-8" ?>
| |
− | <SomeDefs>
| |
− | <SomeDef>
| |
− | <defName>MyNewDefinitionOfContent</defName>
| |
− | <!-- more tags will appear depending on what are you defining -->
| |
− | </SomeDef>
| |
− | </SomeDefs>
| |
− | </source>
| |
− | 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:
| |
− | <pre>
| |
− | ┌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
| |
− | </pre>
| |
− | | |
− | ===Mod info===
| |
− | This is found in <code>MODNAME/About</code>
| |
− | *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 <code>MODNAME/Textures</code>
| |
− | *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: <code><TexturePath>Things/Building/RoyalBed</TexturePath></code>
| |
− | *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 <code>MODNAME/Defs/ThingDefs</code>
| |
− | 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: <code>MODNAME/Defs/RecipeDefs</code>
| |
− | 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: <code>MODNAME/Defs/ThingDefs</code>
| |
− | | |
− | ===Turrets===
| |
− | These are defined in two files in: <code>MODNAME/Defs/ThingDefs</code>
| |
− | 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:
| |
− | <source lang="xml" >
| |
− | <building>
| |
− | <turretGunDef>Gun_TurretImprovised</turretGunDef>
| |
− | <burstCooldownTicks>300</burstCooldownTicks>
| |
− | </building>
| |
− | </source>
| |
− | 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: <code>MODNAME/Defs/ThingDefs/Resources.xml</code>
| |
− | | |
− | ===Research projects===
| |
− | These are found in: <code>MODNAME/Defs/ResearchProjectDefs</code>
| |
− | | |
− | You can have research trees as well, where additional research projects get unlocked as you move through.
| |
− | This is how to add prerequisites:
| |
− | <source lang="xml" >
| |
− | <prerequisites>
| |
− | <li>-this is the <defName> of the prerequisite-</li>
| |
− | </prerequisites>
| |
− | </source>
| |
− | 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.)
| |
− | | |
− | == Megaskull100's Tutorials ==
| |
− | (I have been given permission by Tynan himself to edit this wiki)
| |
− | | |
− | | |
− | Making new races: | |
− | | |
− | <source lang="xml" >
| |
− | <!-- Don't edit this bit -->
| |
− | <?xml version="1.0" encoding="utf-8" ?>
| |
− | <ThingDefs>
| |
− | | |
− | | |
− | | |
− | <ThingDef Name="BasePawn" Abstract="True">
| |
− | <eType>Pawn </eType>
| |
− | <thingClass>Pawn</thingClass>
| |
− | <category>Pawn</category>
| |
− | <selectable>true</selectable>
| |
− | <tickerType>Normal</tickerType>
| |
− | <altitudeLayer>Pawn</altitudeLayer>
| |
− | <useStandardHealth>false</useStandardHealth>
| |
− | <flammability>1.0</flammability>
| |
− | <hasTooltip>true</hasTooltip>
| |
− | <soundBulletHit>BulletImpactFlesh</soundBulletHit>
| |
− | <inspectorTabs>
| |
− | <li>ITab_Pawn_Thoughts</li>
| |
− | <li>ITab_Pawn_Needs</li>
| |
− | <li>ITab_Pawn_Prisoner</li>
| |
− | <li>ITab_Pawn_Character</li>
| |
− | </inspectorTabs>
| |
− | <drawGUIOverlay>true</drawGUIOverlay>
| |
− | </ThingDef>
| |
− | <!-- Edit this bit -->
| |
− | <ThingDef ParentName="BaseAnimal">
| |
− | <defName>MyRace</defName>
| |
− | <label>My Race</label>
| |
− | <maxHealth>MyHealth</maxHealth>
| |
− | <overdraw>true</overdraw>
| |
− | <sunShadowInfo>
| |
− | <baseWidth>0.6</baseWidth>
| |
− | <baseHeight>0.6</baseHeight>
| |
− | <tallness>0.6</tallness>
| |
− | </sunShadowInfo>
| |
− | <targetHitChanceFactor>2.0</targetHitChanceFactor>
| |
− | <race>
| |
− | <thinkTree>HerbivoreHerd</thinkTree>
| |
− | <walkSpeed>1.5</walkSpeed>
| |
− | <meleeDamage>20</meleeDamage>
| |
− | <hungerThreshold>180</hungerThreshold>
| |
− | <bodySize>1.8</bodySize>
| |
− | <diet>Herbivorous</diet>
| |
− | <wildBiomes>
| |
− | <li>XericShrubland</li>
| |
− | </wildBiomes>
| |
− | <soundWounded>Pawn_Squirrel_Wounded</soundWounded>
| |
− | <soundDeath>Pawn_Squirrel_Death</soundDeath>
| |
− | <soundMeleeHitPawn>Pawn_Melee_SmallScratch_HitPawn</soundMeleeHitPawn>
| |
− | <soundMeleeHitBuilding>Pawn_Melee_SmallScratch_HitBuilding</soundMeleeHitBuilding>
| |
− | <soundMeleeMiss>Pawn_Melee_SmallScratch_Miss</soundMeleeMiss>
| |
− | </race>
| |
− | </ThingDef>
| |
− | </ThingDefs>
| |
− | | |
− | </source>
| |
− | Although you can change the numbers and <diet>, they don't really affect the appearance of pawns with <race>MyRace</race>.
| |
− | You will need to change MyRace and MyHealth to what you want for your race (e.g. MyRace can be changed to Ludeon and then the race will be called Ludeon).
| |
− | The MyHealth will need to be a number not text.
| |
− | The diet can be changed to NeverEats or Omnivorous, but Omnivorous only really works for Humanoids.
| |
− | Where it says <thinkTree>, that is how it thinks, can be changed to Humanoid (not suggested) or Mechanoid (makes it hostile if it has a weapon).
| |
− | Save it as Mods/(Your Mod)/Defs/ThingDefs/Races_Various.xml
| |
− | | |
− | Making pawns:
| |
− | <source lang="xml" >
| |
− | <?xml version="1.0" encoding="utf-8" ?>
| |
− | <PawnKindDefs>
| |
− | | |
− | <PawnKindDef>
| |
− | <defName>MyPawn</defName>
| |
− | <label>My Pawn</label>
| |
− | <race>MyRace</race>
| |
− | <pointsCost>15</pointsCost>
| |
− | <standardBodyGraphicPath>Things/(Texture Path)</standardBodyGraphicPath>
| |
− | <wildSpawn_spawnWild>CanSpawnWild</wildSpawn_spawnWild>
| |
− | <wildSpawn_EcoSystemWeight>1</wildSpawn_EcoSystemWeight>
| |
− | <wildSpawn_GroupSizeRange>
| |
− | <min>MinSpawn</min>
| |
− | <max>MaxSpawn</max>
| |
− | </wildSpawn_GroupSizeRange>
| |
− | <wildSpawn_SelectionWeight>0.5</wildSpawn_SelectionWeight>
| |
− | </PawnKindDef>
| |
− | </PawnKindDefs>
| |
− | </source>
| |
− | With this one we change CanSpawnWild (where it says <wildSpawn_spawnWild>) into true or false (this is called a Boolean value).
| |
− | MinSpawn and MaxSpawn are changed to a number.
| |
− | MyRace is exactly the same as the MyRace in "Making new races:".
| |
− | MyPawn is changed to the name of your pawn in the game when your mouse is over the pawn.
| |
− | | |
− | When your mouse is over the pawn a box will come up, it will say "My Race (Male/Female My Pawn), but of course My Race and My Pawn will be replaced with what you typed.
| |
− | | |
− | | |
− | ==The other stuff: Code, Graphics, Sound==
| |
− | | |
− | 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.
| |
− | | |
− | == References ==
| |
− | *[http://ludeon.com/forums/index.php?topic=1681.0 Simple tutorial forum thread]
| |
− | *[http://rimworldgame.com/publicArtSource/ThingGraphics.zip RimWorld core art source]
| |
| | | |
| + | Please check out the [[Modding_Tutorials|Modding Tutorials]] hub for tutorials and guides on how to create and publish your own mods. |
| | | |
| [[Category:Modding]] | | [[Category:Modding]] |