Difference between revisions of "Modding"

From RimWorld Wiki
Jump to navigation Jump to search
m (Pipe trick didn't work)
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.
+
'''Моды''' (сокращённо от модификации) это маленькие пакеты, что добавляют или изменяют геймплей в RimWorld. Они включают: визуальное изменение, дополнительное оружие, дополнительные инциденты, мебель, и изменение баланса игры.
  
This page is about making mods. For info about using mods, see [[Installing mods]].
+
Эта страница о том, как сделать моды. Для информации о том, как пользоваться модами, смотри [[Installing mods]].
  
==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 [[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.
+
Учебники по созданию модификаций доступны на странице [[Modding Tutorials]]. Если Вы не можете найти то, что Вам нужно, попробуйте посмотреть в [[Modding/Random Bits of Information|Random Bits of Information]] чтобы проверить, если информация, которую Вы ищете была найдена, но просто еще не была организована в правильной статье.
  
==What you can mod==
+
==Что Вы можете модифицировать==
You can mod defs, code, images, and sounds.
+
Вы можете модифицировать def-ы, код, изображения, и звуки.
  
* '''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.
+
* '''Def-ы''': XML файлы, содержащие списки определений для использования в игре. Есть много всего. Они определяют всё, навыки, рассказчиков, и многие другие типы данных. Найти их можно в YourModName/Defs. Подробнее об этом ниже.
* '''Code''': You can add .NET assemblies and the game will load them. Place your DLLs in YourModName/Defs. More about this later.
+
* '''Код''': Вы можете добавить .NET assemblies и игра загрузит их. Поместите свои DLL-ы в YourModName/Defs. Подробнее об этом ниже.
* '''Images''': You can add images.
+
* '''Изображения''': Вы можете добавлять изображения.
* '''Sounds''': You can add sound files.
+
* '''Звуки''': Вы можете добавлять звуковые файлы.
  
  
==The basics: Defs==
+
==Основы: Def-ы==
The most basic kind of RimWorld modding is done by editing '''defs'''.
+
Самый основной вид RimWorld моддинга производится путем редактирования '''def-ов'''.
  
Definitions each define some piece of the game. Different kinds of definitions can define:
+
Определения, каждое определение - часть игры. Различные виды определений можно разделить на:
Sound
+
Звуки
Weapons
+
Оружие
Buildings
+
Строения
Plants
+
Растения
Animals
+
Животные
More (to be determined)
+
Что-либо ещё (что будет определено)
  
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.
+
Когда игра запускается, она собирает все определения в пулы. Потом полу-случайно берёт из них (из этих пулов) при различных обстоятельствах. Это будет случайным образом вооружать определённым оружием нового вражеского наёмника. Или случайно создавать животного на краю карты. Моддинг игры означает добавление Ваших определений для этих пулов и наблюдая за игрой использовать их таким образом.
  
Definitions are organized into packages. Each package is saved as a single XML file.
+
Определения организованы в пакеты. Каждый пакет сохраняется в виде отдельного XML-файла.
  
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.
+
Группы пакетов организованы в моды. Мод это единица взаимосвязанной функциональности и содержания. Это может быть пакет новых видов оружия, новое животное, или в общей сложности преобразоване игры. Моды, как правило, содержат несколько пакетов различных типов, а также наполнение, например, изображеня и звуки.
  
The base game is defined in a single mod called Core.
+
Базовая игра определяется в одном моде под названием 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==
 
==Mod file structure==

Revision as of 07:45, 8 June 2014

Моды (сокращённо от модификации) это маленькие пакеты, что добавляют или изменяют геймплей в RimWorld. Они включают: визуальное изменение, дополнительное оружие, дополнительные инциденты, мебель, и изменение баланса игры.

Эта страница о том, как сделать моды. Для информации о том, как пользоваться модами, смотри Installing mods.

Учебники по созданию модификаций

Учебники по созданию модификаций доступны на странице Modding Tutorials. Если Вы не можете найти то, что Вам нужно, попробуйте посмотреть в Random Bits of Information чтобы проверить, если информация, которую Вы ищете была найдена, но просто еще не была организована в правильной статье.

Что Вы можете модифицировать

Вы можете модифицировать def-ы, код, изображения, и звуки.

  • Def-ы: XML файлы, содержащие списки определений для использования в игре. Есть много всего. Они определяют всё, навыки, рассказчиков, и многие другие типы данных. Найти их можно в YourModName/Defs. Подробнее об этом ниже.
  • Код: Вы можете добавить .NET assemblies и игра загрузит их. Поместите свои DLL-ы в YourModName/Defs. Подробнее об этом ниже.
  • Изображения: Вы можете добавлять изображения.
  • Звуки: Вы можете добавлять звуковые файлы.


Основы: Def-ы

Самый основной вид RimWorld моддинга производится путем редактирования def-ов.

Определения, каждое определение - часть игры. Различные виды определений можно разделить на: Звуки Оружие Строения Растения Животные Что-либо ещё (что будет определено)

Когда игра запускается, она собирает все определения в пулы. Потом полу-случайно берёт из них (из этих пулов) при различных обстоятельствах. Это будет случайным образом вооружать определённым оружием нового вражеского наёмника. Или случайно создавать животного на краю карты. Моддинг игры означает добавление Ваших определений для этих пулов и наблюдая за игрой использовать их таким образом.

Определения организованы в пакеты. Каждый пакет сохраняется в виде отдельного XML-файла.

Группы пакетов организованы в моды. Мод это единица взаимосвязанной функциональности и содержания. Это может быть пакет новых видов оружия, новое животное, или в общей сложности преобразоване игры. Моды, как правило, содержат несколько пакетов различных типов, а также наполнение, например, изображеня и звуки.

Базовая игра определяется в одном моде под названием Core.

Игроки могут выбрать, какие из модов им активировать. В некоторых случаях, несколько модов могут быть активны одновременно. Вы можете использовать средневековый мод для замены основы игры, и добавить пачку оружия, созданного кем-то другим. Игра будет работать с содержанием средневекового мода, а также случайным образом появится оружие из пакета дополнительных вооружений.

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:

<?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