Modding:Item Json Properties: Difference between revisions

From Vintage Story Wiki
(5 intermediate revisions by 2 users not shown)
Line 17: Line 17:
'''Int''' - An integer, or whole number. Cannot use decimal values.  
'''Int''' - An integer, or whole number. Cannot use decimal values.  


'''Float''' - A decimal, specifically one that does not exceed more than 1 significiant digit
'''Float''' - A decimal, specifically one that does not exceed more than 1 significant digit


'''Object''' - This is a bit more complex, but essentially objects are the items, blocks and entities that can be interacted with. In most cases, when an "object" type appears it means you must use a specific item variant code, which follows the "itemcode-variant_1-variant_2-variant_n" style of naming.  
'''Object''' - This is a bit more complex, but essentially objects are the items, blocks and entities that can be interacted with. In most cases, when an "object" type appears it means you must use a specific item variant code, which follows the "itemcode-variant_1-variant_2-variant_n" style of naming.  
Line 548: Line 548:
<tr>
<tr>
   <td scope="row"><div class="tt" data-tt-id="p_alist_tindex" data-tt-parent="p_alist_waterprops">tintIndex</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_alist_tindex" data-tt-parent="p_alist_waterprops">tintIndex</div></td>
  <td>number (0,1 or 2)</td>
    <td>integer</td>
  <td>-</td>
    <td>0</td>
  <td>An optional liquid property that tints the color of a liquid when in a container. Available options are 0(red), 1(green) and 2(blue).</td>
    <td>Tints the color of the item if it's ever drawn as a block: '''''0''''' for no tint, '''''1''''' for plant climate tint, '''''2''''' for water climate tint.</td>
    <td>-</td>
   <td>waterportion, limewater</td>
   <td>waterportion, limewater</td>
</tr>
</tr>
Line 583: Line 584:
<tr>
<tr>
   <td scope="row"><div class="tt" data-tt-id="p_alist_spillstack" data-tt-parent="p_alist_whenspill">stack</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_alist_spillstack" data-tt-parent="p_alist_whenspill">stack</div></td>
   <td>key: {type: item/block, code: object}</td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>The block or item dropped when spilled. if the "PlaceBlock" action is chosen a block is placed, if "DropContents" is used an item is generated.</td>
   <td>The block or item dropped when spilled. if the "PlaceBlock" action is chosen a block is placed, if "DropContents" is used an item is generated.</td>
Line 590: Line 591:
<tr>
<tr>
   <td scope="row"><div class="tt" data-tt-id="p_alist_sfilllevel" data-tt-parent="p_alist_whenspill">stackByFillLevel</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_alist_sfilllevel" data-tt-parent="p_alist_whenspill">stackByFillLevel</div></td>
   <td><td>key:{string (number) {type: item/block, code: object}}</td></td>
   <td>-</td>
   <td>-</td>
   <td>-</td>
   <td>Allows for different blocks or items to be placed based on the level of the liquid in the container.</td>
   <td>Allows for different blocks or items to be placed based on the level of the liquid in the container.</td>
Line 619: Line 620:


Most is self explanatory, but we can see that it has a some unique features, such as allowing a player to generate a water block when the "fill level" of the container used to spill the fluid. We can also see that the texture for it has a tintIndex of 2, which heightens the blue coloration of the water texture while in a bucket.
Most is self explanatory, but we can see that it has a some unique features, such as allowing a player to generate a water block when the "fill level" of the container used to spill the fluid. We can also see that the texture for it has a tintIndex of 2, which heightens the blue coloration of the water texture while in a bucket.
</tr>
</tr>


<tr>
<tr>
Line 664: Line 661:
   <td>Changes the background color of the additional slots provided by the bag. Requires a HEX color code, which you can find with any generic color picker</td>
   <td>Changes the background color of the additional slots provided by the bag. Requires a HEX color code, which you can find with any generic color picker</td>
   <td>miningbag</td>
   <td>miningbag</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_clothesinit" data-tt-parent="p_attributes_equip">clothesallowinitialselect</div></td>
  <td>Boolean</td>
  <td>false</td>
  <td>(Unsure, set to false for all armor types).</td>
  <td>armor</td>
</tr>
</tr>
<tr>
<tr>
Line 689: Line 679:
<tr>
<tr>
   <td scope="row"><div class="tt" data-tt-id="p_alist_defprotloss" data-tt-parent="p_attributes_equip">defaultProtLoss</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_alist_defprotloss" data-tt-parent="p_attributes_equip">defaultProtLoss</div></td>
  <td>number</td>
   <td>-</td>
   <td>-</td>
   <td>Defines the default protection loss for incoming damage that is of a higher tier than the armor. Requires the usage of perTierRelativeProtectionLoss and perTIerFlatDamageReductionLoss properties.</td>
  <td>-</td>
   <td>Defines the default protection loss for incoming damage that is of a higher tier than the armor. Requires the usage of perTierRelativeProtectionLoss and perTierFlatDamageReductionLoss properties.</td>
   <td>armor</td>
   <td>armor</td>
