Difference between revisions of "Modding"

From UnReal World Wiki
Jump to: navigation, search
(Update first line parameter descriptions.)
(Rewrite ingredients section)
Line 221: Line 221:
 
=====<u>'''{item}'''</u>=====
 
=====<u>'''{item}'''</u>=====
  
: This parameter occurs multiple times in the next section, and indicates an item required in the recipe.  It can describe a tool like an axe or knife, or a resource like wood or leather, to the recipe, it's all essentially treated the same way.
+
: This parameter can occur multiple times following the first line of the recipe, and indicates an ingredient, tool, or other requirement for the recipe.  
 
: Let's refer back to our example.
 
: Let's refer back to our example.
  
  {Stone}<span class="Apple-tab-span" style="white-space:pre"> </span>[remove]
+
  {Stone} [remove]
 
  {Slender trunk} [remove]
 
  {Slender trunk} [remove]
 
  {Rope} [remove]
 
  {Rope} [remove]
  {Knife}
+
  {Knife} <Small Knife>
 +
 
 +
: Each of these lines describes an item required in the creation of our modded object. In this case, the vanilla stone-axe. The first line says we need a stone, and that that stone will be consumed by the recipe.  The first three lines are essentially the same, indicating that a stone, a slender trunk, and a rope will all be required, and all of them will be consumed.  The last line indicates that you must also have any knife available, with the small knife preferred. As it doesn't have the [remove] parameter, the knife will remain after you finish crafting your new axe.
 +
 
 +
: Any item name in the game can be used here --- including the names of new items you have modded into the game.  There are also several special general names that can be found in the Reference section at the bottom of this document.
  
: Each of these lines describes an item required in the creation of our modded object. In this case, the vanilla stone-axe. The first line says we need a stone, and that that stone will be consumed by the recipe.  The first three lines are essentially the same, indicating that a stone, a trunk, and a rope will all be required, and all of them will be consumed.  The last line indicates that you must also have any knife on you or in an adjacent square. but since it doesn't have the [remove] parameter, the knife will remain after you finish crafting your new axe. 
 
: A list of valid values for {item} will be covered in the Reference Section below.
 
 
: '''<u>Wildcards</u>'''
 
: '''<u>Wildcards</u>'''
  
: Sometimes you want to permit one of a variety of items to be used in a recipe, such as leather. If you want to allow a recipe to do this, you need merely include a wildcard *, such as in the following example:
+
: Sometimes you want to allow multiple types of items to be used in a recipe but there's no predefined general name for what you want. To do this, you can use a wildcard *, such as in the following example:
  {* leather}<span class="Apple-tab-span" style="white-space:pre"> </span>[remove]
+
  {* leather} [remove]
  
  
: The * will permit any leather to be used in the recipe (but NOT any Fur, for example).  There are a lot of options here that will be covered in the Advanced Syntax section.
+
: The * will permit any item whose name ends in "leather" to be used in the recipe.  There are a lot of options here that will be covered in the Advanced Syntax section.
  
 
=====<u>'''<Preferred Item>'''</u>=====
 
=====<u>'''<Preferred Item>'''</u>=====
  
: Sometimes you may want a job to be performed with any variation of a particular tool, but to prefer a particular type.  In the event that the proper tool isn't available, another tool will stand in, but it will take longer to accomplish.
+
: Sometimes you may want to allow a job to be performed with many types of tools, but to prefer a particular type.  In the event that the proper tool isn't available, another tool will stand in, but it will take longer to accomplish.
: Referencing our example again, the last item listed is the tool knife.  If you want to require that while a knife would do, a hunting knife would be better, you would add the following:
+
: Referencing our example again, the last item listed is the tool knife.
  
 
  {Knife} <hunting knife>
 
  {Knife} <hunting knife>
: In this example any knife would do to get the job done, but the hunting knife would make the job go faster. Using a different type of knife will lower the quality of the item.
+
 
:
+
: In this example any knife would be able to get the job done, but a small knife would make the job go faster. Using a different type of knife may also lower the quality of the item.
 +
: There are only a couple of places where this can be done; wildcards cannot be used to define this.  In particular, cutting weapons, axes, knives, and shovels can all have a preferred tool set for them.
  
 
=====<u>'''[remove]'''</u>=====
 
=====<u>'''[remove]'''</u>=====
  
  {Stone}<span class="Apple-tab-span" style="white-space:pre"> </span>'''[remove]'''
+
  {Stone} '''[remove]'''
  
::: This purpose of this parameter was described above.  It indicates that the resource in question will be removed from your inventory upon completion of the recipe. That's pretty much all there is to it. Remember that {item} can be a tool as well as a resource, so it isn't always appropriate to remove an ingredient in your recipe.
+
: This parameter indicates that the resource in question will be removed from your inventory upon completion of the recipe. That's pretty much all there is to it. Remember that {item} can be a tool as well as a resource, so it isn't always appropriate to remove an ingredient in your recipe.
  
