Confirmedusers, editor, Administrators
886
edits
CreativeMD (talk | contribs) |
CreativeMD (talk | contribs) |
||
Line 211: | Line 211: | ||
In order to use a custom shape we need to create one first. Therefore we can use the [[VS Model Creator]]. | In order to use a custom shape we need to create one first. Therefore we can use the [[VS Model Creator]]. | ||
Once you have created your own shape you need to export it as a json file and move it to <code>assets/shapes/blocks/</code>. In our example we will use this model [http://wiki.vintagestory.at/images/3/38/Myshinymodel.json Myshinymodel.json] and move it to <code>assets/shapes/blocks/metal/myshinymodel.json</code>. | |||
Now we need to specify the model inside our block type json file (<code>assets/blocktypes/metal/myshinyblock.json</code>). | |||
Therefore we will change the drawtype from <code>cube</code> to <code>json</code>: | |||
<syntaxhighlight lang="json"> | |||
drawtype: "json", | |||
</syntaxhighlight> | |||
and the shape to <code>metal/myshinymodel</code> | |||
<syntaxhighlight lang="json"> | |||
shape: { base: "metal/myshinymodel" }, | |||
</syntaxhighlight> | |||
Although this would be theoretically enough, we also should determine this block as being non-solid, to prevent graphical glitches. | |||
<syntaxhighlight lang="json"> | |||
sidesolid: { | |||
all: "false" | |||
}, | |||
sideopaque: { | |||
all: "false" | |||
}, | |||
</syntaxhighlight> | |||
So let's run the game. This is how it should look like: | |||
[[File:2017-01-12 14-06-27.png|700px]] | |||
== Variants of Custom Shapes == | == Variants of Custom Shapes == |