Modding:Basic Block: Difference between revisions

From Vintage Story Wiki
No edit summary
No edit summary
Line 78: Line 78:
<table id="treeviewtable" class="table table-bordered tt-table">
<table id="treeviewtable" class="table table-bordered tt-table">
   <tr>
   <tr>
     <th>#</th>
     <th width='300'>Property</th>
     <th>First Name</th>
     <th>Type</th>
     <th>Last Name</th>
     <th>Default</th>
    <th style="width:400px">Graph here</th>
     <th>Usage</th>
     <th>Username</th>
   </tr>
   </tr>
   <tr>
   <tr>
     <th scope="row">1</th>
     <td><div class="tt" data-tt-id="root">Json</div></td>
    <td>Mark</td>
     <td></td>
     <td>Otto</td>
     <td></td>
     <td>
     <td></td>
      <div class="tt" data-tt-id="root">Mark</div>
    </td>
     <td>@mdo</td>
   </tr>
   </tr>
   <tr>
   <tr>
    <th scope="row">2</th>
     <td scope="row"><div class="tt" data-tt-id="p_code" data-tt-parent="root">code</div></td>
    <td>Jacob</td>
     <td>string</td>
    <td>Thornton</td>
     <td>empty<td>
    <td>
     <td>Usage</td>
      <div class="tt" data-tt-id="jacob" data-tt-parent="root">Jacob</div>
    </td>
     <td>@fat</td>
  </tr>
  <tr>
    <th scope="row">3</th>
    <td>Larry</td>
    <td>the Bird</td>
    <td>
      <div class="tt" data-tt-id="larry" data-tt-parent="root">Larry</div>
    </td>
     <td>@<a href="http://www.jqueryscript.net/tags.php?/twitter/">twitter</a></td>
  </tr>
  <tr>
    <th scope="row">4</th>
     <td>Tony</td>
    <td>the Bird</td>
    <td>
      <div class="tt" data-tt-id="tony" data-tt-parent="larry">Tony</div>
    </td>
    <td>@twitter</td>
  </tr>
  <tr>
    <th scope="row">1</th>
    <td>Mark</td>
    <td>Otto</td>
    <td>
      <div class="tt" data-tt-id="asd">Mark</div>
    </td>
     <td>@mdo</td>
   </tr>
   </tr>
</table>
</table>

Revision as of 10:48, 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 Usage