Modding:Basic Block: Difference between revisions

From Vintage Story Wiki
Line 135: Line 135:
</syntaxhighlight>
</syntaxhighlight>


Every group will be added after each other to the blocks name <code>myblockname-mygroup-mysecondgroup</code>. In our example the block name is ignorable so its replaced by <code>*</code>.


You can also use a more compact definition. The placeholder {type} corresponds to the code of the variant group you defined earlier. It will be filled in the individual item in your variant group list.
You can also use a more compact definition. Due to way we named our textures we can use the placeholder {type} to determine the texture name, so instead of taken care of every case we can do it like this:


<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
Line 146: Line 147:
},
},
</syntaxhighlight>
</syntaxhighlight>
Every group will be added after each other to the blocks name <code>myblockname-mygroup-mysecondgroup</code>. In our example the block name is ignorable so its replaced by <code>*</code>.


Eventually your file should look like this:
Eventually your file should look like this:
Line 162: Line 159:
blockmaterial: "Stone",
blockmaterial: "Stone",
drawtype: "cube",
drawtype: "cube",
texturesbytype: {
textures: {
"*-gold": {
all: {  
all: {
base: "metal/my{type}texture",
base: "metal/mygoldtexture",
alternates: [{base: "metal/my{type}texture1" }, {base: "metal/my{type}texture2" }, {base: "metal/my{type}texture3" }],
alternates: [{base: "metal/mygoldtexture1" }, {base: "metal/mygoldtexture2" }, {base: "metal/mygoldtexture3" }],
},
},
},
"*-iron": {
all: {
base: "metal/myirontexture",
alternates: [{base: "metal/myirontexture1" }, {base: "metal/myirontexture2" }, {base: "metal/myirontexture3" }],
},
}
},
},
resistance: 3.5,
resistance: 3.5,