Modding: различия между версиями

Материал из Dwarf Fortress Wiki
Перейти к навигацииПерейти к поиску
Строка 113: Строка 113:
  [CULL_SYMBOL:ALL:UGLY]
  [CULL_SYMBOL:ALL:UGLY]
  [CULL_SYMBOL:ALL:NEGATOR]
  [CULL_SYMBOL:ALL:NEGATOR]
{{заготовка}}
This section deals with everything else. The things that haven't already been dealt with (hence the "REMAINING") - such as site names, kingdom names, the names of individuals, and such - will have names from the ARTIFICE and EARTH symbol groups. After that the dwarf entity is told to cull all innapropriate symbols - this applies to everything (hence the "ALL") so if the game happens to choose a symbol associated with, say, EVIL for one of the battles, it'll scrap that name and try again. This sort of thing adds a lot of flavour to DF's entities and can account for a lot of a civ's percieved personality.


Another basic thing to note: any entity token that's dealing with weapons, armor, clothing, etc., will state the items that the civ can build natively, not necessarily the ones they can wear or use. For example, you could create a species with no clothes specified, but then rob a clothes shop in adventurer mode and wear everything you want, or give them weapons that are too large to wield and they could sell them, but not use them.  
В этой секции описывается всё остальное. То, что ещё не было рассмотрено (обозначено как "REMAINING") - топонимы, названия государств, личные имена и т.п. - будут иметь имена из групп "ARTIFICE" и "EARTH". После этого сказано, чтобы цивилизация дварфов не использовала неподходящих имён - это применяется ко всему (здесь "ALL"), так что если игра попытается выбрать название, связанное, к примеру, с EVIL для какой-нибудь битвы, она отбросит это имя и попробует заново. Таким образом цивилизации в DF становятся более интересными и разнообразными на вид.


An easy method of creating a civilization is just to copy-paste a similar one to the bottom of the entity_default.txt file and edit things to your liking. Remember to always change the civ's "ENTITY:" identifier! This can be anything so long as it's not already existing.
Ещё один основной момент: любой токен цивилизации, описывающий оружие, броню, одежду и т.д., будет обозначать вещи, которые цивилизация может производить, но не обязательно носить или использовать. Например, можно создать расу существ, не прописав ей никакой одежды, а потом ограбить магазин в режиме приключенца и носить всё что угодно, или дать им оружие, слишком большое, чтобы они могли им сражаться - и они смогут его продавать, но не смогут использовать.  


At the end of some of the default entries you'll find a list of positions, both ones that'll directly affect you in fort mode (such as nobles) and ones that'll primarily affect worldgen and adventure mode. A list of the tokens applicable to positions can be found [[position token|here]]; they don't require a great deal of explaination.
Простой способ создать цивилизацию - просто скопировать похожую из нижней части файла entity_default.txt и изменить её на свой вкус. Не забывайте менять идентификатор "ENTITY:"! Туда можно написать что угодно, если такой цивилизации ещё не существует.
 
После стандартных записей вы найдёте список должностей, как тех, которые прямо затронут вас в режиме крепости (например, дворяне), так и тех, которые в первую очередь влияют на генерацию мира и режим приключенца. Список токенов, отвечающих за должности, можно найти [[position token|здесь]]; они не требуют особых разъяснений.


== Создание существ ==
== Создание существ ==

Версия от 06:50, 28 мая 2014


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

Не бойтесь ничего испортить — ни один элемент, поддающийся изменению не повлияет на исходный код DF, к тому же нововведения можно легко убрать.

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

Смотри также: Category:Моддинг

Руководство по моддингу

Справочная информация по токенам

Не будет лишним упомянуть о собранной информации по токенам в этой вики. Даже опытным мододелам приходится искать токены. Список статей о токенах можно найти здесь.

Основы моддинга DF

Весь базовый материал, доступный для изменения, можно найти в папке \raw\. Эта папка содержит ещё две: "graphics" (куда вы можете загружать тайлсеты) и "objects", которая содержит информацию обо всем в мире ДФ, что не было записано в исходном коде (случайно генерируемые существа, к примеру).

В папке \raw\objects находится множество текстовых файлов — так называемые raw-файлы. Редактировать их очень просто. Также вы можете создать свой собственный, если хотите. Теперь взгляните на один из существующих. Выглядят они следующим образом:

creature_standard

[OBJECT:CREATURE]

[CREATURE:DWARF]
    [DESCRIPTION:A short, sturdy creature fond of drink and industry.]
    [NAME:dwarf:dwarves:dwarven]
    [CASTE_NAME:dwarf:dwarves:dwarven]
    [CREATURE_TILE:1][COLOR:3:0:0]
    [CREATURE_SOLDIER_TILE:2]
...

Как видите, каждый файл состоит из заглавной строки, повторяющей название файла, второй строки, указывающей к какому типу объектов относится информация, которую он содержит, а также собственно информации. Это необходимые элементы файла, без них игра не сможет корректно его прочесть. Вы, возможно, заметили схему наименования файлов — это тоже важно: названия файлов, содержащих существ начинаются с "creature_", файлы, содержащие цивилизации должны начинаться с "entity_", и так далее...

Под заголовками находится список объектов. Каждый объект состоит из собственного заголовка (в нашем случае это "[CREATURE:DWARF]"), опять же обозначающий тип объекта, а также уникальный идентификатор объекта — если идентификатор не будет уникальным, игра все перемешает и будет выдавать серьёзные ошибки. Под этим мы имеем тело объекта, которое определяет его характеристики.

Тело объекта состоит из так называемых "токенов", которые можно добавить или удалить, что повлияет на атрибуты объекта. Большинство эффектов закодированы: к примеру, с помощью токена [CARNIVOUROUS] можно заставить существо есть только мясо, но невозможно создать свою уникальную диету для каждого существа.

Перед тем, как продолжить, запомните несколько ключевых моментов при внесении изменений в raw-файлы:

  • Старайтесь избегать модифицирования уже существующих файлов, когда добавляете новые объекты. Создавайте для этого новые файлы. Так будет проще удалять моды.
  • При добавлении файлов всё, что вам нужно, - убедиться в правильности используемых ссылок с идентификатором токенов. Игра подгрузит все файлы *.txt в папке raw и исследует их на наличие токенов. Например, вы можете добавить новую пару кожаных ботинок и вам даже не придётся добавлять их в файл item_shoes.txt, лучше создайте собственный файл, скажем, item_shoes_new.txt? и убедитесь в наличии токена, включённого в список например как [ITEM_SHOES:ITEM_SHOES_BOOTS_NEW] и по которому игра будет искать этот предмет.
  • Если вы хотите изменить уже созданное существо, всегда создавайте резервную копию редактируемого файла в отдельной папке. Начиная с версии 0.31.22 игра больше не загружает бэкапы, но дублирование записей всё равно очень плохо.
  • При генерации нового мира все файлы копируются из папки \raw\ в папку save\созданный_мир. Если вы хотите изменить что-либо в игре, которая уже идёт, нужно менять равки в папках мира, а не только в DF\raw\objects.
  • Ничто вам не мешает просто скопировать существующее животное/цивилизацию/что-либо ещё, изменить идентификатор и модифицировать его во что-нибудь другое. Это поможет Вам сохранить уйму времени, особенно когда дело касается цивилизаций... о которых мы поговорим дальше.

Изменение цивилизаций (entities)

Entities — объекты, которые определяют, как ведут себя различные цивилизации — находятся в entity_default.txt. Они составлены в таком же формате, как и другие raw-файлы:

