Modding:Block Json Properties: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
(14 intermediate revisions by 4 users not shown)
Line 4: Line 4:


<table id="treeviewtable" class="table table-bordered tt-table" style='table-layout: fixed'>
<table id="treeviewtable" class="table table-bordered tt-table" style='table-layout: fixed'>
   <tr style='background-color: gray;'>
   <tr>
     <th width='300' align='left'>Property</th>
     <th width='300' align='left'>Property</th>
     <th width='200' align='left'>Type</th>
     <th width='200' align='left'>Type</th>
Line 17: Line 17:
   </tr>
   </tr>
   <tr>
   <tr>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Core (no byType available)</b></td>
     <td colspan="4" class="propHeader"><b>Core (no byType available)</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 89: Line 89:
----
----


Futhermore there are two ways of combining groups together. So far we covered the default combination mode, which is <code>multiplicative</code> (the total count of variants is the product of all states).
Furthermore there are two ways of combining groups together. So far we covered the default combination mode, which is <code>multiplicative</code> (the total count of variants is the product of all states).


Let's take a look at a different example (flowerpot), which uses the <code>additive</code> combination mode:
Let's take a look at a different example (flowerpot), which uses the <code>additive</code> combination mode:
Line 173: Line 173:
"*-south-*-closed-right": 180
"*-south-*-closed-right": 180
}
}
},
</syntaxhighlight>
Since Vintagestory v1.8 it is also possible to use the variantgroup as a placeholder:
<syntaxhighlight lang="json">
variantgroups: [
{ code: "type", states: ["normal", "bamboo"] },
],
textures: {
horizontals: { base: "block/hay/{type}-side" },
verticals: { base: "block/hay/{type}-top" },
},
},
</syntaxhighlight>
</syntaxhighlight>
Line 178: Line 189:
   </tr>
   </tr>
   <tr>
   <tr>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Specific</b></td>
     <td colspan="4" class="propHeader"><b>Specific</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 208: Line 219:
     <td>array of object</td>
     <td>array of object</td>
     <td>-</td>
     <td>-</td>
     <td>A behavior adds custom abilities such as falling block..</td>
     <td>A behavior adds custom abilities such as falling block.</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_behaviors_info" data-tt-parent="p_behaviors" data-invisible="true"></div></td>
     <td scope="row"><div class="tt" data-tt-id="p_behaviors_info" data-tt-parent="p_behaviors" data-invisible="true"></div></td>
     <td colspan="3">
     <td colspan="3">
Here is an overview of all exisiting behaviors, if you want to create your own custom behavior you can read [[Adding Block Behavior]].
Here is an overview of most exisiting behaviors, if you want to create your own custom behavior you can read [[Adding Block Behavior]].
To see all of the current behaviors in the game see [[Json:block:behaviors|All Block Behaviors]]
{{:json:block:behavior}}
{{:json:block:behavior}}
</td>
</td>
Line 285: Line 297:
Same examples of resistance's values used in VintageStory:
Same examples of resistance's values used in VintageStory:
<table class="wikitable">
<table class="wikitable">
   <tr style="background-color: grey;">
   <tr style="background-color: rgba(0,0,0,0.2);">
     <th style="background-color: grey;">Block</th>
     <th style="background-color: rgba(0,0,0,0.2);">Block</th>
     <th style="background-color: grey;">Value</th>
     <th style="background-color: rgba(0,0,0,0.2);">Value</th>
   </tr>
   </tr>
   <tr>
   <tr>
Line 330: Line 342:
     <td colspan="3">
     <td colspan="3">
<table class="wikitable">
<table class="wikitable">
   <tr style="background-color: grey;">
   <tr style="background-color: rgba(0,0,0,0.2);">
     <th style="background-color: grey;">Tier</th>
     <th style="background-color: rgba(0,0,0,0.2);">Tier</th>
     <th style="background-color: grey;">Ores</th>
     <th style="background-color: rgba(0,0,0,0.2);">Ores</th>
   </tr>
   </tr>
   <tr>
   <tr>
Line 479: Line 491:
     <td colspan="3">
     <td colspan="3">
<table class="wikitable">
<table class="wikitable">
   <tr style="background-color: grey;">
   <tr style="background-color: rgba(0,0,0,0.2);">
     <th style="background-color: grey;">Value</th>
     <th style="background-color: rgba(0,0,0,0.2);">Value</th>
     <th style="background-color: grey;">Effect (Blocks)</th>
     <th style="background-color: rgba(0,0,0,0.2);">Effect (Blocks)</th>
   </tr>
   </tr>
   <tr>
   <tr>
Line 520: Line 532:
     <td colspan="3">
     <td colspan="3">
<table class="wikitable">
<table class="wikitable">
   <tr style="background-color: grey;">
   <tr style="background-color: rgba(0,0,0,0.2);">
     <th style="background-color: grey;">Value</th>
     <th style="background-color: rgba(0,0,0,0.2);">Value</th>
     <th style="background-color: grey;">Effect</th>
     <th style="background-color: rgba(0,0,0,0.2);">Effect</th>
   </tr>
   </tr>
   <tr>
   <tr>
