Modding:Basic Block: Difference between revisions

From Vintage Story Wiki
m
no edit summary
m (Add quotes around json keys.)
mNo edit summary
 
(9 intermediate revisions by 5 users not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{GameVersion|1.15}}
{{GameVersion|1.19}}
__FORCETOC__
__FORCETOC__
{{PageOutdated|lookat={{ll|Modding:Content_Tutorial_Simple_Block|the simple block tutorial|nsp=0}}}}


<!--T:2-->
<!--T:2-->
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]].
Please read about the {{ll|Modding:Asset System|nsp=1}} 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 = <!--T:3-->
= A Simple Block = <!--T:3-->
Line 21: Line 22:


<!--T:8-->
<!--T:8-->
We will use this texture for our block: [[File:Gold block.png]].
We will use this texture for our block: [[File:Gold block.png]]. <br>
(To create your own textures, you can use programs like [https://www.dotpdn.com/downloads/pdn.html/ PaintDotNet(free)], [https://www.piskelapp.com/ Piskel(free)], or [https://github.com/aseprite/aseprite/ Aseprite(free open source, or pay for precompiled)])


<!--T:9-->
<!--T:9-->
Line 88: Line 90:


<!--T:23-->
<!--T:23-->
To install the mod, navigate to the [[Vintagestory folder]] and place it inside the mods folder.
To install the mod, navigate to the [[VintagestoryData folder]] and place it inside the mods folder.


<!--T:24-->
<!--T:24-->
Line 144: Line 146:


<!--T:40-->
<!--T:40-->
Now we need to change a few things in our json file. We can add all kinds of different groups, but for now we keep it simple. We are adding group called <code>type</code>, with the states <code>gold</code> and <code>iron</code>. You can use any group code you want.
Now we need to change a few things in our json file. We can add all kinds of different groups, but for now we keep it simple. We are adding a [[Modding:Registry_Object_JSON_Parsing|variant group]] called <code>type</code>, with the states <code>gold</code> and <code>iron</code>. You can use any group code you want.
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
"variantgroups": [
"variantgroups": [
Line 302: Line 304:
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>:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
shapebytype: {
"shapebytype": {
"*-good": {
"*-good": {
base: "block/myshinymodel1",
"base": "block/myshinymodel1",
},
},
"*-used": {
"*-used": {
base: "block/myshinymodel",
"base": "block/myshinymodel",
},
},
},
},
Line 324: Line 326:


<!--T:70-->
<!--T:70-->
The example shown here, while seemingly complex, only scratches the surface of what blocktypes are capable of in Vintage Story. It's highly suggested that you experiment with or at least familiarize yourself with all the known block properties before moving onto code mods. The best way to do this is to peruse the '''[[Modding:Block Json Properties | Block Properties]]''' page, which contains an ongoing list of all the usable JSON block properties currently incorporated into the game. Most properties in the list also have referenced files you can search for in the Vintage Story Assets folder. If you don't know where this is, you can find tutorials for each operating system at the [[Modding:The Asset System | Asset System]] page.  
The example shown here, while seemingly complex, only scratches the surface of what blocktypes are capable of in Vintage Story. It's highly suggested that you experiment with or at least familiarize yourself with all the known block properties before moving onto code mods. The best way to do this is to peruse the '''[[Modding:Block Json Properties | Block Properties]]''' page, which contains an ongoing list of all the usable JSON block properties currently incorporated into the game. Most properties in the list also have referenced files you can search for in the Vintage Story Assets folder. If you don't know where this is, you can find tutorials for each operating system at the {{ll|Modding:Asset System|nsp=0}} page.  


<!--T:71-->
<!--T:71-->
Line 337: Line 339:


<!--T:74-->
<!--T:74-->
{{Navbox/modding|Vintage Story}}
{{Navbox/contentmodding}}
</translate>
</translate>
Confirmedusers
570

edits