entity_default

[OBJECT:ENTITY]

[ENTITY:ENTITYNAME]
    [CREATURE:CREATURETYPE]
    [TRANSLATION:LANGUAGETYPE]
    [BIOME_SUPPORT:BIOMETOKEN:FREQENCY]
    ...[OTHER TAGS]...

В большинстве случаев, результат не зависит от порядка расположения токенов, главное, чтобы они были расположены под "ENTITY:" идентификатором, но есть и важные исключения, особенно связанные с существами.

"[CREATURE:]" связывает цивилизацию с указанным типом существ. Эти существа как раз и будут составлять население цивилизации, а также этими существами вы будете играть в режиме крепости и приключенца, если цивилизация доступна для игрока. Приведём простой пример: если вы поменяете "CREATURE:DWARF" в равке entity_default.txt на "CREATURE:ELF", то вместо дварфов в режиме крепости вы будете иметь эльфов, однако использующих дварфийские технологии, имена и язык.

О, перед тем, как у вас появятся весёлые идеи — РЕАЛЬНО заселить в цивилизацию существ разного типа, но осуществляется это не добавлением ещё одного токена "CREATURE:КТО-ТО": позже, когда мы будем говорить о кастах, вы узнаете об этом.

"[TRANSLATION:]" определяет файл с языком, который будут использовать существа. Это не устанавливает, какие слова они используют для наименования вещей, только способ их написания. Стандартные файлы языков — HUMAN, DWARF, ELF, и GOBLIN.

"[BIOME_SUPPORT:]" определяет биомы, в которых цивилизация может возникнуть и развиваться. "FREQUENCY" определяет насколько усердно они будут заселять этот биом, но также учитывается важный момент: большинство из этих значений устанавливаются относительно друг друга. То есть, следующая запись:

[BIOME_SUPPORT:ANY_FOREST:1]
[BIOME_SUPPORT:SAVANNA:2]

будет подобна по эффекту такой:

[BIOME_SUPPORT:ANY_FOREST:5]
[BIOME_SUPPORT:SAVANNA:10]

Это относится ко многим значениям во всех файлах, за исключением, когда оно просто не имеет смысла, например, в материалах.

Вы можете найти много информации про остальные токены цивилизации здесь. Помимо упомянутых, существуют ещё несколько основных токенов: CIV_CONTROLLABLE позволяет управлять цивилизацией в режиме крепости, INDIV_CONTROLLABLE позволяет вам играть в режиме приключений за изгоя от данной цивилизации, а токен ADVENTURE_TIER позволяет играть в режиме приключений за родную цивилизацию (не изгоем). Другие токены, на которые вам стоит обратить внимание, - это START_BIOME и относящиеся к местам, но в целом, вы можете просто просмотреть вышеупомянутый список и добавить или удалить что пожелаете.

Если у вас более одной цивилизации с токеном CIV_CONTROLLABLE, все доступные цивилизации из этой категории появятся в разделе выбора местности на экране подготовки к высадке. Может быть не очевидным какие именно биологические виды входят в каждую цивилизацию: как это можно определить из режима легенд, основной вид «соседей» на экране высадки всегда совпадает с выбранным видом; если у вас группа дварфов, дварфы станут доминирующим видом, в то время как, скажем, эльфы будут основным видом, если вами выбрана группа эльфов. По умолчанию, игра, по-видимому, выбирает цивилизацию (и, следовательно, вид, если их более одного) случайным образом.

Вы можете также попытаться распознать цивилизацию по названиям, которые она использует - это область «обозначений», совокупностей слов, сосредоточенных вокруг определенной концепции. Эта цивилизация будет использовать слова, включающие любые применимые к ней обозначения для различных вещей. Эта связь сначала может немного сбивать с толку, так что рассмотрим её подробнее. Давайте обратимся к логическому объекту DWARF:

[SELECT_SYMBOL:WAR:NAME_WAR]
[SUBSELECT_SYMBOL:WAR:VIOLENT]
[SELECT_SYMBOL:BATTLE:NAME_BATTLE]
[SUBSELECT_SYMBOL:BATTLE:VIOLENT]
[SELECT_SYMBOL:SIEGE:NAME_SIEGE]
[SUBSELECT_SYMBOL:SIEGE:VIOLENT]

Здесь мы видим, что у дварфов обычно сперва идёт название их войн после слов группы обозначений "NAME_WAR", а затем после слов группы обозначений "VIOLENT". Результатом может стать, например, название "The War of Carnage". Эти обозначения, используемые для других типов конфликта, выстраиваются аналогичным образом. Очевидно, можно заменить привязки к VIOLENT, скажем, на PEACE и в конечном итоге получить битву под названием "The Clash of Calm" или что-то подобное.

[SELECT_SYMBOL:ROAD:NAME_ROAD]
[SELECT_SYMBOL:TUNNEL:NAME_TUNNEL]
[SELECT_SYMBOL:BRIDGE:NAME_BRIDGE]
[SELECT_SYMBOL:WALL:NAME_WALL]

Вышесказанное применимо и здесь. Дварфы любят добавлять названия дорог и туннелей после дорог и туннелей.

[SELECT_SYMBOL:REMAINING:ARTIFICE]
[SELECT_SYMBOL:REMAINING:EARTH]
[CULL_SYMBOL:ALL:DOMESTIC]
[CULL_SYMBOL:ALL:SUBORDINATE]
[CULL_SYMBOL:ALL:EVIL]
[CULL_SYMBOL:ALL:UNTOWARD]
[CULL_SYMBOL:ALL:FLOWERY]
[CULL_SYMBOL:ALL:NEGATIVE]
[CULL_SYMBOL:ALL:UGLY]
[CULL_SYMBOL:ALL:NEGATOR]

В этой секции описывается всё остальное. То, что ещё не было рассмотрено (обозначено как "REMAINING") - топонимы, названия государств, личные имена и т.п. - будут иметь имена из групп "ARTIFICE" и "EARTH". После этого сказано, чтобы цивилизация дварфов не использовала неподходящих имён - это применяется ко всему (здесь "ALL"), так что если игра попытается выбрать название, связанное, к примеру, с EVIL для какой-нибудь битвы, она отбросит это имя и попробует заново. Таким образом цивилизации в DF становятся более интересными и разнообразными на вид.

Ещё один основной момент: любой токен цивилизации, описывающий оружие, броню, одежду и т.д., будет обозначать вещи, которые цивилизация может производить, но не обязательно носить или использовать. Например, можно создать расу существ, не прописав ей никакой одежды, а потом ограбить магазин в режиме приключенца и носить всё что угодно, или дать им оружие, слишком большое, чтобы они могли им сражаться - и они смогут его продавать, но не смогут использовать.

Простой способ создать цивилизацию - просто скопировать похожую из нижней части файла entity_default.txt и изменить её на свой вкус. Не забывайте менять идентификатор "ENTITY:"! Туда можно написать что угодно, если такой цивилизации ещё не существует.

После стандартных записей вы найдёте список должностей, как тех, которые прямо затронут вас в режиме крепости (например, дворяне), так и тех, которые в первую очередь влияют на генерацию мира и режим приключенца. Список токенов, отвечающих за должности, можно найти здесь; они не требуют особых разъяснений.

Создание существ