</tr>
</tr>
Line 772: Line 762:
The tier of incoming damage is not just a contest of values, but is actually looped through multiple times depending on the tier value to reduce the effectiveness of an armor. For example, tier 4 damage will loop four times and reduces the armor effectiveness each loop, while tier 1 damage will loop only once.  
The tier of incoming damage is not just a contest of values, but is actually looped through multiple times depending on the tier value to reduce the effectiveness of an armor. For example, tier 4 damage will loop four times and reduces the armor effectiveness each loop, while tier 1 damage will loop only once.  


The looped value starts as 1 and As the value increases up to the damage tier it is compared to the tier of the armor. If this increasing value is greater than the armor tier the second second value is used in the perTier function, otherwise the first value is used. Additionally, if the armor has the highDamageTierResistant property set to true then every loop which is higher than the armor will have it's armor reduction halved.  
The looped value starts as 1 and as the value increases up to the damage tier it is compared to the tier of the armor. If this increasing value is greater than the armor tier the second second value is used in the perTier function, otherwise the first value is used. Additionally, if the armor has the highDamageTierResistant property set to true then every loop which is higher than the armor will have it's armor reduction halved.  


Lets look at an example of this using an armor with the following stats:
Lets look at an example of this using an armor with the following stats:
Line 852: Line 842:
<tr>
<tr>
   <td scope="row"><div class="tt" data-tt-id="p_alist_wearattach" data-tt-parent="p_attributes_equip">wearableAttachment</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_alist_wearattach" data-tt-parent="p_attributes_equip">wearableAttachment</div></td>
   <td>-</td>
   <td>boolean</td>
   <td>-</td>
   <td>-</td>
   <td>Designates the item as a wearable object.</td>
   <td>Designates the item as a wearable object.</td>
Line 865: Line 855:
<tr>
<tr>
   <td scope="row"><div class="tt" data-tt-id="p_hlist_exclude" data-tt-parent="p_attributes_handbook">exclude</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_hlist_exclude" data-tt-parent="p_attributes_handbook">exclude</div></td>
   <td>-</td>
   <td>boolean</td>
   <td>-</td>
   <td>-</td>
   <td>If true, removes the item from the handbook. Can be used with the "ByType" functionality to remove large amounts of variants.</td>
   <td>If true, removes the item from the handbook. Can be used with the "ByType" functionality to remove large amounts of variants.</td>
Line 876: Line 866:
   <td>(Needs more info).</td>
   <td>(Needs more info).</td>
   <td>-</td>
   <td>-</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_hlist_include" data-tt-parent="p_attributes_handbook">include</div></td>
  <td>boolean</td>
  <td>-</td>
  <td>Allows the toggling of the handbook entry.</td>
  <td>burnedbrick</td>
</tr>
</tr>
<tr>
<tr>
Line 912: Line 909:
   <td>-</td>
   <td>-</td>
</tr>
</tr>
<tr>
<td scope="row"><div class="tt" data-tt-id="p_attributes_info" data-tt-parent="p_attributes_handbook" data-invisible="true"></div></td>
<td colspan="4">
The plumb and square is a good example of how a handbook section is added to the game:


<syntaxhighlight lang="json">
handbook: {
  include: true,
  extraSections: [
    { title: "plumbandsquare-handbook-help-title", text: "plumbandsquare-handbook-help-text" }
  ]
}
</syntaxhighlight>
</tr>




Line 1,568: Line 1,579:
     <td>object</td>
     <td>object</td>
     <td>item default</td>
     <td>item default</td>
     <td>Used for scaling, rotation or offseting the item when rendered in guis.</td>
     <td>Used for scaling, rotation or offsetting the item when rendered in guis.</td>
     <td>Any Item</td>
     <td>Any Item</td>
   </tr>
   </tr>
Line 1,575: Line 1,586:
     <td>object</td>
     <td>object</td>
     <td>item default</td>
     <td>item default</td>
     <td>Used for scaling, rotation or offseting the item when rendered in the first person mode hand.</td>
     <td>Used for scaling, rotation or offsetting the item when rendered in the first person mode hand.</td>
     <td>Any Item</td>
     <td>Any Item</td>
   </tr>
   </tr>
Line 1,582: Line 1,593:
     <td>object</td>
     <td>object</td>
     <td>item default</td>
     <td>item default</td>
     <td>Used for scaling, rotation or offseting the item when rendered in the third person mode hand.</td>
     <td>Used for scaling, rotation or offsetting the item when rendered in the third person mode hand.</td>
     <td>Any Item</td>
     <td>Any Item</td>
   </tr>
   </tr>
Line 1,589: Line 1,600:
     <td>object</td>
     <td>object</td>
     <td>item default</td>
     <td>item default</td>
     <td>Used for scaling, rotation or offseting the rendered as a dropped item on the ground.</td>
     <td>Used for scaling, rotation or offsetting the rendered as a dropped item on the ground.</td>
     <td>Any Item</td>
     <td>Any Item</td>
   </tr>
   </tr>
Line 1,627: Line 1,638:
     <td>strawdummy</td>
     <td>strawdummy</td>
   </tr>
   </tr>
<tr>
<td scope="row"><div class="tt" data-tt-id="p_attributes_info" data-tt-parent="root" data-invisible="true"></div></td>
<td colspan="4">
The following are available animations used by items in the game:
''axe, breaktool, hoe, holdbothhandslarge, holdunderarm, knap, scythe, shears, shoveldig, smithing, spearhit, swordhit, twohandplaceblock, water.


</tr>




219

edits