Modding:Creating Recipes/es: Difference between revisions

From Vintage Story Wiki
Created page with "=== Copia de atributos === Algunas recetas pueden requerir copiar atributos. Esto se puede hacer añadiendo <code>copyAttributesFrom</code>. Esta es la receta para la caja etiquetada: <syntaxhighlight lang="json"> { ingredientPattern: "S,C", ingredients: { "S": { type: "item", code: "paper-parchment" }, "C": { type: "block", code: "crate" } }, shapeless: true, copyAttributesFrom: 'C', width: 1, height: 2, output: { type: "block", code: "crate", attributes:..."
No edit summary
(Created page with "=== Copia de atributos === Algunas recetas pueden requerir copiar atributos. Esto se puede hacer añadiendo <code>copyAttributesFrom</code>. Esta es la receta para la caja etiquetada: <syntaxhighlight lang="json"> { ingredientPattern: "S,C", ingredients: { "S": { type: "item", code: "paper-parchment" }, "C": { type: "block", code: "crate" } }, shapeless: true, copyAttributesFrom: 'C', width: 1, height: 2, output: { type: "block", code: "crate", attributes:...")
 
(18 intermediate revisions by the same user not shown)
Line 64: Line 64:
Esto haría que el pico pierda uno de durabilidad durante la elaboración, en lugar de consumir todo el pico a la vez.
Esto haría que el pico pierda uno de durabilidad durante la elaboración, en lugar de consumir todo el pico a la vez.


=== Output ===
=== Salida ===


We still need to define the output, which is rather similar to defining the ingredients:
Todavía tenemos que definir la salida, que es bastante similar a la definición de los ingredientes:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
output: { type: "item", code: "wand-pickaxe"}
output: { type: "item", code: "wand-pickaxe"}
</syntaxhighlight>
</syntaxhighlight>


Theoretically, we could add the <code>quantity</code> property here as well.
Teóricamente, también podríamos añadir aquí la propiedad <code>quantity</code>.


=== Distributing ===
== Distribución ==


This is what our final recipe looks like:
Este es el aspecto de nuestra receta final:


<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
Line 90: Line 90:
</syntaxhighlight>
</syntaxhighlight>


In order to add those crafting recipes to your mod, you have to create another folder in your workspace <code>assets/myadvancedwand/recipes/grid/</code> and copy the files in there.
Para añadir esas recetas de fabricación a tu mod, tienes que crear otra carpeta en tu espacio de trabajo <code>assets/mivaritaavanzada/recipes/grid/</code> y copiar los archivos ahí.


You can download the full mod including the items (Pre 1.15)[[Media:MyWandRecipe.zip|here]].
Puedes descargar el mod completo incluyendo los items (Pre 1.15)[[Media:MyWandRecipe.zip|aquí]].


== Advanced ==
== Advanzado ==


=== Type based recipes ===
=== Recetas basadas en tipos ===


There are more complicated things you can do with recipes. This the recipe for wooden planks which are crafted out of logs:
Hay cosas más complicadas que se pueden hacer con las recetas. Esta es la receta de los tablones de madera que se fabrican con troncos:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
Line 111: Line 111:
</syntaxhighlight>
</syntaxhighlight>


Instead of having a recipe for every wood type, you can assign a name to an ingredient (in this case it is <code>name: "wood"</code>) and everything identified by <code>*</code> will later on replaced be for the output. Meaning <code>{wood}</code> will be replaced by the type of the giving log.
En lugar de tener una receta para cada tipo de madera, puede asignar un nombre a un ingrediente (en este caso es <code>name: "wood"</code>) y todo lo identificado por <code>*</code> será posteriormente sustituido para la salida. Es decir, <code>{wood}</code> se sustituirá por el tipo de leña que se dé.


For example if we would have a birch log block, its code would be <code>log-birch-ud</code>, so <code>*</code> would stand for <code>birch</code>, therefore the output will be converted from <code>code: "planks-{wood}-hor"</code> to <code>code: "planks-birch-hor"</code>.
Por ejemplo si tuviéramos un bloque de troncos de abedul, su código sería <code>log-birch-ud</code>, por lo que <code>*</code> significaría <code>birch</code>(abedul), por lo tanto la salida se convertirá de <code>code: "planks-{wood}-hor"</code> a <code>code: "planks-birch-hor"</code>.