Создание существ - весёлая штука. В игре можно менять каждую деталь существа, позволяя создать нечто из ничего. Моддинг существ похож на моддинг цивилизаций - то же редактирование, добавление либо удаление токенов, закрытых в квадратные скобки с заголовком [CREATURE:]. Токены существ содержат всю информацию о каждом не-рандомном существе в игре, от животных до дварфов, от гоблинов до даже деревянных тележек. Большинство токенов говорят сами за себя, но чтобы узнать о них поточнее, можно посмотреть тут. Но перед началом создания нового существа необходимо понять как работает система тканей.

Создание материала и тканей

Грубо говоря, существо есть серия частей тела. Эти части описаны в своих файлах и мы поговорим о них позже. As a specific aspect of how creatures work which throws off a lot of prospective modders is the relationship between bodyparts, tissues, and materials, I'm going to show you part of the creature entry for a bronze colossus (bear with me):

...
[BODY:HUMANOID:2EYES:2EARS:NOSE:HUMANOID_JOINTS:5FINGERS:5TOES]
[NO_THOUGHT_CENTER_FOR_MOVEMENT]
[TISSUE:BRONZE]
    [TISSUE_NAME:bronze:bronze]
    [TISSUE_MATERIAL:INORGANIC:BRONZE]
    [MUSCULAR]
    [FUNCTIONAL]
    [STRUCTURAL]
    [RELATIVE_THICKNESS:1]
    [CONNECTS]
    [TISSUE_SHAPE:LAYER]
[TISSUE_LAYER:BY_CATEGORY:ALL:BRONZE]
...

В самом верху мы можем видеть токен "BODY:" за которым следует список частей тела. Как вы уже догадались, эти части составляют физическое строение колосса. Но колосс должен быть сделан из чего-то - должен иметь ткани. И эти ткани, в свою очередь, должны быть из чего-то сделаны. В нашем случае из бронзы.

Под токеном BODY находится токен TISSUE, а за ним - идентификатор, во многом похожий на те, что мы уже видели. Блок TISSUE определяет то, как ткани работают и каким целям служат. Так как колосс должен быть сделан только из этой одной ткани, которая должна работать одновременно как кость, мускул и все остальное, то здесь помещены токены MUSCULAR, FUNCTIONAL и STRUCTURAL. Ткань также имеет материал - INORGANIC:BRONZE - свойства которого описаны в файле неорганических материалов, из которого эта ткань впоследствии и будет создана. With us so far?

