Modding:Basic Block: Difference between revisions
From Vintage Story Wiki
CreativeMD (talk | contribs) No edit summary |
CreativeMD (talk | contribs) No edit summary |
||
Line 84: | Line 84: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td><div class="tt" data-tt-id="root"> | <td><div class="tt" data-tt-id="root">json</div></td> | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
Line 177: | Line 177: | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_shapebytype" data-tt-parent="root">shapebytype</div></td> | |||
<td>object</td> | |||
<td></td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_ambientocclusion" data-tt-parent="root">ambientocclusion</div></td> | |||
<td>boolean</td> | |||
<td>true</td> | |||
<td>if ambient occlusion will be applied to the block</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_blockmaterial" data-tt-parent="root">blockmaterial</div></td> | |||
<td>string</td> | |||
<td></td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_drawtype" data-tt-parent="root">drawtype</div></td> | |||
<td>enum</td> | |||
<td>cube</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_blockLayer_1" data-tt-parent="p_drawtype">blockLayer_1</div></td> | |||
<td></td> | |||
<td>0</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_blockLayer_2" data-tt-parent="p_drawtype">blockLayer_2</div></td> | |||
<td></td> | |||
<td>1</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_blockLayer_3" data-tt-parent="p_drawtype">blockLayer_3</div></td> | |||
<td></td> | |||
<td>2</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_blockLayer_4" data-tt-parent="p_drawtype">blockLayer_4</div></td> | |||
<td></td> | |||
<td>3</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_blockLayer_5" data-tt-parent="p_drawtype">blockLayer_5</div></td> | |||
<td></td> | |||
<td>4</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_blockLayer_6" data-tt-parent="p_drawtype">blockLayer_6</div></td> | |||
<td></td> | |||
<td>5</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_blockLayer_7" data-tt-parent="p_drawtype">blockLayer_7</div></td> | |||
<td></td> | |||
<td>6</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_json" data-tt-parent="p_drawtype">json</div></td> | |||
<td></td> | |||
<td>7</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_empty" data-tt-parent="p_drawtype">empty</div></td> | |||
<td></td> | |||
<td>8</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_cube" data-tt-parent="p_drawtype">cube</div></td> | |||
<td></td> | |||
<td>9</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_cross" data-tt-parent="p_drawtype">cross</div></td> | |||
<td></td> | |||
<td>10</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_transparent" data-tt-parent="p_drawtype">transparent</div></td> | |||
<td></td> | |||
<td>11</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_liquid" data-tt-parent="p_drawtype">liquid</div></td> | |||
<td></td> | |||
<td>12</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_crossandsnowlayer" data-tt-parent="p_drawtype">crossandsnowlayer</div></td> | |||
<td></td> | |||
<td>13</td> | |||
<td></td> | <td></td> | ||
</tr> | </tr> | ||
</table> | </table> |
Revision as of 11:19, 5 January 2017
This tutorial should introduce you into the basic of adding a block to the game using JSON files. Down below you can find a complete list of all existing properties. If your block requires more than just a JSON file there is a tutorial for Advanced Blocks.
A Simple Block
Let's add a simple block to the game. In our example we will add a new wooden planks type.
The Texture
First of all we need a texture. We will add a spruce wood plank to the game using this texture: File:Spruce1.png.
Now we need to copy the texture to the game assets. Therefore navigate to the Vintagestory folder and place it in assets\textures\blocks\wood\planks\
The JSON file
Testing
Export a mod
Advanced Properties
Properties Overview
A complete list of all available properties:
- Json File
- code (string)
- maxstacksize (number): default: 64
- enabled (boolean): default: true; If the block will be added to game or not.
- randomdrawoffset (boolean): default: false; If the block has a random draw offset.
- renderpass
- opaque (default)
- opaquenocull
- transparent
- liquid
- topsoil
- variantgroups (array)
- loadFromProperties
- creativeinventory
- default
- shapeinventory
- shape
- base
- shapebytype
- ambientocclusion (boolean): default: true; If ambient occlusion will be applied to the block.
- blockmaterial
- drawtype
- blockLayer_1
- blockLayer_2
- blockLayer_3
- blockLayer_4
- blockLayer_5
- blockLayer_6
- blockLayer_7
- json
- empty
- cube
- cross
- transparent
- liquid
- crossandsnowlayer
- textures
- texturesinventory
- texturesbytype
- texturesinventorybytype
- resistance
- sounds
- place
- walk
- break
- hit
- inside
Property | Type | Default | Usage |
---|---|---|---|
json |
|||
code |
string | empty | |
maxstacksize |
number | 64 | determines the maximum amount you can stack the block in one slot |
enabled |
boolean | true | if the block will be added to game or not |
renderpass |
enum | opaque | |
opaque |
0 | default blocks | |
opaquenocull |
1 | ||
transparent |
2 | ||
liquid |
3 | ||
topsoil |
4 | ||
variantgroups |
arrays | ||
creativeinventory |
arrays | ||
shapeinventory |
object | ||
base |
|||
shape |
object | ||
base |
|||
shapebytype |
object | ||
ambientocclusion |
boolean | true | if ambient occlusion will be applied to the block |
blockmaterial |
string | ||
drawtype |
enum | cube | |
blockLayer_1 |
0 | ||
blockLayer_2 |
1 | ||
blockLayer_3 |
2 | ||
blockLayer_4 |
3 | ||
blockLayer_5 |
4 | ||
blockLayer_6 |
5 | ||
blockLayer_7 |
6 | ||
json |
7 | ||
empty |
8 | ||
cube |
9 | ||
cross |
10 | ||
transparent |
11 | ||
liquid |
12 | ||
crossandsnowlayer |
13 |