: '''It is essential to note that if you wish to use the [name:] parameter, you MUST use remove as part of your recipe.  More on this later.'''
+
=====<u>'''(NumberRequired)'''</u>=====
  
 +
: When included in the ingredient section after an item, a number in ()'s indicates the number of this item required to perform the task.  For instance:
  
=====<u>'''(NumberRequired)'''</u>=====
+
  {Stone} '''(2)''' [remove]
<p style="font-size:14px;margin-left:24px;">When included in the ingredient section, after an item, a number in ()'s indicates the number of this item required to perform the task.  For instance:</p>
+
 
+
  {Stone} '''(2)'''<span class="Apple-tab-span" style="white-space:pre"> </span>[remove]
+
  
: Will require two stones in your inventory, both of which will be removed, to complete the recipe.  This is one of the main ways to indicate multiple items being required in a recipe, you can also dictate amounts with #weight#.
+
: Will require two stones in your inventory, both of which will be removed, to complete the recipe.  This is one of the main ways to indicate multiple items being required in a recipe.
  
  
 
=====<u>'''#weight#'''</u>=====
 
=====<u>'''#weight#'''</u>=====
  
:This parameter contains a numerical value that can be either a whole number, or a decimal.  (%5% vs %.05%)  While it appears that any number of decimal places can be used, it will round up or down.  So %0.554% will appear as .55 pounds, while %.555% will appear as 0.56 pounds.
+
: This parameter contains a numerical value that can be either a whole number, or a decimal.  (%5% vs %.05%)  While it appears that any number of decimal places can be used, it will round up or down to two decimal places.
 +
: It is possible to require a certain amount of a resource WITHOUT it being consumed, so the below example would require .5 pounds of rock to use the recipe, but the rock would remain after.
  
It is important to note that it is possible to require a certain amount of a resource WITHOUT it being consumed, so the below example would require .5 pounds of rock to use the recipe, but the rock would remain after.
+
  {Rock} #.5#
  {Stone}<span class="Apple-tab-span" style="white-space:pre"> </span>#.5#
+
  
:While the below would remove .5 pounds of rock from your inventory.
+
: While the below would remove .5 pounds of rock from your inventory.
  
  {Stone}<span class="Apple-tab-span" style="white-space:pre"> </span>#.5# [remove]
+
  {Rock} #.5# [remove]
  
 
:As a rock object weights 1 pound by default, the following would be seen in your inventory after having done this.
 
:As a rock object weights 1 pound by default, the following would be seen in your inventory after having done this.
 
: [[File:URW_WeightExample.png|frame|left|Consuming part of a full object will leave this meter showing.]]
 
: [[File:URW_WeightExample.png|frame|left|Consuming part of a full object will leave this meter showing.]]
  
 +
=====<u>'''[patchwise]'''</u>=====
  
 +
: Patchwise on ingredients is used when patch is set in the first line of the recipe.  It flags an ingredient as being required for each output item produced, rather than only once for the recipe as a whole.  Thus if you have a [patch:10] recipe that takes .5 lbs of rock, without [patchwise] it will always take .5 lbs of rock.  With [patchwise] it will take .5 lbs for every item you make, up to the max of 5 lbs when you make 10 items.
  
 
+
  {Rock} #.5# [remove] [patchwise]
 
+
 
+
 
+
<u style="font-style:inherit;font-weight:inherit;font-size:12px;">'''[patchwise]'''</u>
+
 
+
: Patchwise is essential in any recipe that you wish to consume an appropriate amount of a resource to the number of items being made.  Returning to our example:
+
 
+
 
+
 
+
  {Stone}<span class="Apple-tab-span" style="white-space:pre"> </span>#.5#
+
: Would require you to have .5 pounds of rock available to perform this task, but would not require more than .5 pounds of rock, no matter how many you are making at once.  It would only require that one .5 pound of rock.
+
 
+
 
+
 
+
<p style="margin-left:24px;">
+
</p>
+
{Stone}<span class="Apple-tab-span" style="white-space:pre"> </span>#.5# [remove]
+
: This on the other hand would still require .5 pounds of rock, but would consume it in the process of the recipe.  Again, no matter how many you're making at once, this would only require .5 pounds of stone.
+
 
+
 
+
 
+
<p style="margin-left:24px;">
+
</p>
+
{Stone}<span class="Apple-tab-span" style="white-space:pre"> </span>#.5# [remove] [patchwise]
+
: In this case, the recipe would require .5 pounds of stone for *each* item you wished to make.  So if you selected to make a batch of 5, it would require 2.5 pounds of rock, and would remove all 2.5 from your inventory.
+
 
+
: So when would you not use patchwise?  When you're including a tool.  Remember, [[User:Modding#.7Bitem.7D|{item}]] can be a tool as well as a resource, so you may not always want it to be removed as part of the process, or multiplied as part of a batch of items with [patchwise].
+
  
 
<center>[[File:seperatoricon.png]]</center>
 
