Confirmedusers, editor, Administrators
886
edits
CreativeMD (talk | contribs) |
CreativeMD (talk | contribs) No edit summary |
||
(9 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
__FORCETOC__ | __FORCETOC__ | ||
Please read the tutorial [[Getting Started]] first, if you haven't done it already. This tutorial should introduce you into the basic of adding a block to the game using JSON files. If you want to add a block with functionality you should check out the tutorial for [[Advanced Blocks]]. There is a full list of all properties which can be defined inside the json file [[Block Json Properties|here]]. | Please read the tutorial [[Getting Started with Advanced Modding#Domains|Getting Started]] first, if you haven't done it already. This tutorial should introduce you into the basic of adding a block to the game using JSON files. If you want to add a block with functionality you should check out the tutorial for [[Advanced Blocks]]. There is a full list of all properties which can be defined inside the json file [[Block Json Properties|here]]. | ||
= A Simple Block = | = A Simple Block = | ||
Line 27: | Line 27: | ||
code: "mygoldblock", | code: "mygoldblock", | ||
creativeinventory: { "general": ["*"] }, | creativeinventory: { "general": ["*"] }, | ||
blockmaterial: "Stone", | blockmaterial: "Stone", | ||
drawtype: "Cube", | drawtype: "Cube", | ||
Line 67: | Line 66: | ||
The last thing we need to do is to create a zip file of the assets folder inside our workspace. Either you use an external program (such as WinRAR or 7Zip) or you right-click the <code>assets</code> folder and hit '''Send To''' -> '''Compressed (zipped) folder'''. Eventually you can rename the zip file to <code>MyGoldBlockMod.zip</code>. The zip file can be either used for testing purposes or you can send it to other people so they can use it as well. | The last thing we need to do is to create a zip file of the assets folder inside our workspace. Either you use an external program (such as WinRAR or 7Zip) or you right-click the <code>assets</code> folder and hit '''Send To''' -> '''Compressed (zipped) folder'''. Eventually you can rename the zip file to <code>MyGoldBlockMod.zip</code>. The zip file can be either used for testing purposes or you can send it to other people so they can use it as well. | ||
Furthermore you need to add a <code>modinfo.json</code> file, check out [[Game_Content_Mod|this tutorial]]. | |||
To install the mod, navigate to the [[Vintagestory | To install the mod, navigate to the [[Vintagestory folder]] and place it inside the mods folder. | ||
[https://wiki.vintagestory.at/images/4/4c/MyGoldBlockMod.zip MyGoldBlockMod.zip] | |||
[[File:2017-01-10 12-33-45.png|700px]]. | [[File:2017-01-10 12-33-45.png|700px]]. | ||
'''Hint''': Use the client command <code>.tfedit</code> if you want to adjust the block position, rotation and scale in Hands, in GUI, when dropped on the ground or in third person mode. | |||
= Advanced Properties = | = Advanced Properties = | ||
Line 156: | Line 159: | ||
{ code: "type", states: ["gold", "iron"] } | { code: "type", states: ["gold", "iron"] } | ||
], | ], | ||
blockmaterial: "Stone", | blockmaterial: "Stone", | ||
drawtype: "cube", | drawtype: "cube", | ||
Line 212: | Line 214: | ||
In order to use a custom shape we need to create one first. The engine only supports the model/shape format that's created by the [[VS Model Creator]]. | In order to use a custom shape we need to create one first. The engine only supports the model/shape format that's created by the [[VS Model Creator]]. | ||
Once you have created your own shape you need to export it as a json file, create a new folder <code>assets/myshinyblock/shapes/block/</code> and save the file in there. In our example we will use this model [ | Once you have created your own shape you need to export it as a json file, create a new folder <code>assets/myshinyblock/shapes/block/</code> and save the file in there. In our example we will use this model [https://wiki.vintagestory.at/images/3/38/Myshinymodel.json Myshinymodel.json] and move it to <code>assets/myshinyblock/shapes/block/myshinymodel.json</code>. | ||
Now we need to specify the model inside our block type json file. | Now we need to specify the model inside our block type json file. | ||
Line 241: | Line 243: | ||
== Variants of Custom Shapes == | == Variants of Custom Shapes == | ||
I created another model for the blocks in good condition ([ | I created another model for the blocks in good condition ([https://wiki.vintagestory.at/images/f/fa/Myshinymodel1.json myshinymodel1.json]), because they should look more awesome, than the ones in used conditions. Therefore we need to copy the json file to <code>assets/myshinyblock/shapes/block/</code> as well. | ||
In order to specify the shape by type we need to remove the property <code>shape</code> and replace it with <code>shapebytype</code>: | In order to specify the shape by type we need to remove the property <code>shape</code> and replace it with <code>shapebytype</code>: | ||
Line 257: | Line 259: | ||
[[File:2017-01-12 14-51-45.png|700px]] | [[File:2017-01-12 14-51-45.png|700px]] | ||
[ | [https://wiki.vintagestory.at/images/4/42/MyShinyBlockMod.zip MyShinyBlockMod] | ||
There are a lot of more things you can do with the blocktype and model formats. We recommend you to take a look at the Vintage Story block type files to understand how the system is working, in case something was left unexplained. | There are a lot of more things you can do with the blocktype and model formats. We recommend you to take a look at the Vintage Story block type files to understand how the system is working, in case something was left unexplained. | ||
We hope we could introduce you into the basic of adding blocks the game. [[Advanced Blocks]] will teach you how to add more functionality to your block. | We hope we could introduce you into the basic of adding blocks the game. [[Advanced Blocks]] will teach you how to add more functionality to your block. | ||
{{Navbox/modding|Vintage Story}} |