=== Converting an ingredient to another item upon crafting ===
=== Convertir un ingrediente en otro objeto al fabricarlo ===
Sometimes you want to keep one or more of the ingredients, but convert them to a different item after crafting. For example, when crafting a honey-sulfur poultice, the player needs a bowl filled with honey, but the bowl is not consumed to craft it. Instead the bowl of honey is turned into an empty bowl. This is accomplished by adding the <code>returnedStack</code> property to the ingredient. This property's value needs to contain a <code>type</code> and <code>code</code> just like the standard ingredient properties. This tells the recipe which item to give the player back.
A veces querrás conservar uno o varios ingredientes, pero convertirlos en un objeto diferente después de fabricarlo. Por ejemplo, para fabricar una cataplasma de miel y azufre, el jugador necesita un cuenco lleno de miel, pero el cuenco no se consume para fabricarla. El cuenco de miel se convierte en un cuenco vacío. Esto se consigue añadiendo la propiedad <code>returnedStack</code> al ingrediente. El valor de esta propiedad debe contener un <code>type</code> y un <code>code</code>, al igual que las propiedades estándar de los ingredientes. Esto le indica a la receta qué elemento debe devolver al jugador.


Continuing with the honey-sulfur poultice example, a bowl of honey as an ingredient looks like <code>"B": { type: "block", code: "bowl-honey" }</code>, but the player would lose the bowl if the recipe were written this way. We need to add <code>returnedStack</code> to the ingredient's properties and indicate which item to replace it with. In this case, the player should receive an empty bowl in place of the bowl of honey <code>returnedStack: { type: "block", code: "bowl-burned" }</code>. This property is placed alongside the <code>type</code> and <code>code</code> properties of an ingredient. Putting it all together:
Siguiendo con el ejemplo de la cataplasma de miel y azufre, un cuenco de miel como ingrediente tiene el siguiente aspecto <code>"B": { type: "block", code: "bowl-honey" }</code>, pero el jugador perdería el cuenco si la receta estuviera escrita así. Tenemos que añadir <code>returnedStack</code> a las propiedades del ingrediente e indicar con qué elemento reemplazarlo. En este caso, el jugador debería recibir un cuenco vacío en lugar del cuenco de miel <code>returnedStack: { type: "block", code: "bowl-burned" }</code>. Esta propiedad se coloca junto a las propiedades <code>type</code> y <code>code</code> de un ingrediente. Poniéndolo todo junto:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
Line 137: Line 137:
</syntaxhighlight>
</syntaxhighlight>


=== Consuming more than one durability per tool ===
=== Consumir más durabilidad por herramienta ===
To balance durability consuming, it can be done by adding <code>toolDurabilityCost</code> and <code>isTool</code>. This is recipe for pulverizer pounder:
Para equilibrar la durabilidad que consume, se puede hacer mediante la adición de <code>toolDurabilityCost</code> y <code>isTool</code>. Esta es la receta para el mazo de pulverizador:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
Line 153: Line 153:
</syntaxhighlight>
</syntaxhighlight>


=== Separating recipes on the same handbook page ===
=== Separar recetas en la misma página del manual ===
Sometimes amount of recipes for one item can become overwhelming, to separate important ones, it can be done by adding <code>recipeGroup</code>. These are recipes for wooden ladder:
A veces la cantidad de recetas para un artículo puede llegar a ser abrumadora, para separar las importantes, se puede hacer mediante la adición de <code>recipeGroup</code>. Estas son las recetas para la escalera de madera:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
Line 178: Line 178:
</syntaxhighlight>
</syntaxhighlight>


=== Restricting to a specific class ===
=== Restringir a una clase específica ===
The recipe can be limited to a specific [[Classes|class]]. This can be done by adding <code>requiresTrait</code>. This is recipe for sewing kit:
La receta puede limitarse a una [[Classes/es|clase]] específica. Esto se puede hacer añadiendo <code>requiresTrait</code>. Esta es la receta para el kit de costura:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
Line 194: Line 194:
</syntaxhighlight>
</syntaxhighlight>


=== Copying attributes ===
=== Copia de atributos ===
Some recipes can require to copy attributes. This is can be done by adding <code>copyAttributesFrom</code>. This is recipe for labeled crate:
Algunas recetas pueden requerir copiar atributos. Esto se puede hacer añadiendo <code>copyAttributesFrom</code>. Esta es la receta para la caja etiquetada:  
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
Confirmedusers
9,523

edits