Difference between revisions of "Recipes"

From wiki
Jump to: navigation, search
m (Config Options)
(learnt icon)
 
(6 intermediate revisions by one other user not shown)
Line 57: Line 57:
  
  
Next up is the main meat of this file. The next property "ingredients" is a list of all crafting components you will need before starting. This list of items actually follows [[Items#Universal Spawning Rules]], but in most cases you can use an item's code. There is one difference, which is that in this case it can take a value "quantity" in order to specify how many items are needed. Note that Tiles and Clothing cannot be just a "code" and "quantity". Next up is the "steps". This is a list of all crafting steps in order, with each step being a separate [[Reactions|Reaction Code]]. This will make the list of steps to follow. Following that is "result", which has two properties inside of it. The first property "item" is again another [[Items#Universal Spawning Rules|Spawned Item]], this time without "quantity". "count" is then the replacement for the "quantity" property.
+
Next up is the main meat of this file. The next property "ingredients" is a list of all crafting components you will need before starting. This list of items actually follows [[Items#How to Spawn an Item]], but in most cases you can use an item's code. There is one difference, which is that in this case it can take a value "quantity" in order to specify how many items are needed. Note that Tiles and Clothing cannot be just a "code" and "quantity". Next up is the "steps". This is a list of all crafting steps in order, with each step being a separate [[Reactions|Reaction Code]]. This will make the list of steps to follow. Following that is "result", which has two properties inside of it. The first property "item" is again another [[Items#How to Spawn an Item|Spawned Item]], this time without "quantity". "count" is then the replacement for the "quantity" property.
  
  
Line 76: Line 76:
 
= Config Options =
 
= Config Options =
 
== "code" ==
 
== "code" ==
'''Valid options (String): <code>A unique string which recipe what this object is.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A unique string which recipe what this object is.</code>'''
  
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 
'''Default Value:''' No default value is specified. Always need to provide your own.
Line 86: Line 86:
  
  
== "categories" ==
+
== "categories" ==  
'''Valid options (List of Strings): <code>A list of valid strings.</code>'''
+
'''Valid options ([[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#String|Strings]]): <code>A list of valid strings.</code>'''
  
'''Default Value:''' If not specified, will just have no defined categories.  
+
'''Default Value:''' If not specified, will not have any user defined categories.
  
  
This is a list of categories for searching. These are also used in order to check if an item can complete achievements.
+
This is a list of strings which are used to identify what the tile actually is. These terms can all be searched for in the Catalogue/Creative Menu, but are also used in [[Totems]] and [[Achievements]]. Certain categories will appear under certain tabs in either menu. These include:
 +
 
 +
<code>"block", "door", "floor"/"flooring", "flower", "furniture", "light", "plant", "tool", "window", "misc", "red", "orange", "yellow", "green", "blue", "purple", "pink", "white", "black" and "brown"</code>
  
  
Line 105: Line 107:
  
 
== "icon" ==
 
== "icon" ==
'''Valid options (String): <code>A string which contains the path to an model file.</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which contains the path to an model file.</code>'''
  
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 
'''Default Value:''' No default value is specified. Always need to provide your own.
Line 111: Line 113:
  
 
This option points to a model file. This will be the model that will be displayed for the recipe's item.
 
This option points to a model file. This will be the model that will be displayed for the recipe's item.
 +
 +
 +
== "learntIcon" ==
 +
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string which contains the path to an model file.</code>'''
 +
 +
'''Default Value:''' No default value is specified. Always need to provide your own.
 +
 +
 +
This option points to a model file. This will be the model that will be displayed for the learnt recipe's item.
  
  
 
== "ingredients" ==
 
== "ingredients" ==
'''Valid options (List of Spawn Item): <code>A list of Items to be spawned. See [[Items#Universal Spawning Rules]] for more information.</code>'''
+
'''Valid options ([[Modding_Key_Terms#List|List]] of Spawn Item): <code>A list of Items to be spawned. See [[Items#How to Spawn an Item]] for more information.</code>'''
  
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 
'''Default Value:''' No default value is specified. Always need to provide your own.
Line 134: Line 145:
  
 
== "priority" ==
 
== "priority" ==
'''Valid options (Int): <code>An integer number.</code>'''
+
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>An integer number.</code>'''
  
 
'''Default Value:''' If not specified, will default to the largest integer value possible. (2147483647)
 
'''Default Value:''' If not specified, will default to the largest integer value possible. (2147483647)
Line 143: Line 154:
  
 
== "grouping" ==
 
== "grouping" ==
'''Valid options (String): <code>Depends on "type". If "cooking" then "starters", "desserts", "mainCourses". If "crafting" then "wood".</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>Depends on "type". If "cooking" then "starters", "desserts", "mainCourses". If "crafting" then "stone", "wood".</code>'''
  
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 
'''Default Value:''' No default value is specified. Always need to provide your own.
Line 164: Line 175:
  
 
=== "item" ===
 
=== "item" ===
'''Valid options (Spawn Item): <code>An Items to be spawned. See [[Items#Universal Spawning Rules]] for more information.</code>'''
+
'''Valid options (Spawn Item): <code>An Items to be spawned. See [[Items#How to Spawn an Item]] for more information.</code>'''
  
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 
'''Default Value:''' No default value is specified. Always need to provide your own.
Line 173: Line 184:
  
 
=== "count" ===
 
=== "count" ===
'''Valid options (Int): <code>A positive integer number.</code>'''
+
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>A positive integer number.</code>'''
  
 
'''Default Value:''' If not specified, will default to 1.
 
'''Default Value:''' If not specified, will default to 1.
Line 182: Line 193:
  
 
== "searchable" ==
 
== "searchable" ==
'''Valid options (Bool): <code>True or False</code>'''
+
'''Valid options ([[Modding_Key_Terms#Bool|Bool]]): <code>True or False</code>'''
  
 
'''Default Value:''' If not specified, will default to False.
 
'''Default Value:''' If not specified, will default to False.
  
  
This is whether or not the recipe item will be allowed to be searched for in the creative menu.
+
This option specifies if the object whether the object will show up when it is searched for in the shop catalogue or the creative inventory. This is useful for objects with auto tiling info, as you only want a single version of that tile appearing.
  
  
 
== "stackSizeLimit" ==
 
== "stackSizeLimit" ==
'''Valid options (Int): <code>An integer number.</code>'''
+
'''Valid options ([[Modding_Key_Terms#Integer|Integer]]): <code>Any valid positive integer.</code>'''
  
'''Default Value:''' If not specified, will default to 1.
+
'''Default Value:''' If not specified, will default to DefaultRecipeStackSizeLimit = 1.
 +
 
 +
 
 +
This is the number of tiles that you can hold in a single slot of your inventory, or in a [[Docks|Dock]].
 +
 
 +
 
 +
=== "descriptionImage" ===
 +
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>A string containing the path to an image file.</code>'''
 +
 
 +
'''Default Value:''' If not specified, will not show an image in the description.
 +
 
 +
 
 +
This is an image that will show up in the description window.
 +
 
 +
 
 +
== "canBeGifted" ==
 +
'''Valid options ([[Modding_Key_Terms#Bool|Bool]]): <code>True or False</code>'''
 +
 
 +
'''Default Value:''' If not specified, will default to True.
 +
 
 +
 
 +
Allows the recipe to be given as a gift to a [[Villager NPCs|Villager NPC]].
 +
 
 +
 
 +
== "starter" ==
 +
'''Valid options ([[Modding_Key_Terms#Bool|Bool]]): <code>True or False</code>'''
 +
 
 +
'''Default Value:''' If not specified, will default to False.
  
  
This is the amount of items that can be placed inside of a single inventory slot or dock.
+
This specifies if the recipe is automatically learnt for all players upon the start of the world.  
  
  
 
== "steps" ==
 
== "steps" ==
'''Valid options (List of Strings): <code>A list of strings which each contain a [[Reactions|Reaction Code]].</code>'''
+
'''Valid options ([[Modding_Key_Terms#List|List]] of [[Modding_Key_Terms#String|Strings]]): <code>A list of strings which each contain a [[Reactions|Reaction Code]].</code>'''
  
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 
'''Default Value:''' No default value is specified. Always need to provide your own.
Line 209: Line 247:
  
 
== "type" ==
 
== "type" ==
'''Valid options (String): <code>"cooking" or "crafting"</code>'''
+
'''Valid options ([[Modding_Key_Terms#String|String]]): <code>"cooking" or "crafting"</code>'''
  
 
'''Default Value:''' No default value is specified. Always need to provide your own.
 
'''Default Value:''' No default value is specified. Always need to provide your own.

Latest revision as of 11:58, 3 November 2020

In Staxel, *.recipe files are used to specify any recipe located in the recipe tab in the game. These recipes contain several things;

  • List of all steps to get the resultant item
  • List of all base ingredients to get the resultant item
  • The item to unlock the recipe

Recipes do not make items, but specify the process in order to make an item. If you want to add actual crafting to the game, this is done by Reactions.


Adding New Recipes to Staxel

Staxel allows you to easily add your own recipes into staxel without needing to touch any of Staxel's files.

While not as necessary for recipes, make sure to follow #Setting up for Mod Creation first. Once this is done, create a file with an ending of .recipe, and place the following into it.

{
  "type" : "crafting",
  "code": "staxel.crafting.recipes.DoorFrame",
  "grouping": "wood",
  "ingredients": [
    {
      "code" : "staxel.item.crafting.Glue",
      "quantity" : 1
    },
    {
      "code" : "staxel.item.crafting.Lumber",
      "quantity" : 3
    },
    {
      "code" : "staxel.item.crafting.CheapVarnish",
      "quantity" : 2
    }
  ],
  "steps": [
    "staxel.crafting.reaction.AssembleLargeWoodenFrame",
    "staxel.crafting.reaction.CarveDoorFrame"
  ],
  "result": {
    "item": {
      "kind" : "staxel.item.Placer",
      "tile" : "staxel.tileObject.serverVillage.DoorFrame"
    },
    "count": 1
  },
  "icon" : "staxel/crafting/recipes/Blueprint.qb",
  "inHandRotation" : { "x" : 0.0, "y" : 1.54, "z" : -1.54 },
  "searchable": true,
  "pricing": {
    "value": 6972.0,
    "sellPrice": 4183.0
  }
}

Feel free to edit these values however you want. These values allow you to change how this recipe will act. Each of these properties are for a separate feature of the recipe. The first property, "code", is known as the identifier of this recipe. This is basically a unique name that the game can always rely on to find this recipe. The recommendation for this property is to make it the filepath to your file but replace "\" with ".", as the file path is always guaranteed to be unique. The second "type" is which tab this crafting will be in. Currently there are two main tabs "cooking" and "crafting" both of which are found in the inventory screen. The third "grouping" is what sub tab this recipe will be in. This varies for each "type". "cooking" can be either "desserts", "mainCourses" or "starters". While "crafting" can be "wood".


Next up is the main meat of this file. The next property "ingredients" is a list of all crafting components you will need before starting. This list of items actually follows Items#How to Spawn an Item, but in most cases you can use an item's code. There is one difference, which is that in this case it can take a value "quantity" in order to specify how many items are needed. Note that Tiles and Clothing cannot be just a "code" and "quantity". Next up is the "steps". This is a list of all crafting steps in order, with each step being a separate Reaction Code. This will make the list of steps to follow. Following that is "result", which has two properties inside of it. The first property "item" is again another Spawned Item, this time without "quantity". "count" is then the replacement for the "quantity" property.


The following properties are actually to do with the Item that will give the recipe. The next property "icon" is the path to a model file that the game will use as the icon for the game. Act like this is kinda like Tile#"voxels". "inHandRotation" which specifies how the item will be rotated in the hand. This property uses Radians and not Degrees. "searchable" is whether or not the item can be searched in the creative inventory. The final property is the Pricing Component which is an optional extra. (Though not optional if you want to sell the recipe) The first property is "value" which tells you how much the recipe can be bought for. "sellPrice" on the other hand is how much the recipe can be sold for.


With that you have created an recipe. Once you have content built, you can see this recipe in the creative menu.

Useful components

Recipes can use any components that are suited to Items however the majority are useless. There is one main component that is useful however.

Pricing Component

This component is used to specify the prices and locations that this recipe can be bought or sold for/at. This is required if you don't want the recipe to live in the creative menu.

For more information on how to use the Pricing Component, head to Pricing Component#When and How to use.


Config Options

"code"

Valid options (String): A unique string which recipe what this object is.

Default Value: No default value is specified. Always need to provide your own.


This option is required to uniquely identify any object or resource. This string must be unique to all other codes, but does not have any other requirements.

For example: Having the code "mods.testrecipe.recipe1" creates an object that has the handle "mods.testrecipe.recipe1".


"categories"

Valid options (List of Strings): A list of valid strings.

Default Value: If not specified, will not have any user defined categories.


This is a list of strings which are used to identify what the tile actually is. These terms can all be searched for in the Catalogue/Creative Menu, but are also used in Totems and Achievements. Certain categories will appear under certain tabs in either menu. These include:

"block", "door", "floor"/"flooring", "flower", "furniture", "light", "plant", "tool", "window", "misc", "red", "orange", "yellow", "green", "blue", "purple", "pink", "white", "black" and "brown"


"descriptionImage"

Valid options (String): A string containing the path to an image file.

Default Value: If not specified, will not show an image in the description.


This is an image that will show up in the description window.


"icon"

Valid options (String): A string which contains the path to an model file.

Default Value: No default value is specified. Always need to provide your own.


This option points to a model file. This will be the model that will be displayed for the recipe's item.


"learntIcon"

Valid options (String): A string which contains the path to an model file.

Default Value: No default value is specified. Always need to provide your own.


This option points to a model file. This will be the model that will be displayed for the learnt recipe's item.


"ingredients"

Valid options (List of Spawn Item): A list of Items to be spawned. See Items#How to Spawn an Item for more information.

Default Value: No default value is specified. Always need to provide your own.


These are the ingredients that the player should have before starting this recipe. Ingredients can be the most basic items, or items that require their own recipes. Each ingrediant can also include an optional property labelled "quantity". This property tells the game how many of that item is required before starting.

Note: If this list is getting too long for you tastes, drop a step and use that step's results instead of using only basic items.


"inHandRotation"

Valid options (Vector 3 - Float): { "x": 0.0, "y": 0.0, "z": 0.0 }

Default Value: No default value is specified. Always need to provide your own.


This is the rotation of the item in the player's hand. This is used to make sure the item is facing the correct direction. Rotations are in Radians and not Degrees.


"priority"

Valid options (Integer): An integer number.

Default Value: If not specified, will default to the largest integer value possible. (2147483647)


This specifies the position in the crafting menu that will appear. Lower numbers will be placed higher in the list. If two recipes have the same priority then it will default to sorting alphabetically.


"grouping"

Valid options (String): Depends on "type". If "cooking" then "starters", "desserts", "mainCourses". If "crafting" then "stone", "wood".

Default Value: No default value is specified. Always need to provide your own.


This practically specifies what sub tab this recipe will go under. These tabs are found under the main tabs towards the left.


"result"

This is the item that should be expected by the end of the crafting process. It will usually look like;

"result": {
  "item": {
    "kind" : "staxel.item.Placer",
    "tile" : "staxel.tileObject.serverVillage.DoorFrame"
  },
  "count": 1
},

"item"

Valid options (Spawn Item): An Items to be spawned. See Items#How to Spawn an Item for more information.

Default Value: No default value is specified. Always need to provide your own.


This is the final item that the player should expect to receive for their troubles.


"count"

Valid options (Integer): A positive integer number.

Default Value: If not specified, will default to 1.


The amount of the final item that the player should expect.


"searchable"

Valid options (Bool): True or False

Default Value: If not specified, will default to False.


This option specifies if the object whether the object will show up when it is searched for in the shop catalogue or the creative inventory. This is useful for objects with auto tiling info, as you only want a single version of that tile appearing.


"stackSizeLimit"

Valid options (Integer): Any valid positive integer.

Default Value: If not specified, will default to DefaultRecipeStackSizeLimit = 1.


This is the number of tiles that you can hold in a single slot of your inventory, or in a Dock.


"descriptionImage"

Valid options (String): A string containing the path to an image file.

Default Value: If not specified, will not show an image in the description.


This is an image that will show up in the description window.


"canBeGifted"

Valid options (Bool): True or False

Default Value: If not specified, will default to True.


Allows the recipe to be given as a gift to a Villager NPC.


"starter"

Valid options (Bool): True or False

Default Value: If not specified, will default to False.


This specifies if the recipe is automatically learnt for all players upon the start of the world.


"steps"

Valid options (List of Strings): A list of strings which each contain a Reaction Code.

Default Value: No default value is specified. Always need to provide your own.


This is the list of steps needed to get the ingredients to the final result. These must be in the order that you complete them.


"type"

Valid options (String): "cooking" or "crafting"

Default Value: No default value is specified. Always need to provide your own.


This practically specifies what main tab this recipe will go under. These tabs are found in the inventory menu, near the top.