<center>[[File:seperatoricon.png]]</center>

Revision as of 14:38, 29 July 2017

2010 and patch 3.13 brought an exciting new change to the game: the ability to start adding in our own modifications. The overall ability to mod started out very rudimentary and was largely undocumented, but as time has gone by we have seen steady improvements and additions. This is an attempt to create a complete, readable piece of documentation on modding and how it can be applied, and is intended to be a growing body of work as this amazing aspect of the game continues to grow and be developed.

Moddable Files

Modding in UnReal World is done in a simple text-based format. Moddable text files are saved in the main directory of the game. They are dynamically loaded in by the game, and so can be edited in real time with the game running. This allows you to modify and immediately test your mods without having to restart the game. The syntax is simple and easy to learn. There is no documentation of the syntax in the file itself, but using this guide you will quickly become accustomed to it and become able to write new mods in no time.
What tools do I need to start modding?
As all of the files you'll be modifying are text files, any simple text editor will do the job.
For Windows machines, Notepad++ comes highly recommended, as it has some additional tools to make editing files simpler. On OSX Textedit or Textmate both work well and vim or emacs will work fine on Unix-based systems.
What files will I be working with?
There are two ways to modify UnrealWorld. First, you can modify the pre-existing files in the game directory however you like. Second, you can add new files to the game directory with appropriate names that will be loaded by the game as well as the pre-existing files. When possible, it is best to create new files for a mod, as that helps prevent conflict between different mods being used.
Open up the game directory for UnrealWorld. On Windows, simply open the folder containing the executable file. On OSX, right-click the App icon and select "Show Package Contents", then click on the "Contents" and "Resources" subdirectories.

Root Files:

Within the root directory several text-editable files are found that contain much of the information for the game.  Not all of the game's crafting, cooking, and activities are available in these mod files (some is hard-coded), but quite a lot is.
Core Crafting Recipes
diy_glossary.txt                - Vanilla do-it-yourself recipes     (items)

biy_glossary.txt                - Vanilla build-it-yourself          (constructions) 

cookery_glossary.txt            - Vanilla cooking recipes            (food)

menudef_additional.txt          - Empty file for submenu definitions (menus)
Within the above files are found the moddable vanilla recipes for crafting, building, and cooking food of all types.  You'll note that some actions like smoking meat or peeling bark from a tree, are not found within these files.  Anything not found here is hardcoded in the game and not available for modding. These files will be quite useful as references when you're making your own mods.
Any new text files with the diy_ biy_ cookery_ or menudef_ prefixes placed in the root directory will be loaded in by the game as mods. We'll get into how to create and structure these files later.
Core Plant Files
The definitions of plants within the game are defined in flora_* files, as described below.
flora_berries.txt               - Vanilla berries

flora_cultivated.txt            - Vanilla crops

flora_herbs.txt                 - Vanilla herbs

flora_mushroom.txt              - Vanilla mushrooms

flora_newherbs.txt              - More vanilla herbs
As with crafting recipes, new plants can be added to the game by adding a new text file with the flora_ prefix to the game directory. This will make the plant available to the game but not necessarily spawn it within pre-existing game worlds. Full modding and testing of plant files can be more complex than adding simple recipes and new items. For more details, see Modding Flora.
Encyclopaedia File
The ingame encyclopaedia can be edited. All text is contained in one file:
 GAME.NFO

For more details, see Modding Encyclopaedia. It may be a good idea to add encyclopaedia entries for new and unusual items your mod may be adding to the game to make it easier to use for players.

Seperatoricon.png

Basic Syntax

In this section we're going to open the basic crafting, building, and cooking files, take an example from each, and talk about the component parts and what they mean.

Basic Crafting Parameters

First, open up diy_glossary in a text file, and take a look at the first item listed:
[SUBMENU_START:weapon]
.Stone-axe. [effort:2] [phys:arms] *COMMON*  /3h/
{Stone} [remove]
{Slender trunk} [remove]
{Rope} [remove]
{Knife}
...
[SUBMENU_END:weapon]
[SUBMENU]
Every crafting option in the game is accessible through a menu.  The [SUBMENU] parameter tells the game where you want this particular set of crafting options to appear.  Multiple items can appear in a single submenu.  In this case, the stone axe should show up in the weapon submenu.
Defining which submenu a crafting option appears in is done with the [SUBMENU_START:"Name"] and [SUBMENU_END:"Name"] flags. Start the submenu, add in all the items you wish to appear in that submenu, then end the submenu. Items can be easily added on to the default submenus: lumber, trapping, transport, utility article, weapon, etc.
[SUBMENU_START:MenuName]
<Modded items>
[SUBMENU_END:MenuName]
Custom Menus
By creating a new menudef_<anyname>.txt file it's possible to add sub-menus to the MAKE and COOKERY menus. Just make a list of submenu headers to create in the new file:
.foundry.       -A- *MAKE*
.linen.         -D- *MAKE*
The name of the new submenu starts the line, beginning and ending with a period '.'
The menu key "-A-" starts and ends with a dash, must be specified, and can be any upper case key that does not conflict with a previously defined submenu.
Finally, the parent menu can be defined as *MAKE* or *COOKERY*, to determine where the new submenu shows up.