Below the tissue definition is the TISSUE_LAYER line. TISSUE_LAYER allows you to control where each tissue is applied. Its first argument defines if it's to search by bodypart category (BY_CATEGORY), bodypart type (BY_TYPE), or look for a specific part (BY_TOKEN). That's followed by the parts argument itself, which is in this case ALL (so the game's looking for parts in all categories, which is to say, every bodypart). This is followed by the tissue to be applied, BRONZE. So the TISSUE_LAYER token is telling the game to select all bodyparts in every category and make them out of the tissue "BRONZE". The colossus is now made of bronze.

By now you're probably thinking "Wow, if this was for a creature made out of however many tissues, this would be amazingly longwinded". And you're right. Luckily, there are two methods by which we can speed things up a lot.

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

[TISSUE_TEMPLATE:BRONZE_TEMPLATE]
    [TISSUE_NAME:bronze:bronze]
    [TISSUE_MATERIAL:INORGANIC:BRONZE]
    [MUSCULAR]
    [FUNCTIONAL]
    [STRUCTURAL]
    [RELATIVE_THICKNESS:1]
    [CONNECTS]
    [TISSUE_SHAPE:LAYER]

Теперь вы можете просто дать ссылку на этот шаблон вместо того, чтобы применять описание к каждому бронзовому существу, которого вы делаете.

...
[BODY:HUMANOID:2EYES:2EARS:NOSE:HUMANOID_JOINTS:5FINGERS:5TOES]
[NO_THOUGHT_CENTER_FOR_MOVEMENT]
[USE_TISSUE_TEMPLATE:BRONZE:BRONZE_TEMPLATE]
[TISSUE_LAYER:BY_CATEGORY:ALL:BRONZE]
...

Шаблоны материалов выглядят также, но ссылаются на материалы вместо тканей.

Однако, если вы взглянете на что-то вроде дварфа, то даже с шаблонами редактирование может оказаться очень медленным процессом:

    ...
    [USE_MATERIAL_TEMPLATE:SKIN:SKIN_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:FAT:FAT_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:MUSCLE:MUSCLE_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:BONE:BONE_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:CARTILAGE:CARTILAGE_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:HAIR:HAIR_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:TOOTH:TOOTH_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:EYE:EYE_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:NERVE:NERVE_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:BRAIN:BRAIN_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:LUNG:LUNG_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:HEART:HEART_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:LIVER:LIVER_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:GUT:GUT_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:STOMACH:STOMACH_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:PANCREAS:PANCREAS_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:SPLEEN:SPLEEN_TEMPLATE]
    [USE_MATERIAL_TEMPLATE:KIDNEY:KIDNEY_TEMPLATE]
    [USE_TISSUE_TEMPLATE:SKIN:SKIN_TEMPLATE]
    [USE_TISSUE_TEMPLATE:FAT:FAT_TEMPLATE]
    [USE_TISSUE_TEMPLATE:MUSCLE:MUSCLE_TEMPLATE]
    ...

Вот тогда и приходят на помощь планы строения тела. У этих планов, конечно, есть собственный файл, и они разработаны чтобы помочь автоматизировать некоторые общие процессы в создании существ. Первая взапись в файле b_detail_plan_default.txt делает именно то, что мы собирались делать выше: берет все общие материалы и собирает их в план, на который можно ссылаться одним токеном.

    ...
    [BODY_DETAIL_PLAN:STANDARD_MATERIALS]
    ...

Так гораздо проще. Но как на счет токена TISSUE_LAYER? Их все придется печатать вручную?

Нет, планы строения затрагивают и их. В план строения можно помещать разные аргументы. Например:

[BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS]
    [BP_LAYERS:BY_CATEGORY:BODY:ARG3:50:ARG2:5:ARG1:1]
    [BP_LAYERS:BY_CATEGORY:BODY_UPPER:ARG3:50:ARG2:5:ARG1:1]
    [BP_LAYERS:BY_CATEGORY:BODY_LOWER:ARG3:50:ARG2:5:ARG1:1]
    [BP_LAYERS:BY_CATEGORY:ARM:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
    [BP_LAYERS:BY_CATEGORY:ARM_UPPER:ARG4:25:ARG3:25:ARG2:5:ARG1:1]
    ...
    [BP_LAYERS:BY_CATEGORY:NOSE:ARG5:4:ARG1:1]
    ...

First an argument is placed in the plan (ARG1, ARG2 etc.), followed by the thickness of the tissue that will be inserted in place of the argument. So when we reference the VERTEBRATE_TISSUE_LAYERS plan, we'll be able to do something like this:

    [BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS:SKIN:FAT:MUSCLE:BONE:CARTILAGE]

ARG1 in the detail plan is replaced by SKIN, the first tissue we entered. ARG2 is replaced by FAT, ARG3 by muscle, ARG4 by bone, and ARG5 by CARTILAGE. Hence, our creature's bodypart designated as BODY is made up of SKIN with thickness 1, FAT with thickness 5, and MUSCLE with thickness 50. Its nose is made up of SKIN (thickness 1) and CARTILAGE (thickness 4).

Things left out of the body plans aside, our dwarf's entire body, material, tissue and tissue layer tokens have been boiled down to this:

    ...
    [BODY:HUMANOID:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:
    THROAT:NECK:SPINE:BRAIN:SKULL:5FINGERS:5TOES:MOUTH:FACIAL_FEATURES:TEETH:RIBCAGE]
    [BODY_DETAIL_PLAN:STANDARD_MATERIALS]
    [BODY_DETAIL_PLAN:STANDARD_TISSUES]
    [BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS:SKIN:FAT:MUSCLE:BONE:CARTILAGE]
    ...

This can save you a lot of time and space if you're making lots of changes common to many creatures. In general, if you're making a creature that's fleshy or chitinous, there's detail plans already included in the game to help you out. You should only have to resort to declaring tissues individually (like our bronze colossus) if you're doing something really out-of-the-ordinary.

Another great thing about templates (and so, detail plans) is that they can be modified after being declared. Let's say we wanted our dwarves to be perpetually on fire (don't ask). We declare the body stuff normally:

    ...
    [BODY:HUMANOID:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:
    THROAT:NECK:SPINE:BRAIN:SKULL:5FINGERS:5TOES:MOUTH:FACIAL_FEATURES:TEETH:RIBCAGE]
    [BODY_DETAIL_PLAN:STANDARD_MATERIALS]
    [BODY_DETAIL_PLAN:STANDARD_TISSUES]
    [BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS:SKIN:FAT:MUSCLE:BONE:CARTILAGE]
    ...

We then select the appropriate material:

    ...
    [BODY:HUMANOID:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:
    THROAT:NECK:SPINE:BRAIN:SKULL:5FINGERS:5TOES:MOUTH:FACIAL_FEATURES:TEETH:RIBCAGE]
    [BODY_DETAIL_PLAN:STANDARD_MATERIALS]
    [BODY_DETAIL_PLAN:STANDARD_TISSUES]
    [BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS:SKIN:FAT:MUSCLE:BONE:CARTILAGE]
    [SELECT_MATERIAL:SKIN]
        [MAT_FIXED_TEMP:10600]
    ...

We don't want them burning to death, so we'll need to stop that from happening:

    ...
    [BODY:HUMANOID:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:
    THROAT:NECK:SPINE:BRAIN:SKULL:5FINGERS:5TOES:MOUTH:FACIAL_FEATURES:TEETH:RIBCAGE]
    [BODY_DETAIL_PLAN:STANDARD_MATERIALS]
    [BODY_DETAIL_PLAN:STANDARD_TISSUES]
    [BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS:SKIN:FAT:MUSCLE:BONE:CARTILAGE]
    [SELECT_MATERIAL:SKIN]
        [MAT_FIXED_TEMP:10600]
    [SELECT_MATERIAL:ALL]
        [HEATDAM_POINT:NONE]
    ...

Note that this makes use of DF's built-in temperature scale. You can read more about that on this page. We're also referencing material tokens, which we haven't gone over yet - we'll talk about making your own materials later.

Касты существа

Another potentially extremely powerful part of the creature raws is the caste system. The caste system handles both true biological castes and lesser variations, such as sexes.

To understand the true potential of the caste system, we only need to take a look at the raws for antmen, found in creature_subterrenean.txt:

    ...
    [CASTE:WORKER]
        [CASTE_NAME:worker ant woman:worker ant women:worker ant woman]
        Female, but non-breeding.
        [POP_RATIO:10000]
    [CASTE:SOLDIER]
        [CASTE_NAME:soldier ant woman:soldier ant women:soldier ant woman]
        Female, but non-breeding.
        [POP_RATIO:1000]
    [CASTE:DRONE]
        [MALE]
        [CASTE_NAME:drone ant man:drone ant men:drone ant man]
        [POP_RATIO:5]
    [CASTE:QUEEN]
        [FEMALE]
        [CASTE_NAME:queen ant woman:queen ant women:queen ant woman]
        [POP_RATIO:1]
    [SELECT_CASTE:WORKER]
     [SELECT_ADDITIONAL_CASTE:SOLDIER]
     [SELECT_ADDITIONAL_CASTE:QUEEN]
        [BODY:HUMANOID_4ARMS:2EYES:HEART:GUTS:BRAIN:MOUTH]
        [BODYGLOSS:INSECT_UPPERBODY:INSECT_LOWERBODY]
    [SELECT_CASTE:DRONE]
        [BODY:HUMANOID_4ARMS:2EYES:HEART:GUTS:BRAIN:MOUTH:2WINGS]
        [BODYGLOSS:INSECT_UPPERBODY:INSECT_LOWERBODY]
        [FLIER]
    [SELECT_CASTE:ALL]
        [BODY_DETAIL_PLAN:CHITIN_MATERIALS]
        [BODY_DETAIL_PLAN:CHITIN_TISSUES]
        [BODY_DETAIL_PLAN:EXOSKELETON_TISSUE_LAYERS:CHITIN:FAT:MUSCLE]
        [BODY_DETAIL_PLAN:STANDARD_HEAD_POSITIONS]
        [ATTACK:PUNCH:BODYPART:BY_TYPE:GRASP]
            [ATTACK_SKILL:GRASP_STRIKE]
            [ATTACK_VERB:punch:punches]
    ...

It's evident that the process of creating and editing castes is comparable to the modifications we were making to tissues and materials earlier: A caste is declared, and modifications to the base creature are made. Declared castes can be selected and subsequently modified, again, just like tissues and materials.

In this case, each caste is declared, given its own name, and a POP_RATIO, which determines how commonly a birth results in that caste - for every 10000 workers born, there'll be an average of 1000 soldiers, 5 drones and one queen. You've probably also noticed that the DRONE and QUEEN castes have the MALE and FEMALE tokens respectively - these tokens determine how breeding works. A creature without both a MALE caste and a FEMALE caste will be unable to breed (no asexual creatures yet, unfortunately). As they lack FEMALE, the workers and soldiers are unable to breed with the male drones.

After this, there are some modifications to bodyparts. In this case, the drones have wings and the FLIER token, which the other castes lack. It's entirely possible for creatures of different castes to have completely different body stuctures, even to the extent that they don't resemble each other at all. If you read the section of this guide that dealt with entities, you may remember a passing mention of multi-creature civilisations and how they don't quite work as you may think they would. The castes system is your workaround. You could create a caste that is, for all intents and purposes, a human, and another caste of the same creature that acts exactly like a giant cave spider, put the creature in a civ, and get a human-spider civ. The only flaw in this approach is that the castes will interbreed.

That's the most complex components of creature creation out of the way. You should find the rest trivial by comparison.

Создание вещей

Items are fairly simple to deal with. By default, each item type is contained in its own file; this may help make browsing for a specific item easier, but from a purely technical point of view, it's possible to throw all items into one file. Unfortunately, item tokens don't seem to be especially well-documented (at least as not as well as the other object types), but you should be able to figure out most things by way of our explainations and your assumptions.

Let's look at the entry for, of course, the thong:

[ITEM_PANTS:ITEM_PANTS_THONG]
[NAME:thong:thongs]
[LAYER:UNDER]
[COVERAGE:25]
[LAYER_SIZE:10]
[LAYER_PERMIT:30]
[MATERIAL_SIZE:1]
[SOFT]
[LEATHER]
[STRUCTURAL_ELASTICITY_WOVEN_THREAD]

Most of these are pretty obvious if one compares them to the other entries in the file. There's a layer for the item, determining where it's worn; a coverage value to determine how well it protects you from cold and other things; a size token to determine how much it counts for when it's under something else; a layer permit token to determine how much can be worn under it; and a material size token to determine how much raw material it takes to make it.

Now, if you wanted to mod these to turn them into metal thongs (ouch!), you would simply have to add [METAL] to it somewhere. Simple! These tokens work by tying into material properties - some materials are designated as suitable for making hard items, some for soft, etc..

Weapons involve a little more detail:

[ITEM_WEAPON:ITEM_WEAPON_SWORD_2H]
[NAME:two-handed sword:two-handed swords]
[SIZE:900]
[SKILL:SWORD]
[TWO_HANDED:67500]
[MINIMUM_SIZE:62500]
[MATERIAL_SIZE:5]
[ATTACK:EDGE:100000:8000:slash:slashes:NO_SUB:1250]
[ATTACK:EDGE:50:4000:stab:stabs:NO_SUB:1000]
[ATTACK:BLUNT:100000:8000:slap:slaps:flat:1250]
[ATTACK:BLUNT:100:1000:strike:strikes:pommel:1000]

SIZE determines how heavy the weapon is. This has a substantial effect on weapon effectiveness. SKILL determines which skill is used in using the weapon; a list of skills can be found on this page. MINIMUM_SIZE determines the minimum size a creature must be before the weapon can be wielded, while TWO_HANDED determines how large a creature must be in order to wield the weapon with one hand.

Attacks take a little more explaination. The first value determines the contact area of the weapon's attack; this should be high for slashing weapons and low for bludgeoning, piercing and poking ones. The second value determines how deep the weapon penetrates - for BLUNT attacks this value is ignored as they're not supposed to penetrate anyway, but in the case of EDGE attacks it should generally be lower for slashing attacks and higher for stabbing attacks.

Following these are the nouns and verb used; they should be self-explanatory. Finally, we have the velocity modifier, which has a multiplying effect on the weapon's size for the purposes of determining how powerful it is in combat.

Other, more miscellaneous items are generally simple and shouldn't require any further explanation.

Once you've made an item, you just add it to the civ entry so a civilization can actually craft it, and it's done.

Создание языкового файла

Let's say you added a whole new species. Sure, you could just swipe one of the existing translation files and steal their language for your species, but that's the lazy way! If you want to create a whole new language, it's very simple.

First, you'd need a whole new language_RACE file, such as language_LIZARDMAN.txt, along with "language_LIZARDMAN" at the top of the file proceeded by [OBJECT:LANGUAGE] and [TRANSLATION:LIZARDMAN]. After that, it's just a matter of copy-pasting one of the existing language lists and editing the finished 'translated' word. That's it! Then just add the translation link to your civ in entity_default.txt and it'll be added to the game on worldgen.

(Note that the name of the file doesn't actually matter; however, it's good form to name the file after a creature if only that creature speaks the language)

Создание частей тела

Imagine you have this fantastic idea for a multi-tentacled winged spider-monster. Sounds great! But in order to make this a reality you may need to create a new set of body parts for it. That's no problem! Making body parts is easy, though it may look complicated at first.

All of the default body definitions are located in body_default.txt and then linked to a creature in the creature's entry. We've talked about how bodyparts make up creatures earlier, in the creature section. You can mix and match them in the creature entry and it makes no difference, as long as they're there: each bodypart will link itself to the appropriate connection automatically when the creature is first created.

Body parts work by sections: you can add as many sections as you want to a bodypart definition, but generally you should keep it fairly low for ease of use. Each body section entry is in the, very simple, format:

[BODY:BODYNAME]
[BP:TOKENID:name][TOKENSGOHERE][DEFAULT_RELSIZE:][CATEGORY:WHATEVER]

The most important tokens are "CONTYPE" and "CON": CONTYPE means the bodypart in question is connected to a certain type of bodypart, while CON means it's connected to a specific one. TOKENID is yet another identifier, which should be unique, as it's referenced every time something uses CON or BY_TOKEN. DEFAULT_RELSIZE defines, of course, what the bodypart's size is in relation to the other parts. CATEGORY defines a category for the part, which can be unique or shared with other parts. This is referenced whenever BY_CATEGORY is used.

A list of bodypart tokens can be found here.

Let's take a simple example, a head:

[BODY:BASIC_HEAD]
[BP:HD:head:STP][CONTYPE:UPPERBODY][HEAD][CATEGORY:HEAD]
[DEFAULT_RELSIZE:300]

It connects directly to an upper body.

[BODY:2EYES]
    [BP:REYE:right eye:STP][CONTYPE:HEAD][SIGHT][EMBEDDED][SMALL][RIGHT][CATEGORY:EYE]
        [DEFAULT_RELSIZE:5]
    [BP:LEYE:left eye:STP][CONTYPE:HEAD][SIGHT][EMBEDDED][SMALL][LEFT][CATEGORY:EYE]
        [DEFAULT_RELSIZE:5]

These are a pair of eyes, connecting to the head.

[BODY:HUMANOID]
    [BP:UB:upper body:upper bodies][UPPERBODY][CATEGORY:BODY_UPPER]
        [DEFAULT_RELSIZE:1000]
    [BP:LB:lower body:lower bodies][CON:UB][LOWERBODY][CATEGORY:BODY_LOWER]
        [DEFAULT_RELSIZE:1000]
    [BP:HD:head:STP][CON:UB][HEAD][CATEGORY:HEAD]
        [DEFAULT_RELSIZE:300]
    [BP:RUA:right upper arm:STP][CON:UB][LIMB][RIGHT][CATEGORY:ARM_UPPER]
        [DEFAULT_RELSIZE:200]
    [BP:LUA:left upper arm:STP][CON:UB][LIMB][LEFT][CATEGORY:ARM_UPPER]
        [DEFAULT_RELSIZE:200]
    [BP:RLA:right lower arm:STP][CON:RUA][LIMB][RIGHT][CATEGORY:ARM_LOWER]
        [DEFAULT_RELSIZE:200]
    [BP:LLA:left lower arm:STP][CON:LUA][LIMB][LEFT][CATEGORY:ARM_LOWER]
        [DEFAULT_RELSIZE:200]
    [BP:RH:right hand:STP][CON:RLA][GRASP][RIGHT][CATEGORY:HAND]
        [DEFAULT_RELSIZE:80]
    [BP:LH:left hand:STP][CON:LLA][GRASP][LEFT][CATEGORY:HAND]
        [DEFAULT_RELSIZE:80]
    [BP:RUL:right upper leg:STP][CON:LB][LIMB][RIGHT][CATEGORY:LEG_UPPER]
        [DEFAULT_RELSIZE:500]
    [BP:LUL:left upper leg:STP][CON:LB][LIMB][LEFT][CATEGORY:LEG_UPPER]
        [DEFAULT_RELSIZE:500]
    [BP:RLL:right lower leg:STP][CON:RUL][LIMB][RIGHT][CATEGORY:LEG_LOWER]
        [DEFAULT_RELSIZE:400]
    [BP:LLL:left lower leg:STP][CON:LUL][LIMB][LEFT][CATEGORY:LEG_LOWER]
        [DEFAULT_RELSIZE:400]
    [BP:RF:right foot:right feet][CON:RLL][STANCE][RIGHT][CATEGORY:FOOT]
        [DEFAULT_RELSIZE:120]
    [BP:LF:left foot:left feet][CON:LLL][STANCE][LEFT][CATEGORY:FOOT]
        [DEFAULT_RELSIZE:120]

An entire humanoid body. The foot bone's connected to the ankle bone...

"BODYGLOSS" entries, which you can sometimes find applied to creature entries, are simply replacement words for specific part name strings in a creature. For example, you'll find the bodygloss [BODYGLOSS:CLAW_HAND:hand:claw] in body_default.txt; you can then use this in a creature via "[BODYGLOSS:CLAW_HAND]" and it'll replace all instances of "hand" with "claw" in that creature. Be warned, however—if you were to, say make a bodygloss [BODYGLOSS:EARSTALK:ear:stalk:ears:stalk], it would not only change "ear" and "ears" to "stalk" and "stalks", it would also change "heart" to "hstalkt"! For all intents and purposes the body part will still function as the proper part, though.

Растения

Plants are, again, not unlike creatures. With what you've learned so far in regard to tokens and the materials system, running through the notes included in plant_standard.txt should explain most things. Here's the list of plant-specific tokens.

Below is the plump helmet raw description:

[PLANT:MUSHROOM_HELMET_PLUMP]
	[NAME:plump helmet][NAME_PLURAL:plump helmets][ADJ:plump helmet]
	[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
		[MATERIAL_VALUE:2]
	[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
		[EDIBLE_VERMIN]
		[EDIBLE_RAW]
		[EDIBLE_COOKED]
	[PICKED_TILE:161][PICKED_COLOR:6:13:0]
	[GROWDUR:300][VALUE:2]
	[USE_MATERIAL_TEMPLATE:DRINK:PLANT_ALCOHOL_TEMPLATE]
		[STATE_NAME_ADJ:ALL_SOLID:frozen dwarven wine]
		[STATE_NAME_ADJ:LIQUID:dwarven wine]
		[STATE_NAME_ADJ:GAS:boiling dwarven wine]
		[MATERIAL_VALUE:2]
		[DISPLAY_COLOR:5:0:0]
		[EDIBLE_RAW]
		[EDIBLE_COOKED]
		[PREFIX:NONE]
	[DRINK:LOCAL_PLANT_MAT:DRINK]

	[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
		[MATERIAL_VALUE:1]
		[EDIBLE_VERMIN]
		[EDIBLE_COOKED]
	[SEED:plump helmet spawn:plump helmet spawn:4:0:1:LOCAL_PLANT_MAT:SEED]
	[SPRING][SUMMER][AUTUMN][WINTER]
	[FREQUENCY:100]
	[CLUSTERSIZE:5]
	[PREFSTRING:rounded tops]
	[WET][DRY]
	[BIOME:SUBTERRANEAN_WATER]
	[UNDERGROUND_DEPTH:1:3]
	[SHRUB_TILE:142]
	[DEAD_SHRUB_TILE:28]
	[SHRUB_COLOR:5:13:0]
	[DEAD_SHRUB_COLOR:5:6:0]

Let's look at this line by line:
First, we define its file name. In this case it's MUSHROOM_HELMET_PLUMP. Next we define its in-game name (plump helmet) and its adjective for if you were to craft with it (e.g. plump helmet earrings).

	[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
		[MATERIAL_VALUE:2]
	[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]

This defines the structure and material of the plant. It references STRUCTURAL_PLANT_TEMPLATE in the first line, so if you were to say, add wings to the template, the plump helmet plant would be winged. This is for the plant itself, not the end plump helmets.

After that we get our edible tokens. These say that vermin can eat the plant, and it can be eaten raw or cooked by your dwarves. So if you wanted a plant vermin would leave alone, you'd remove the [EDIBLE_VERMIN] token.

		[EDIBLE_VERMIN]
		[EDIBLE_RAW]
		[EDIBLE_COOKED]

Next, [PICKED_TILE:161] is the character (161 in this case) shown when the crop is harvested. See character table for a table of usable tiles. [PICKED_COLOR:6:13:0] is the color used for the crop's tile when harvested. It's in a foreground:background:brightness format. See color for the colors usable.

	[PICKED_TILE:161][PICKED_COLOR:6:13:0]

[GROWDUR:300] is how long it takes for your crop to grow. There are 1008 growdur units in a season.
[VALUE:2] Is the value of harvested plant (default 1). Appears to have no effect in version 0.31.

	[GROWDUR:300][VALUE:2]

This defines the plant's alcohol states. [STATE_NAME_ADJ:ALL_SOLID:] is the frozen name, followed is the actual drink name, and then its boiling name. These are achieved by either Scorching or Freezing climates. [DISPLAY_COLOR] is, of course, color, and [EDIBLE_RAW] and [EDIBLE_COOKED] are saying you can drink the alcohol raw or cooked.

	[USE_MATERIAL_TEMPLATE:DRINK:PLANT_ALCOHOL_TEMPLATE]
		[STATE_NAME_ADJ:ALL_SOLID:frozen dwarven wine]
		[STATE_NAME_ADJ:LIQUID:dwarven wine]
		[STATE_NAME_ADJ:GAS:boiling dwarven wine]
		[MATERIAL_VALUE:2]
		[DISPLAY_COLOR:5:0:0]
		[EDIBLE_RAW]
		[EDIBLE_COOKED]
		[PREFIX:NONE]
	[DRINK:LOCAL_PLANT_MAT:DRINK]

After that we get our seed template:

	[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
		[MATERIAL_VALUE:1]
		[EDIBLE_VERMIN]
		[EDIBLE_COOKED]
	[SEED:plump helmet spawn:plump helmet spawn:4:0:1:LOCAL_PLANT_MAT:SEED]

And all this says is that the seeds may be eaten by vermin or cooked. Then it gives the name of our plant's seed, its plural name, its foreground, background, and brightness colors, followed by its seed material; said material should have [SEED_MAT] to permit proper stockpiling.

And finally for the last chunk we have this:

	[SPRING][SUMMER][AUTUMN][WINTER]
	[FREQUENCY:100]
	[CLUSTERSIZE:5]
	[PREFSTRING:rounded tops]
	[WET][DRY]
	[BIOME:SUBTERRANEAN_WATER]
	[UNDERGROUND_DEPTH:1:3]
	[SHRUB_TILE:142]
	[DEAD_SHRUB_TILE:28]
	[SHRUB_COLOR:5:13:0]
	[DEAD_SHRUB_COLOR:5:6:0]

First we define what season(s) the plant may grow in, then we define how frequently this plant is generated in a particular area, followed by how many harvested crop items may come from 1 plant. [PREFSTRING:] is what your dwarves like about the plant, which in this case is the rounded tops. [WET][DRY] are the conditions under which the plant can grow. Wet means it can grow close to water, dry means it can grow away from water. This does not mean you can grow the plant on dry stone however. It is just for natural spawning of the plant.
[BIOME] Is what biome the plant grows in. [UNDERGROUND_DEPTH:Minimum:Maximum] Is the highest and lowest cavern levels that the plant can appear in if its biome is subterranean. Dwarven civilizations will only export (via the embark screen or caravans) things that available at depth 1. Defaults to 0:0 (surface only).
Lastly, [SHRUB_TILE] is the character used for the naturally spawning shrub of this plant, [DEAD_SHRUB] is the dead shrub character. [SHRUB_COLOR] Is the shrub's color, and [DEAD_SHRUB_COLOR] is, of course, the dead shrub's color.

While this may or may not look like a lot of tokens, it's very easy. Just copy an existing plant and edit it to your new plant.
For the rest of the tokens, see plant token.

Мастерские

Workshops are raw-designed pretty differently from everything else in the game, being buildable structures rather than items or methods to gain items. However, they are fairly simple. For example, here's the raw for the soap maker's workshop:

[BUILDING_WORKSHOP:SOAP_MAKER]
	[NAME:Soap Maker's Workshop]
	[NAME_COLOR:7:0:1]
	[DIM:3:3]
	[WORK_LOCATION:2:2]
	[BUILD_LABOR:SOAP_MAKER]
	[BUILD_KEY:CUSTOM_SHIFT_S]
	[BLOCK:1:0:0:1]
	[BLOCK:2:0:0:1]
	[BLOCK:3:0:0:0]
	[TILE:0:1:' ':' ':150]
	[TILE:0:2:' ':' ':'/']
	[TILE:0:3:'-':' ':' ']
	[COLOR:0:1:0:0:0:0:0:0:6:0:0]
	[COLOR:0:2:0:0:0:0:0:0:6:0:0]
	[COLOR:0:3:6:0:0:0:0:0:0:0:0]
	[TILE:1:1:' ':' ':'=']
	[TILE:1:2:'-':' ':8]
	[TILE:1:3:' ':' ':150]
	[COLOR:1:1:0:0:0:0:0:0:6:0:0]
	[COLOR:1:2:6:0:0:0:0:0:6:0:0]
	[COLOR:1:3:0:0:0:0:0:0:6:0:0]
	[TILE:2:1:'-':' ':8]
	[TILE:2:2:' ':' ':8]
	[TILE:2:3:' ':150:' ']
	[COLOR:2:1:6:0:0:0:0:0:6:0:0]
	[COLOR:2:2:0:0:0:0:0:0:6:0:0]
	[COLOR:2:3:0:0:0:6:0:0:0:0:0]
	[TILE:3:1:150:' ':8]
	[TILE:3:2:' ':' ':8]
	[TILE:3:3:' ':240:' ']
	[COLOR:3:1:6:0:0:0:0:0:6:7:0]
	[COLOR:3:2:0:0:0:0:0:0:6:7:0]
	[COLOR:3:3:0:0:0:7:0:1:0:0:0]
	[BUILD_ITEM:1:BUCKET:NONE:NONE:NONE][EMPTY][CAN_USE_ARTIFACT]
	[BUILD_ITEM:1:NONE:NONE:NONE:NONE][BUILDMAT][WORTHLESS_STONE_ONLY][CAN_USE_ARTIFACT]

A line-by-line breakdown:

	[NAME:Soap Maker's Workshop]
	[NAME_COLOR:7:0:1]

These are the name of the workshop ("Soap Maker's Workshop") and color of the workshop's name when examined with 'q' (White with a black background).

	[DIM:3:3]
	[WORK_LOCATION:2:2]

DIM refers to how large the workshop will be, in this case 3 wide, 3 tall. WORK_LOCATION tells where the creature using it (usually a dwarf) will work, numbered from the top right--in this case, 2:2, or the middle. Multiple work locations can be defined, even outside the dim.

	[BUILD_LABOR:SOAP_MAKER]
	[BUILD_KEY:CUSTOM_SHIFT_S]

These refer to the worker required to build it (soap maker) and the key used to build it in the workshop menu (capital S).


 	[BLOCK:1:0:0:1]
	...

This is a bit more complex, and is where we get to the meaty part of workshop making--the tiles' properties. BLOCK refers to which tiles will be untraversable--1 means blocked, 0 means unblocked. The first number refers to row, and the next 3 refer to column, so 1:0:0:1 means that, on the first row, the first two tiles will be unblocked and the last will be blocked.

	[TILE:0:1:' ':' ':150]
	...

The TILE token tells which tile will go where. note, however, that there are 5 entries here instead of 4. The first number, in this case, refers to build stage, numbered from 0 to 3; 3 or 1 is fully built (depending on whether there are stages), 0 is just placed, and 2 is always an intermediate stage, while 1 is usually an intermediate stage. Whether 1 is an intermediate stage or not depends on if there are a 2 and 3 stage; if 2 and 3 exist, 1 will be intermediate. The second number and beyond are similar to BLOCK; however, instead of 1s and 0s, you must input tiles. The tiles themselves can be given in quotes (as in ' ') or given as a number, which can be looked up here. Here, we have 150, which is û.


	[COLOR:1:1:0:0:0:0:0:0:6:0:0]
	...

Color is as TILE, but with colors instead of tiles; however, colors are made up of 3 numbers each or MAT. MAT refers to the color of the material used to make it; the 3 numbers refer to foreground:background:foreground brightness, and can be looked up here. For example, 4:2:1 will give you bright red with a dark green background.

	[BUILD_ITEM:1:BUCKET:NONE:NONE:NONE][EMPTY][CAN_USE_ARTIFACT]
	[BUILD_ITEM:1:NONE:NONE:NONE:NONE][BUILDMAT][WORTHLESS_STONE_ONLY][CAN_USE_ARTIFACT]

These refer to items required to build the building. These are in the same format as reaction reagents and products--quantity:item:material. You'll learn more about those on the article about reactions, though. The second BUILD_ITEM is special-- it uses modifiers exclusively to determine its requirements. BUILDMAT refers to wood logs, wood blocks, stone boulders, and stone blocks; WORTHLESS_STONE_ONLY means it can't use economic stone; CAN_USE_ARTIFACT means that it... can use artifacts. EMPTY, in the bucket's case, means that the bucket must be empty.

More can be seen at the building tokens article.

Реакции

An in-depth guide for reactions is available here.

Материал

As we've seen when talking about creatures, materials are vital. Materials show up in two forms: material templates, which generally show up in creatures, and specific materials (designated as "inorganic"), which are (by default, at least) consigned purely to metal and stone types.

Let's take a look at METAL_TEMPLATE in material_template_default.txt. It's evident that most of the basic properties of metals are already defined in the template - it goes red and melts at a high enough temperature, it's heavy, and (as noted by the very bottom token) is a metal. We already know just how useful templates can be to creatures, and the same applies to other materials.

Now let's take a look at inorganic_metal.txt. You can see that the metals here refer to the templates, and, just like we did with creatures, then modify the properties of that template and expand upon it.

Finally, let's look at inorganic_stone_mineral.txt. Here we can see that in addition to the changes made to the template, there are also ENVIRONMENT tokens - these tell the game where to place these minerals during worldgen.

Here's a list of material tokens. It should also help you out with any modifications you want to make regarding those creature modifications we were making a while back. See, it all ties together in the end. The beauty of the current materials system is that there's actually very little difference between, say, leather and iron - they're fundamentally the same thing, just with different properties, which is how things really should be.

Примеры

The Hydling by Mysteryguye (annotated and separated into blocks by Putnam)

[CREATURE:HYDLING]
	[DESCRIPTION:A five-headed small hairy thing, about the size of a dog. It is very loyal to its masters, and will promptly disembowel any enemy straying too close.]
This is the description that shows up in-game when viewing the creature.
	[NAME:hydling:hydlings:hydlish] If there were a civ made of hydlings, it would appear as "hydlings" in the neighbors screen.
	[CASTE_NAME:hydling:hydlings:hydlish]
	[CREATURE_TILE:'='][COLOR:2:0:1] Will appear as a light green "=".
	[PETVALUE:78][NATURAL] Creature is known to be naturally occurring by the game. Will cost 40 embark points to buy.
	[LARGE_ROAMING] Will spawn outdoors, wandering around.
	[COMMON_DOMESTIC][TRAINABLE][PET] Can be bought on embark as a pet, war animal, or hunting animal.
	[BONECARN] Can eat meat and bones only--no vegetables.
	[PREFSTRING:loyalty] Dwarves will like it for its loyalty.
	[LIKES_FIGHTING] Will attack rather than flee.
	[BODY:QUADRUPED:TAIL:10EYES:10EARS:5NOSES:2LUNGS:HEART:GUTS:ORGANS:5THROATS:5NECKS:5SPINES:5BRAINS:5SKULLS:3TOES_FQ_REG:3TOES_RQ_REG:MOUTH:TONGUE:GENERIC_TEETH_WITH_LARGE_EYE_TEETH:RIBCAGE]
Has a lower body, upper body, 4 legs, a tail, ten eyes, ten ears, five noses, two lungs, a heart, guts, a pancreas etc, and 5 heads with all that goes with those.
	[BODYGLOSS:PAW] Feet will be called "paws"
	[BODY_DETAIL_PLAN:STANDARD_MATERIALS] Declares the standard materials that most creatures' tissues are made of.
	[BODY_DETAIL_PLAN:STANDARD_TISSUES] This declares the tissues that the creature's tissue layers are made of.
	[BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS:SKIN:FAT:MUSCLE:BONE:CARTILAGE] And this describes the tissue layers that the creature is made of.
	[BODY_DETAIL_PLAN:BODY_HAIR_TISSUE_LAYERS:HAIR] Creature will be covered with a layer of fur.
	[USE_MATERIAL_TEMPLATE:NAIL:NAIL_TEMPLATE] And it'll have nails.
	[USE_TISSUE_TEMPLATE:NAIL:NAIL_TEMPLATE]
	[TISSUE_LAYER:BY_CATEGORY:TOE:NAIL:FRONT] On the toe, specifically.
	[SELECT_TISSUE_LAYER:HEART:BY_CATEGORY:HEART]
	 [PLUS_TISSUE_LAYER:SKIN:BY_CATEGORY:THROAT]
		[TL_MAJOR_ARTERIES] Heart and throat--called above--will cause heavy bleeding if ruptured.
	[BODY_DETAIL_PLAN:STANDARD_HEAD_POSITIONS] Places eyes, ears and what have you into their correct placement, so that you don't have people punching out eyes from behind.
	[BODY_DETAIL_PLAN:HUMANOID_RIBCAGE_POSITIONS] Sets the ribcage as being around lungs and heart.
	[USE_MATERIAL_TEMPLATE:SINEW:SINEW_TEMPLATE] Defines sinew so that...
	[TENDONS:LOCAL_CREATURE_MAT:SINEW:200] Tendons
	[LIGAMENTS:LOCAL_CREATURE_MAT:SINEW:200] And ligaments can be defined.
	[HAS_NERVES] Creature has nerves, and as such can be disabled by severing them.
	[USE_MATERIAL_TEMPLATE:BLOOD:BLOOD_TEMPLATE] Defines the material BLOOD using the template BLOOD_TEMPLATE.
	[BLOOD:LOCAL_CREATURE_MAT:BLOOD:LIQUID] Defines the creature's BLOOD as being made of the above-defined BLOOD material in a LIQUID state.
	[CREATURE_CLASS:GENERAL_POISON] Creature can be affected by syndromes that affect GENERAL_POISON.
	[GETS_WOUND_INFECTIONS] Pretty much self explanatory. Creature can get infected from wounds.
	[GETS_INFECTIONS_FROM_ROT] And from necrosis.
	[USE_MATERIAL_TEMPLATE:PUS:PUS_TEMPLATE] Defines PUS using PUS_TEMPLATE.
	[PUS:LOCAL_CREATURE_MAT:PUS:LIQUID] Defines PUS as being made of PUS.
	[BODY_SIZE:0:0:1000] Creature will be 1000 cubic centimeters at birth...
	[BODY_SIZE:1:0:12500] 12500 cubic centimeters at 1 year old...
	[BODY_SIZE:2:0:30000] and 30000 cubic centimeters at 2.
	[BODY_APPEARANCE_MODIFIER:LENGTH:90:95:98:100:102:105:110] Creature can be anywhere from 90% to 110% as long as others.
	[BODY_APPEARANCE_MODIFIER:HEIGHT:90:95:98:100:102:105:110] As above, but with height.
	[BODY_APPEARANCE_MODIFIER:BROADNESS:90:95:98:100:102:105:110] As above, but with broadness. This puts the minimum size of the creature (when fully grown) at 21870 and the maximum size at 39930.
	[MAXAGE:20:30] Creature will die of old age between the ages of 20 and 30, no later than 30, no sooner than 20.
	[CAN_DO_INTERACTION:MATERIAL_EMISSION] Creature can use the MATERIAL_EMISSION interaction.
		[CDI:ADV_NAME:Hurl fireball] In adventurer mode, the MATERIAL_EMISSION interaction will appear as "Hurl fireball".
		[CDI:USAGE_HINT:ATTACK] Creature will use MATERIAL_EMISSION when it's attacking, on creatures that it's attacking.
		[CDI:BP_REQUIRED:BY_CATEGORY:HEAD] Creature must have at least one HEAD to use MATERIAL_EMISSION.
		[CDI:FLOW:FIREBALL] The MATERIAL_EMISSION will shoot a fireball.
		[CDI:TARGET:C:LINE_OF_SIGHT] The target for the emission--a location--must be within the line of sight of the Hydling.
		[CDI:TARGET_RANGE:C:15] And must be, at most, 15 tiles away.
		[CDI:MAX_TARGET_NUMBER:C:1] The hydling can only shoot at one target at a time...
		[CDI:WAIT_PERIOD:30] and only every 30 ticks (3 tenths of a second at 100 FPS)
	[ATTACK:BITE:CHILD_BODYPART_GROUP:BY_CATEGORY:HEAD:BY_CATEGORY:TOOTH] Defines a BITE attack that uses teeth.
		[ATTACK_SKILL:BITE] Attack uses the BITE skill.
		[ATTACK_VERB:nom:noms] "The Hydling noms the Elf in the left first toe, tearing the muscle!"
		[ATTACK_CONTACT_PERC:100] Will use all of the tooth. Note that this can be more than 100.
		[ATTACK_PENETRATION_PERC:100] Will sink the tooth all the way in. This can also be more than 100.
		[ATTACK_FLAG_EDGE] Attack is an EDGE attack.
		[ATTACK_PRIORITY:MAIN] Attack is of priority MAIN. Other option is SECOND.
		[ATTACK_FLAG_CANLATCH] Attack can latch.
	[ATTACK:SCRATCH:CHILD_TISSUE_LAYER_GROUP:BY_TYPE:STANCE:BY_CATEGORY:ALL:NAIL] As above, but for nail instead of teeth.
		[ATTACK_SKILL:STANCE_STRIKE] Uses the kicking skill.
		[ATTACK_VERB:slice:slices] "You slice the Elf in the left foot and the severed part sails off in an arc!"
		[ATTACK_CONTACT_PERC:100] Uses the whole nail.
		[ATTACK_PENETRATION_PERC:100] The whole nail goes in.
		[ATTACK_FLAG_EDGE] Attack is an edge attack.
		[ATTACK_PRIORITY:SECOND]
	[CHILD:1] Hydling will become an adult at 1 year old.
	[GENERAL_CHILD_NAME:hydie:hydies] Children will appear as "hydies".
	[DIURNAL] Is active during the daytime.
	[HOMEOTHERM:10070] Has a body temperature of 102 Fahrenheit.
	[SWIMS_INNATE][SWIM_SPEED:2500] Swims innately, about 2.5x slower than it walks.
	[CASTE:FEMALE] Defines a caste called FEMALE.
		[FEMALE] FEMALE caste is female.
	[CASTE:MALE] As above, but with male.
		[MALE] See above.

Утилиты для мододела

A list of many mods and community-developed utilities