Line 549: Line 561:
     <td colspan="3">
     <td colspan="3">
<table class="wikitable">
<table class="wikitable">
   <tr style="background-color: grey;">
   <tr style="background-color: rgba(0,0,0,0.2);">
     <th style="background-color: grey;">Blocks</th>
     <th style="background-color: rgba(0,0,0,0.2);">Blocks</th>
     <th style="background-color: grey;">Value</th>
     <th style="background-color: rgba(0,0,0,0.2);">Value</th>
   </tr>
   </tr>
   <tr>
   <tr>
Line 592: Line 604:
     <td colspan="3">
     <td colspan="3">
<table class="wikitable">
<table class="wikitable">
   <tr style="background-color: grey;">
   <tr style="background-color: rgba(0,0,0,0.2);">
     <th style="background-color: grey;">Blocks</th>
     <th style="background-color: rgba(0,0,0,0.2);">Blocks</th>
     <th style="background-color: grey;">Value</th>
     <th style="background-color: rgba(0,0,0,0.2);">Value</th>
   </tr>
   </tr>
   <tr>
   <tr>
Line 617: Line 629:
     <td colspan="3">
     <td colspan="3">
<table class="wikitable">
<table class="wikitable">
   <tr style="background-color: grey;">
   <tr style="background-color: rgba(0,0,0,0.2);">
     <th style="background-color: grey;">Blocks</th>
     <th style="background-color: rgba(0,0,0,0.2);">Blocks</th>
     <th style="background-color: grey;">Value</th>
     <th style="background-color: rgba(0,0,0,0.2);">Value</th>
   </tr>
   </tr>
   <tr>
   <tr>
Line 658: Line 670:


<table class="wikitable">
<table class="wikitable">
   <tr style="background-color: grey;">
   <tr style="background-color: rgba(0,0,0,0.2);">
     <th style="background-color: grey;">Property</th>
     <th style="background-color: rgba(0,0,0,0.2);">Property</th>
     <th style="background-color: grey;">Default</th>
     <th style="background-color: rgba(0,0,0,0.2);">Default</th>
<th style="background-color: grey;">Explanation</th>
<th style="background-color: rgba(0,0,0,0.2);">Explanation</th>
   </tr>
   </tr>
   <tr>
   <tr>
Line 676: Line 688:
     <td>'''lastdrop'''</td>
     <td>'''lastdrop'''</td>
<td>false</td>
<td>false</td>
<td>If true and the quantity dropped is >=1 any subsequent drop will be ignored.</td>
<td>If true and the quantity dropped is >=1 any subsequent drop in the list will be ignored.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 733: Line 745:
'''''var''''': How much the drop rate can vary. Meaning the drop rate can be <code>avg - var</code> at minimum and <code>age + var</code> at maximum.
'''''var''''': How much the drop rate can vary. Meaning the drop rate can be <code>avg - var</code> at minimum and <code>age + var</code> at maximum.


Futhermore you can also switch between different distribution modes using the '''''dist''''' property.
For more information see [[NatFloat]] page.
 
<table class="wikitable mw-collapsible mw-collapsed">
  <tr>
<th colspan="2">Overview - Distribution modes</th>
  </tr>
  <tr style="background-color: grey;">
    <th style="background-color: grey;">Name</th>
<th style="background-color: grey;">Explanation</th>
  </tr>
  <tr>
    <td>'''uniform'''</td>
<td>''Select completely random numbers within avg-var until avg+var.''</td>
  </tr>
  <tr>
    <td>'''triangle'''</td>
<td>''Select random numbers with numbers near avg being the most commonly selected ones, following a triangle curve.''</td>
  </tr>
  <tr>
    <td>'''gaussian'''</td>
<td>''Select random numbers with numbers near avg being the most commonly selected ones, following a gaussian curve.''</td>
  </tr>
  <tr>
    <td>'''narrowgaussian'''</td>
<td>''Select random numbers with numbers near avg being the most commonly selected ones, following a narrow gaussian curve.''</td>
  </tr>
  <tr>
    <td>'''inversegaussian'''</td>
<td>''Select random numbers with numbers near avg being the least commonly selected ones, following an upside down gaussian curve.''</td>
  </tr>
  <tr>
    <td>'''narrowinversegaussian'''</td>
<td>''Select random numbers with numbers near avg being the least commonly selected ones, following an upside down gaussian curve.''</td>
  </tr>
  <tr>
    <td>'''invexp'''</td>
<td>''Select numbers in the form of avg + var, wheras low value of var are preferred.''</td>
  </tr>
  <tr>
    <td>'''stronginvexp'''</td>
<td>''Select numbers in the form of avg + var, wheras low value of var are strongly preferred.''</td>
  </tr>
  <tr>
    <td>'''strongerinvexp'''</td>
<td>''Select numbers in the form of avg + var, wheras low value of var are very strongly preferred.''</td>
  </tr>
<tr>
    <td>'''dirac'''</td>
<td>''Select completely random numbers within avg-var until avg+var only ONCE and then always 0.''</td>
  </tr>
</table>