Then just place the craftable items in your diy_ or cookery_ files between submenu start and end tags for the according submenuname

[SUBMENU_START:submenuname]
[SUBMENU_END:submenuname]
Seperatoricon.png

First Line Parameters

The first line of each item looks something like

.Stone-axe. [effort:2] [phys:arms] *COMMON*  /3h/
.ItemName.
The first element of the first line determines both the default name of the crafted object and how the crafting option appears in the crafting submenu.
.Stone-axe.
The name needs to begin and end with a period and start the line. If you wish to use a different name for the entry in the crafting submenu and the item name, use the submenu entry name here and the name can be redefined elsewhere.
"Base Item"
This property isn't actually used in the diy_glossary file, but is quite useful for mods. If the item you wish to craft isn't a vanilla item like the Stone-axe, then this will determine what item it inherits all of its item properties from (like weight, price, armor, attack, etc.).  This allows you create a Stone Knife, for instance, that is based upon the basic knife.
.Stone Knife. "Knife"
Any vanilla item can be used, and it needs to begin and end with a double quotation mark ".
Be warned that your new item will appear to the game as both the original base item and the new item. So if you create a .Lump of Iron. item that inherits from "Stone" then that item can be used as both a Lump of Iron or as a Stone --- including, for example, when crafting a Cellar or a Stone-Axe. It's wise to use base items that aren't likely to be used as crafting ingredients. Hunting Horn is a commonly used base item, for example.
[effort: ]
When performing any task in the game, from felling a tree to fishing, there is a section labeled "Effort" under your progress meter. This determines how difficult a task is and how much fatigue you gain while performing it.
There are 6 levels of effort:
0: Easy (Not fatiguing at all)
1: Light
2: Moderate
3: Hard
4: Heavy
5: Very Heavy
.Stone-axe. [effort:2] [phys:arms] *COMMON* /3h/
This parameter must be in lowercase. Simply add [effort:X] to the first line of your item to describe how difficult it is to craft. This parameter is optional, and defaults to easy (no fatigue) if not included.
[phys:]
Some crafting tasks have specific physical requirements of the character. Some must be done standing, or require two hands, etc., and may not be able to be done if the character is injured.
Possible tags for this parameter are:
stance              - be standing
arm                 - one arm from shoulder to hand in usable condition
arms                - both arms from shoulder to hand in usable condition
hand                - one hand (plus forearm and elbow) in usable condition
hands               - both hands (plus forearms and elbows) in usable condition
one-armed           - possible to perform the task with only one arm/hand, but it will be slow and difficult.
In all but the last case, the tag describes the requirements for the task.
To use the parameter, add [phys:X] to the first line of your item, where X is a comma-separated list of appropriate tags.
For example, below is a diy version of a javelin recipe:
.Javelin. [effort:1] [phys:hands,one-armed] *COMMON* /30/ [patch]

This recipe states that ideally both hands will be available for the work, but if necessary the task can be performed one-handed.  It will take longer and have lower chance of success in these instances, but it can be done.

*SKILL*
This parameter indicates what skill is used during the crafting task. This affects the quality of the items produced, the time taken, and allows for training of the skill with this task.
All available skills can be used here, as well as *COMMON*. *COMMON* is simply a default skill that is always at skill 50% and can never be increased. This can make it a good reference skill if other skills don't fit well.
.Stone-axe. [effort:2] [phys:arms] *COMMON* /3h/
To use, add the name of the skill you wish to use in all uppercase, beginning and ending with an asterisk *.
The largest impact of skill is on item quality, where the character skill determines the minimum and maximum quality item it is possible to produce with good quality ingredients and tools. Below 20%, no decent items can be made. Below 40%, no fine items can be made. Below 70%, no masterwork items can be made. At 40% no crude items will be made.


