Modding:Content Tutorial Further Recipes: Difference between revisions

From Vintage Story Wiki
m
no edit summary
mNo edit summary
Line 124: Line 124:
     "allowedVariants": [ "blue", "fire" ]
     "allowedVariants": [ "blue", "fire" ]
   },
   },
 
 
    
    
   "output": {
   "output": {
Line 133: Line 131:
   }
   }
}
}
</syntaxhighlight>Clayforming recipes only have one input and one output, and luckily the input is always clay. You can specify the allowed types of clay using the ''allowedVariants'' property. When finished, this recipe will allow you to make 12 clay bricks by using clayforming.
The interesting part of this recipe type (as well as some others) is the ''pattern'' property. This property is an array of string arrays, essentially offering us a 2D-text representation of the 3D voxel pattern.
Sometimes, these patterns are hard to visualize. Paste the following between the ingredient and output properties.
{| class="wikitable mw-collapsible mw-collapsed"
|Clayforming pattern property...
|-
|<syntaxhighlight lang="json">
"pattern": [
    [
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###"
    ],
    [
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###"
    ]
  ],
</syntaxhighlight>
</syntaxhighlight>
|}
It's a rather bulky bit of code, but see if you can visualize how this will look in 3D. Each array (contained by '''[ ]''') is an individual height layer for the clayforming. Note that we use an underscore ( '''_''' ) for an empty space, and a hash sign ('''#''') for a filled voxel.
Clayforming recipes must be between 16x16, and have a maximum height of 16.
After adding the pattern, the clayforming recipe is complete!
{| class="wikitable mw-collapsible mw-collapsed"
!bricks.json
|-
|<syntaxhighlight lang="json">
{
  "ingredient": {
    "type": "item",
    "code": "game:clay-*",
    "name": "type",
    "allowedVariants": [ "blue", "fire" ]
  },
  "pattern": [
    [
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###"
    ],
    [
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###",
      "___________",
      "###_###_###",
      "###_###_###"
    ]
  ],
  "name": "rawbrick",
  "output": {
    "type": "item",
    "code": "game:rawbrick-{type}",
    "stacksize": 12
  }
}
</syntaxhighlight>
|}


== Conclusion ==
== Conclusion ==
Confirmedusers
538

edits