----
----
Line 911: Line 873:
   </tr>
   </tr>
   <tr>
   <tr>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Common</b></td>
     <td colspan="4" class="propHeader"><b>Common</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,002: Line 964:
     <td>key: string, value: object</td>
     <td>key: string, value: object</td>
     <td>-</td>
     <td>-</td>
     <td>Custom Attributes that's always assiociated with this item.</td>
     <td>Custom Attributes associated with this block.</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_attributes_info" data-tt-parent="p_attributes" data-invisible="true"></div></td>
     <td scope="row"><div class="tt" data-tt-id="p_attributes_info" data-tt-parent="p_attributes" data-invisible="true"></div></td>
     <td colspan="3">
     <td colspan="3">
Extra attributes added to a block. Those are final and cannot be modified. It's a good way to keep things oragnized and and modifiable. The '''oreblastingbomb''' for example has attributes, which define its radius and type. These can be used by behaviors and blockentities:
Extra attributes added to a block. Those are final and cannot be modified. It's a good way to keep things organized and and modifiable. The '''oreblastingbomb''' for example has attributes, which define its radius and type. These can be used by behaviors and blockentities:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
     attributes: {
     attributes: {
Line 1,026: Line 988:
     <td>integer</td>
     <td>integer</td>
     <td>-</td>
     <td>-</td>
     <td>The temperature at which it burns.</td>
     <td>The temperature at which it burns in degrees Celsius.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,032: Line 994:
     <td>decimal number</td>
     <td>decimal number</td>
     <td>-</td>
     <td>-</td>
     <td>For how long it burns.</td>
     <td>For how long it burns in seconds.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,038: Line 1,000:
     <td>integer</td>
     <td>integer</td>
     <td>500</td>
     <td>500</td>
     <td>How many degrees celsius it can resists before it ignites.</td>
     <td>How many degrees celsius it can resists before it ignites (not implemented yet).</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,044: Line 1,006:
     <td>integer</td>
     <td>integer</td>
     <td>-</td>
     <td>-</td>
     <td>How many degrees celsius it takes to smelt/transform this into another. Only used when put in a stove and Melted is set.</td>
     <td>How many degrees celsius it takes to smelt/transform this into another. Only used when put in a stove and SmeltedStack is set.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,074: Line 1,036:
     <td>boolean</td>
     <td>boolean</td>
     <td>true</td>
     <td>true</td>
     <td>If set, the block/item is smeltable in a furnace and this is the resulting itemstack once the MeltingPoint has been reached for the supplied duration.</td>
     <td>If set to true, the block/item requires a smelting/cooking/baking container such as the Crucible. If false, it can be directly baked/melted without smelting/cooking/baking container.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,087: Line 1,049:
</syntaxhighlight>
</syntaxhighlight>


Futhermore it can be used to define smelting processes. An example would be an '''ingotmold''' which turns into an ingotmold-burned:
Furthermore it can be used to define smelting processes. An example would be an '''ingotmold''' which turns into an ingotmold-burned:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
     combustiblePropsByType: {
     combustiblePropsByType: {
Line 1,126: Line 1,088:
   </tr>
   </tr>
   <tr>
   <tr>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Rendering</b></td>
     <td colspan="4" class="propHeader"><b>Rendering</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,132: Line 1,094:
     <td>key: string, value: object</td>
     <td>key: string, value: object</td>
     <td></td>
     <td></td>
     <td>The texture definitions for the block as seen in the world, when dropped on the ground or held in the hand.</td>
     <td>The texture definitions for the block as seen in the world, when dropped on the ground or held in the hand. Within a mod, to refer to a texture from the base game, prefix the path with "game:" (i.e. base: "game:path/to/texture") </td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,346: Line 1,308:
     <td></td>
     <td></td>
     <td>2</td>
     <td>2</td>
     <td>Culls all faces that are adjacent to opaque faces and faces adjacent to blocks of the same id.</td>
     <td>Culls all faces that are adjacent to opaque faces and faces adjacent to blocks of the same id (Example usage: Ice blocks).</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,352: Line 1,314:
     <td></td>
     <td></td>
     <td>3</td>
     <td>3</td>
     <td>Culls all faces that are adjacent to opaque faces and the bottom, east or south faces adjacent to blocks of the same id. This causes to still leave one single face inbetween instead of 2, eliminating any z-fighting.</td>
     <td>Culls all faces that are adjacent to opaque faces and the bottom, east or south faces adjacent to blocks of the same id. This causes to still leave one single face in between instead of 2, eliminating any z-fighting.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,358: Line 1,320:
     <td></td>
     <td></td>
     <td>4</td>
     <td>4</td>
     <td>Same as Merge but checks for equal material.</td>
     <td>Same as Merge but checks for equal material (Example usage: Plain glass and all colored glass blocks).</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,364: Line 1,326:
     <td></td>
     <td></td>
     <td>5</td>
     <td>5</td>
     <td>Same as Collapse but checks for equal material.</td>
     <td>Same as Collapse but checks for equal material (Example usage: All leaves blocks).</td>
   </tr>
   </tr>
   <tr>
   <tr>
Confirmedusers, Bureaucrats, editor, Administrators
1,778

edits