/TimeToMake/
This parameter determines how long it takes to complete a particular recipe.  It can take longer than this if your fatigue level is high, your skill is poor, or your tools are poor.
.Stone-axe. [effort:2] [phys:arms] *COMMON* /3h/
This is optional component, and defaults to 15 minutes if not included.  The number is normally read in minutes, but h or d after the number can be included to read in hours or days.
\TimeToComplete\
While /5/ determines how long it takes to actually create the item, \ \ determines how long it must sit after crafting has finished to be ready.  So in the below example, it takes 2 hours to create Charcoal, and another 4 hours after that (during which my character can go do other things) for the item to be ready.  
.Charcoal. [effort:2] [phys:stance,arms] *TIMBERCRAFT* /2h/ \4h\
By including this value the item will sit on the ground where the recipe was completed until it is done.  This is often included in *COOKERY* recipes, but is also familiar from tanning hides.
|Skill Advance|
This parameter indicates how likely a skill increase check is made for the skill used when crafting the item. The lower the number, the less likely you are to be able to increase your skill with this recipe.
.Birch-bark box. [effort:2] [phys:arms] *TIMBERCRAFT* /3h/ |-2|
This parameter defaults to 0, but can range over -2, -1, 0, 1, and 2. Commonly used for simple items to make it difficult to use them to grind up skills.
%SkillModifier%
This value impacts how likely you are to get high quality results from crafting. This can be anywhere between -100 and 100 and acts as a modifier to the skill in question when the recipe is used.
.Stone-axe. [effort:2] [phys:arms] *COMMON* /3h/ %20%
In this case, COMMON is always 50%, so the modified skill value is 70%. This then increases the likelihood of getting the best possible results (i.e., fine).
It is important to note that the skill modifier is only one part of a recipe, and even a recipe that reduces the modified skill to 0% can still regularly get decent or fine quality items if the materials are good and the character's base skill is high.


(NumberProduced)
A number in parentheses in this section indicates how many of the item will be produced per completed recipe. This means that with the resources listed in the recipe, you will wind up with this many items.  This is one of two ways to use a recipe to produce multiple objects, the other is [patch:]
.Stone-axe. (2) *COMMON* /3h/  %20%


[patch:]
This parameter gives you the ability to make a varying amount of the recipe in a single go, and defines the maximum number of items which can be created at one time. The first place many encounter this is in *COOKERY*, where you can set up to 10 items to roast at once over a fire. Unlike with (NumberProduced), the number used for [patch:] acts as a multiplier to both the items used for the recipe (if marked as [patchwise]) and the /TimeToMake/.  If included without a number as [patch], it defaults to 10.
Seperatoricon.png

Ingredients and Related Modifiers

Now that you've finished all the first line parameters, describing the item and the parameters of making it, it's time to move on to describing the ingredients, and how they're handled in the recipe.  This section will describe what tools and resources are required, and what happens to them during crafting.  It is important to note that both tools and resources are treated as ingredients and can, if you choose, be consumed in the process.
{item}
This parameter can occur multiple times following the first line of the recipe, and indicates an ingredient, tool, or other requirement for the recipe.
Let's refer back to our example.
{Stone} [remove]
{Slender trunk} [remove]
{Rope} [remove]
{Knife} 
Each of these lines describes an item required in the creation of our modded object. In this case, the vanilla stone-axe. The first line says we need a stone, and that that stone will be consumed by the recipe.  The first three lines are essentially the same, indicating that a stone, a slender trunk, and a rope will all be required, and all of them will be consumed.  The last line indicates that you must also have any knife available, with the small knife preferred. As it doesn't have the [remove] parameter, the knife will remain after you finish crafting your new axe.
Any item name in the game can be used here --- including the names of new items you have modded into the game. There are also several special general names that can be found in the Reference section at the bottom of this document.
Wildcards
Sometimes you want to allow multiple types of items to be used in a recipe but there's no predefined general name for what you want. To do this, you can use a wildcard *, such as in the following example:
{* leather} [remove]


The * will permit any item whose name ends in "leather" to be used in the recipe.  There are a lot of options here that will be covered in the Advanced Syntax section.
<Preferred Item>
Sometimes you may want to allow a job to be performed with many types of tools, but to prefer a particular type.  In the event that the proper tool isn't available, another tool will stand in, but it will take longer to accomplish.
Referencing our example again, the last item listed is the tool knife.
{Knife} <hunting knife>
In this example any knife would be able to get the job done, but a small knife would make the job go faster. Using a different type of knife may also lower the quality of the item.
There are only a couple of places where this can be done; wildcards cannot be used to define this. In particular, cutting weapons, axes, knives, and shovels can all have a preferred tool set for them.
[remove]
{Stone} [remove]
This parameter indicates that the resource in question will be removed from your inventory upon completion of the recipe. That's pretty much all there is to it. Remember that {item} can be a tool as well as a resource, so it isn't always appropriate to remove an ingredient in your recipe.
(NumberRequired)
When included in the ingredient section after an item, a number in ()'s indicates the number of this item required to perform the task.  For instance:
{Stone} (2) [remove]
Will require two stones in your inventory, both of which will be removed, to complete the recipe.  This is one of the main ways to indicate multiple items being required in a recipe.


#weight#
This parameter contains a numerical value that can be either a whole number, or a decimal.  (%5% vs %.05%)  While it appears that any number of decimal places can be used, it will round up or down to two decimal places.
It is possible to require a certain amount of a resource WITHOUT it being consumed, so the below example would require .5 pounds of rock to use the recipe, but the rock would remain after.
{Rock} #.5#
While the below would remove .5 pounds of rock from your inventory.
{Rock} #.5# [remove]
As a rock object weights 1 pound by default, the following would be seen in your inventory after having done this.
Consuming part of a full object will leave this meter showing.
[patchwise]
Patchwise on ingredients is used when patch is set in the first line of the recipe.  It flags an ingredient as being required for each output item produced, rather than only once for the recipe as a whole. Thus if you have a [patch:10] recipe that takes .5 lbs of rock, without [patchwise] it will always take .5 lbs of rock. With [patchwise] it will take .5 lbs for every item you make, up to the max of 5 lbs when you make 10 items.
{Rock} #.5# [remove] [patchwise]
Seperatoricon.png

Cookery Specific Parameters

One of the primary differences between crafting recipes and cookery recipes, is that the items produced by the cooking recipe can spoil.  Some of the above parameters have slight differences in meaning, but are essentially applied the same way.

(This section heavily influenced by Blaze's Basic Modding Instructions Post on the forum, in some cases taken whole cloth)

\TimeToCook\
This parameter functions exactly like \TimeToComplete\ listed above, with one important exception.  If the time indicated passes, the object will continue to cook.  This will result in the item burning, and the quality of the item progressively getting worse until it becomes 'spoiled'.  Not all recipes have a \TimeToCook\, and are complete as soon as the /TimeToMake/ is up, such as with the .Flatbread. recipe listed below.

Cooking Parameters

Any item not marked with a [roast], [boil], or [bake] tag will NOT contribute their weight/nutrition to the final product. So in the meat stew recipe above; the water will be removed, but will not contribute any weight to the final product.


[roast]
If any item is marked with this tag, you need to be next to a fire.  
[optional]
This parameter primarily appears in cooking recipes, where certain ingredients can be added or omitted, having an end result on the nutritiousness of the produced dish.  In the below example, the seasoning doesn't have to be included in the mix, but will give an added benefit if it is.
.Flatbread. (5)     *COOKERY* /45/  %30% |-1| :148:  
{Flour}     #0.5#   [remove] [roast] [name]
{Water}     #0.25#  [remove] 
{Seasoning} #0.15#  [remove] [roast] [optional]


[boil]
Requires a fire and pot the final product will be stored in the pot.  Any item marked with [boil] or [bake] is limited to the amount the pot can hold. So adding 20lb's of ingredients all marked with the appropriate tags will still result in having a 6lb pot of food.

[bake]
Requires a pot and a "heated room". i.e. a fireplace with embers. The final product will be stored in the pot.
[name: %s]
This is essentially a more intelligent version of [name: ], and marks the end result with name of the ingredient used to make it. In the below recipe, if you use cranberries as the berry ingredient, the result will be called 'Cranberry porridge', rather than 'berry porridge'
.Berry porridge. *COOKERY* /15/   \90\  %50% |-1| :148:  
{Berries}  #1#     [remove] [boil] [name:%s porridge]
{Water}     #0.5#   [remove] 
{Flour}  #0.1#   [remove] [boil] [optional]


The %s can appear anywhere in the name, and it will produce the same results. So 
[name: This %s Thing] = This cranberry thing
[name: Thing %s]      = Thing Cranberry
[name: %s Thing]      = Cranberry Thing

Essentially this takes the name of the item used, such as the cranberrys above, and plugs it in for the %s. Note that:

[name: This %s %s thing] = This cranberry thing.  The second %s is ignored.
Finally, if you use the %s on multiple ingredients, and both ingredients are used, such as in the following:
.Berry porridge. *COOKERY* /15/   \90\  %50% |-1| :148:  
{Berries}  #1#      [remove] [boil] [name:%s porridge]
{Meat}     #1#      [remove] [boil] [name:%s porridge]
{Water}    #0.5#    [remove] 
{Flour}    #0.1#    [remove] [boil] [optional]


The result will be: Mixed Porridge.
:IconNumber:

This is a position of of item's icon (or serie of icons for flora) in a bigsprite.png file. If the end result is made in a pot, then this number is ignored.

Seperatoricon.png

Building Specific Parameters

Seperatoricon.png

Floral Specific Parameters

Seperatoricon.png

Advanced Syntax

The above syntax will help you get started in modding.  These parameters below are intended to refine your recipes further, limiting where they can be done, changing the name of your results, adding in descriptive text to your recipe, and more.


{[TERRAIN: ]}
Sometimes you want a particular recipe to only be applicable when the character is in particular terrain.  In the example below, quartz is only available from river beds.


.Quartz. "Rock" *COMMON* /30/ |-2| %-30% 

{[TERRAIN:river]}


With the {[TERRAIN: } parameter set thusly, this recipe will only be able to be used if the character is in a river terrain.  Anywhere else will send the message "The setting you are at now doesn't meet the requirements!"
Multiple TERRAINS can be specified in this parameter.  In the following example Quartz can be found in both river and mountain terrain.
.Quartz. "Rock" *COMMON* /30/ |-2| %-30% 
{[TERRAIN:river mountain]}
This essentially includes the terrain as a necessary 'ingredient' in the recipe.  But it will show up in your list of ingredients as [TERRAIN: river mountain] which isn't very attractive.  We'll address this further in +'descriptive text'.
{[NEARBY_TILE]}
Not every tile in a local map is a river tile, it includes the shore and some of the surrounding terrain as well.  If you want to insure that the character is both in a river terrain, and next to water, you'll need to create a further specification.  You can do this with the {[NEARBY_TILE]} parameter.
.Quartz. "Rock" *COMMON* /30/ |-2| %-30% 
{[TERRAIN:river]}
{[NEARBY_TILE:water]}
Will indicate that not only does the character need to be in a river terrain, but standing next to (or in) a water tile to use the recipe.  There are many times when this may be appropriate, such as when you want to specify that a character must be next to a natural water tile to soak leather or sticks for some purpose.
{* Wildcards}
The wildcard parameter is useful when you want to make an item able to be made out of any example of a certain class of materials, such as leather.  The below example will require 3 pounds of any kind of leather to create a new item called a 'leather pot', which has all the properties of 'pot'.  Any type, or indeed multiple types, of leather can be used to fill this 3 pound requirement.
.Leather Pot. "Pot" *COMMON* /30/ |-2| %-30% 
{* leather} #3# [remove]

[Name: ]
Sometimes you want the name of a recipe in the list to be different than the name of the object it produces.  An excellent example exists as part of Endives Self Sufficiency Mod, where you can take branches and soak them to create soaked branches, which can then be processed into primitive cord.
.Soak Branches. "Firewood"  *COMMON*  /5/     \1d\  %-30%   [patch:5] |-2|

{Branch} (20) [remove] [patchwise] [name:Soaked Branches]

{Water} #1# [remove] [patchwise]
In the above recipe, it appears in the crafting menu as 'Soak Branches', but the item it produces is 'Soaked Branches'.  A couple things to keep in mind when doing this, the [remove] tag must be included in the line with [name: ] or it won't function.  It's unknown if this is functioning as intended, but it has been proven to be the case in our current modding situation.
There is also a bug with naming. Sometimes for no reason, instead of "Soaked branches" you'll get an unusable "soak branches". No one knows why, but mixing different qualities may be part of the bug. Until this bug is fixed, it is better just name things .Soaked Branches. to begin with and not rely on [name:Soaked Branches]
+'descriptive text'
The TERRAIN: and NEARBY_TERRAIN: parameters seen without +'descriptive text'
When putting together a recipe, such as the above one involving quartz, you may want to make it do something to explain what the components are for to add immersion, or hide an ugly {[TERRAIN: } tag in your recipe.  This is where +'descriptive text' comes in.  Let's reference the quartz recipe again:
.Quartz. "Rock" *COMMON* /30/ |-2| %-30% 
{[TERRAIN:river]}
{[NEARBY_TILE:water]}


In this example, [TERRAIN:river] will show up as one of the requirements for the recipe, as will [NEARBY_TILE:water], as seen in the image above.  To prevent this, a modification to the recipe must be made.
With +'descriptive text'
.Quartz. "Rock" *COMMON* /30/ |-2| %-30% 
{[TERRAIN:river]} +'Be near a river'
{[NEARBY_TILE:water]} +'Be by the water'
With the +'descriptive text' parameter added, it instead will show like the image on the right.  



[Ground]

When an item must be on the ground next to a character rather than in it's inventory, you'll add this parameter to the ingredient line it's on.  Stealing another item from the self-sufficiency mod, we have an example of an item that must be on the ground or in the characters inventory to use this recipe.  In this case, a log.

.Bow Stave. "Board" *CARPENTRY* %-10% /3h/ 
{Log} [remove] [ground]
{Axe} <Woodsman's Axe>


[NoQuality]
You have some control over the quality of products created by using the [noquality] tag.
When you don't want an ingredient, {item} to affect the quality of the .item. being produced make use of the [noquality] tag.
For the example below: .Shortbow. quality is affected by; carpentry skill, board quality, axe quality, knife quality and tying equipment quality.
.Shortbow. [effort:2] [phys:stance,arms] *CARPENTRY*		/320/ |2|
{Board} [remove] 
{Axe} <Carving axe>
{Knife}
{Tying equipment} [remove]
As all the ingredients have quality, all contribute to final shortbow quality.
When you have ingredients that shouldn't contribute to the final product quality use the [noquality] tag.
For the example below: .Arrow. The {Branch} and the {Rock} are the type of base items which you may want to remove from the quality calculation to achieve higher quality product.
.Arrow. [effort:1] [phys:hands,one-armed]  	*CARPENTRY*        /30/    [patch:5]
{Branch} [remove] [patchwise] [noquality]
{Knife}
{Tying equipment} [remove] [patchwise] 
{Rock} [remove] [patchwise] [noquality]
The .Arrow. quality is affected by; carpentry skill, knife quality and tying equipment quality.
Placing [noquality] between [phys:] [noquality] *SKILL* will produce decent product output.
.Shortbow. [effort:2] [phys:stance,arms] [noquality]   *CARPENTRY*		/320/ |2|
{Board} [remove] 
{Axe} <Carving axe>
{Knife}
{Tying equipment} [remove]
Seperatoricon.png

Reference

Menu List

Seperatoricon.png

Item List

This is a starting list of items that can be used as parts of a recipe.  It is definitely incomplete, but it is relatively safe to assume that any object in the game can be used as part of a recipe, though it may yield unexpected results.  This list will be expanded as appropriate.


List of Items usable in {item} (Likely Incomplete)

Animal Hide Leather Raw meat or fish
Cooking pot Heated Fireplace Threshing Tool
Flail Beater Root vegetables
Vegetables Grinding Stone Berries
Seeds Grains Container
Water Raw ingredients Flour
Raw meat Raw Fish Fire
Cutting Weapon or by hand Tying Equipment Axe
Knife Cutting Weapon Cloth
Mushrooms Flowers Herbs
Seasoning Shovel Cover for kota
Tanning material Heated Fireplace
Seperatoricon.png

Tile List

A rather comprehensive list of valid values for use in the {[TILE:]} and {[NEARBY_TILE:]} parameters. 

List of Valid Values for {[TILE:]} or {[NEARBY_TILE:]}

Water Ground Ford Lichenous Pine Forest
River Rapids Sea Grove
Shutter Big Rock Fence Heathland
Road Cave Fireplace Young Pine
Sleeping Bunk Open door Bench Pine
Camp Shelter Spruce Spruce mire
Birch Inside of a Kota Framework Thicket
Kota doorway Rowan Alder Cellar
Hole in the Ground Young Spruce Coniferous Forest Prepared Soil
Settlement Armory Weaponsmith Food Storehouse
Fish Storehouse Fishing Shed Bowyer Hideworker
Granary Goods Shed Metalsmith North-west corner of a Kota
Mountain Southern Wall Northern Wall North-east corner of a kota
Hill Pine mire South-west corner South-west corner of a kota
Open mire Bushes North-west corner South-east corner of a kota
Village Fortified Village Eastern wall Northern wall of a kota
Table Field Western Wall Southern wall of a kota
Pasture Door North-east corner Eastern wall of a kota
Surface of the Earth Inside of a building South-east corner Western wall of a kota
Cave Floor High Cliff
Seperatoricon.png

Terrain List

This is a list of values that are valid in the {[TERRAIN: ]} parameter.  Some of the types apply to multiple terrains, and we have incomplete information on those.  The values on the left are word of Sami Please check {[TERRAIN:cave]} seems to work properly in v3.19.

Valid {[TERRAIN: ]} Values Applies to Terrain types
barren
lake
pond
river
dryish
dry
fresh
grove
open_mire
spruce_mire

pine_mire

wetland
settlement

meadow

clearing
field
cliff
mountain
Seperatoricon.png

Quick and Dirty Tutorials

A simple mining widget.

Open or create menudef_name.txt file and add:

.mining. -A- *MAKE*
Where .mining. is the new menu to add to the Make menu.
-A- or any letter that is not in use on the Make menu, this is the quick key for the menu.
This sets *MAKE* to be the parent menu.

Open or edit diy_name.txt and add:

[SUBMENU_START:mining]
.Miner Pick. "Wooden shovel" [effort:2] *COMMON* /30/
.Mine Ore. "Stone" [effort:3] [phys:stance,arms,hands] *COMMON* /2h/
{[TERRAIN:cave]} 'You need find a cave'
{[NEARBY_TILE:Cave floor]} 'Get underground to dig'
{[NEARBY_TILE:High cliff]} 'Find vein in cave wall'
{Miner Pick} <Miner pick> 'A miner pick for digging'
[SUBMENU_END:mining]
[SUBMENU_START:mining] marks the start of the items that will appear on the "mining" menu.
.Miner Pick. creates an item named "Miner pick" with an item type of "Wooden shovel" (appears as shovel on ground).
The effort is moderate (2) to make the pick. *the skill applied to make the pick is Common.
The pick will take 30 minutes to make. I have not filled in needed items or tools to make the pick.
.Mine Ore. creates an item named "Mine Ore" with an item type of "Stone" (appears as stone on ground).
The effort to mine one ore hard (3). Physical [phys:] needs standing position and both arms and hands to do without penalty.
The skill applied to the task is Common. The task will take 2 hrs.
The Terrain and nearby tile tags mean you must be in cave terrain, inside the actual cave and against a wall to mine.