Json:block:worldvariantgroups: Difference between revisions

From Vintage Story Wiki
m (Alphabetize list)
(Document loadFromPropertiesCombine)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
The world properties are stored in the <code>assets/survival/worldproperties</code> folder. They are used to help fill in the [[Modding:Registry_Object_JSON_Parsing#Enumerating_variants|variantgroups]] field. Instead of directly specifying every state in the variant group, the states can be loaded from a world property through the <code>loadFromProperties</code> key. The states from multiple world properties can be added with the <code>loadFromPropertiesCombine</code> key, which takes an array of strings. The <code>states</code> key can still be optionally added to the variant group to specify additional states.
For example, the following creates a variant group named orientation. It contains 5 states. <code>north</code>, <code>east</code>, <code>south</code>, and <code>west</code> are loaded from the <code>abstract/horizontalorientation</code> world property. <code>up</code> is added to the list of states.
<syntaxhighlight lang="json">
variantgroups: [
{ code: "orientation", states: ["up"], loadFromProperties: "abstract/horizontalorientation" }
],
</syntaxhighlight>
Unwanted variant states can be [[Modding:Registry_Object_JSON_Parsing#Filtering_out_variants|filtered]] out with the <code>skipVariants</code> property. Or all states that do not match an expression can be filtered out with the <code>allowedVariants</code> property.
<table class="wikitable">
<table class="wikitable">
   <tr style="background-color: rgba(0,0,0,0.2);">
   <tr style="background-color: rgba(0,0,0,0.2);">
Line 10: Line 21:
   <tr>
   <tr>
     <td>abstract/coating</td>
     <td>abstract/coating</td>
<td style="font-style: italic;">n, e, s, w, u, d, ud, ns, ew, nd, ed, sd, wd, su, wu, nu, eu, es, sw, nw, ne, nwd, ned, esd, swd, nwu, neu, esu, swu, nsd, ewd, sud, wud, nud, eud, nsu, ewu, nes, esw, nsw, new, newd, nesd, eswd, nswd, eswu, nswu, newu, nesu, nesw, ewud, nsud, neud, esud, swud, nwud, neswd, neswu, newud, nesud, eswud, nswud, neswud</td>
<td style="font-style: italic;">n, e, s, w, u, d, ud, ns, ew, nd, ed, sd, wd, su, wu, nu, eu, es, sw, nw, ne, nwd, ned, esd, swd, nwu, neu, esu, swu, nsd, ewd, sud, wud, nud, eud, nsu, ewu, nes, esw, nsw, new, newd, nesd, eswd, nswd, eswu, nswu, newu, nesu, nesw, ewud, nsud, neud, esud, swud, nwud, neswd, neswu, newud, nesud, eswud, nswud, neswud</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td>abstract/fertility</td>
     <td>abstract/fertility</td>
<td style="font-style: italic;">verylow, low, medium, high</td>
<td style="font-style: italic;">verylow, low, medium, compost, high</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 34: Line 45:
   <tr>
   <tr>
     <td>block/flower</td>
     <td>block/flower</td>
<td style="font-style: italic;">catmint, forgetmenot, edelweiss, heather, horsetail, orangemallow, wilddaisy, westerngorse, cowparsley, californiapoppy</td>
<td style="font-style: italic;">catmint, cornflower, forgetmenot, edelweiss, heather, horsetail, orangemallow, wilddaisy, westerngorse, cowparsley, goldenpoppy, lilyofthevalley, woad, redtopgrass</td>
  </tr>
  <tr>
    <td>block/fruit</td>
<td style="font-style: italic;">blueberry, cranberry, redcurrant, whitecurrant, blackcurrant, saguaro, pineapple, redapple, pinkapple, yellowapple, cherry, peach, pear, orange, mango, breadfruit, lychee, pomegranate</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 46: Line 61:
   <tr>
   <tr>
     <td>block/metal</td>
     <td>block/metal</td>
<td style="font-style: italic;">bismuth, bismuthbronze, blackbronze, brass, chromium, copper, gold, iron, lead, platinum, rhodium, silver, stainlesssteel, steel, tin, tinbronze, titanium, uranium, zinc</td>
<td style="font-style: italic;">bismuth, bismuthbronze, blackbronze, brass, chromium, copper, cupronickel, electrum, gold, iron, meteoriciron, lead, molybdochalkos, platinum, nickel, silver, stainlesssteel, steel, tin, tinbronze, titanium, uranium, zinc</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td>block/mushroom</td>
     <td>block/mushroom</td>
<td style="font-style: italic;">flyagaric, bolete, fieldmushroom</td>
<td style="font-style: italic;">flyagaric, fieldmushroom, almondmushroom, bitterbolete, blacktrumpet, chanterelle, commonmorel, deathcap, devilstooth, devilbolete, earthball, elfinsaddle, golddropmilkcap, greencrackedrussula, indigomilkcap, jackolantern, kingbolete, lobster, orangeoakbolete, paddystraw, puffball, redwinecap, saffronmilkcap, violetwebcap, witchhat, beardedtooth, chickenofthewoods, dryadsaddle, pinkoyster, tinderhoof, whiteoyster, reishi, funeralbell, deerear, livermushroom, pinkbonnet, shiitake</td>
  </tr>
  <tr>
    <td>block/ore-gem-cut</td>
<td style="font-style: italic;">diamond, emerald, peridot</td>
  </tr>
  <tr>
    <td>block/ore-gem-rough</td>
<td style="font-style: italic;">diamond,emerald,olivine_peridot</td>
  </tr>
  <tr>
    <td>block/ore-graded</td>
<td style="font-style: italic;">nativecopper,limonite,quartz_nativegold,galena,cassiterite,chromite,ilmenite,sphalerite,quartz_nativesilver,galena_nativesilver,bismuthinite,magnetite,hematite,malachite,pentlandite,uranium,wolframite,rhodochrosite</td>
  </tr>
  <tr>
    <td>block/ore-nugget</td>
    <td style="font-style: italic;">nativecopper,limonite,nativegold,galena,cassiterite,chromite,ilmenite,sphalerite,nativesilver,bismuthinite,magnetite,hematite,malachite,pentlandite,uranium,wolframite,rhodochrosite</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td>block/ore</td>
     <td>block/ore-ungraded</td>
<td style="font-style: italic;">lignite, bituminouscoal, nativecopper, limonite, quartz_nativegold, galena, cassiterite, chromite, platinum, ilmenite, sphalerite, rocksalt_sylvite, quartz_nativesilver, lapislazuli, diamond, emerald, bismuthinite, quartz, rocksalt, sulfur, magnetite</td>
    <td style="font-style: italic;">alum,lapislazuli,corundum,anthracite,borax,cinnabar,lignite,bituminouscoal,sylvite,quartz,olivine,sulfur,fluorite,graphite,kernite,phosphorite</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td>block/painting</td>
     <td>block/painting</td>
<td style="font-style: italic;">acitasluna, dandelionnight, distantpath, forestpath, night, papiliorumanzovia, stillmomentsbeforesunrise, thedreamprojection, troidesaeacus, winterflowers</td>
    <td style="font-style: italic;">howl,elk,underwater,prey,forestdawn,fishandtherain,bogfort,castleruin,cow,hunterintheforest,seraph,sleepingwolf,sunkenruin,traveler,oldvillage,lastday,sodhouse</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td>block/rock</td>
     <td>block/rock</td>
<td style="font-style: italic;">andesite, chalk, claystone, granite, sandstone, shale</td>
    <td style="font-style: italic;">andesite,chalk,chert,conglomerate,limestone,claystone,granite,sandstone,shale,basalt,peridotite,phyllite,slate,bauxite</td>
  </tr>
  <tr>
    <td>block/rockwithdeposit</td>
    <td style="font-style: italic;">andesite,chalk,chert,conglomerate,limestone,claystone,granite,sandstone,shale,basalt,peridotite,phyllite,slate,obsidian,kimberlite,scoria,tuff,bauxite,halite,suevite,whitemarble,redmarble,greenmarble</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td>block/tallgrass</td>
     <td>block/tallgrass</td>
<td style="font-style: italic;">veryshort, short, mediumshort, medium, tall, verytall, eaten</td>
    <td style="font-style: italic;">veryshort,short,mediumshort,medium,tall,verytall,eaten</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td>block/wood</td>
     <td>block/toolmetal</td>
<td style="font-style: italic;">birch, oak, maple, pine, acacia, kapok</td>
    <td style="font-style: italic;">bismuth,bismuthbronze,blackbronze,brass,copper,gold,iron,meteoriciron,lead,molybdochalkos,silver,steel,tinbronze</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td>block/woodwithaged</td>
     <td>block/wood</td>
<td style="font-style: italic;">birch, oak, maple, pine, acacia, kapok, aged</td>
    <td style="font-style: italic;">birch,oak,maple,pine,acacia,kapok,baldcypress,larch,redwood,ebony,walnut,purpleheart</td>
   </tr>
   </tr>
</table>
</table>
{{Navbox/modding|Vintage Story}}

Latest revision as of 07:06, 24 November 2023

The world properties are stored in the assets/survival/worldproperties folder. They are used to help fill in the variantgroups field. Instead of directly specifying every state in the variant group, the states can be loaded from a world property through the loadFromProperties key. The states from multiple world properties can be added with the loadFromPropertiesCombine key, which takes an array of strings. The states key can still be optionally added to the variant group to specify additional states.

For example, the following creates a variant group named orientation. It contains 5 states. north, east, south, and west are loaded from the abstract/horizontalorientation world property. up is added to the list of states.

	variantgroups: [
		{ code: "orientation", states: ["up"], loadFromProperties: "abstract/horizontalorientation" }
	],

Unwanted variant states can be filtered out with the skipVariants property. Or all states that do not match an expression can be filtered out with the allowedVariants property.

Name States
abstract/alloy -
abstract/coating n, e, s, w, u, d, ud, ns, ew, nd, ed, sd, wd, su, wu, nu, eu, es, sw, nw, ne, nwd, ned, esd, swd, nwu, neu, esu, swu, nsd, ewd, sud, wud, nud, eud, nsu, ewu, nes, esw, nsw, new, newd, nesd, eswd, nswd, eswu, nswu, newu, nesu, nesw, ewud, nsud, neud, esud, swud, nwud, neswd, neswu, newud, nesud, eswud, nswud, neswud
abstract/fertility verylow, low, medium, compost, high
abstract/grasscoverage none, verysparse, sparse, normal
abstract/horizontalorientation north, east, south, west
abstract/rockgroup -
abstract/verticalorientation up, down
block/flower catmint, cornflower, forgetmenot, edelweiss, heather, horsetail, orangemallow, wilddaisy, westerngorse, cowparsley, goldenpoppy, lilyofthevalley, woad, redtopgrass
block/fruit blueberry, cranberry, redcurrant, whitecurrant, blackcurrant, saguaro, pineapple, redapple, pinkapple, yellowapple, cherry, peach, pear, orange, mango, breadfruit, lychee, pomegranate
block/grass -
block/herb basil, chamomile, cilantro, lavender, marjoram, mint, saffron, sage, thyme
block/metal bismuth, bismuthbronze, blackbronze, brass, chromium, copper, cupronickel, electrum, gold, iron, meteoriciron, lead, molybdochalkos, platinum, nickel, silver, stainlesssteel, steel, tin, tinbronze, titanium, uranium, zinc
block/mushroom flyagaric, fieldmushroom, almondmushroom, bitterbolete, blacktrumpet, chanterelle, commonmorel, deathcap, devilstooth, devilbolete, earthball, elfinsaddle, golddropmilkcap, greencrackedrussula, indigomilkcap, jackolantern, kingbolete, lobster, orangeoakbolete, paddystraw, puffball, redwinecap, saffronmilkcap, violetwebcap, witchhat, beardedtooth, chickenofthewoods, dryadsaddle, pinkoyster, tinderhoof, whiteoyster, reishi, funeralbell, deerear, livermushroom, pinkbonnet, shiitake
block/ore-gem-cut diamond, emerald, peridot
block/ore-gem-rough diamond,emerald,olivine_peridot
block/ore-graded nativecopper,limonite,quartz_nativegold,galena,cassiterite,chromite,ilmenite,sphalerite,quartz_nativesilver,galena_nativesilver,bismuthinite,magnetite,hematite,malachite,pentlandite,uranium,wolframite,rhodochrosite
block/ore-nugget nativecopper,limonite,nativegold,galena,cassiterite,chromite,ilmenite,sphalerite,nativesilver,bismuthinite,magnetite,hematite,malachite,pentlandite,uranium,wolframite,rhodochrosite
block/ore-ungraded alum,lapislazuli,corundum,anthracite,borax,cinnabar,lignite,bituminouscoal,sylvite,quartz,olivine,sulfur,fluorite,graphite,kernite,phosphorite
block/painting howl,elk,underwater,prey,forestdawn,fishandtherain,bogfort,castleruin,cow,hunterintheforest,seraph,sleepingwolf,sunkenruin,traveler,oldvillage,lastday,sodhouse
block/rock andesite,chalk,chert,conglomerate,limestone,claystone,granite,sandstone,shale,basalt,peridotite,phyllite,slate,bauxite
block/rockwithdeposit andesite,chalk,chert,conglomerate,limestone,claystone,granite,sandstone,shale,basalt,peridotite,phyllite,slate,obsidian,kimberlite,scoria,tuff,bauxite,halite,suevite,whitemarble,redmarble,greenmarble
block/tallgrass veryshort,short,mediumshort,medium,tall,verytall,eaten
block/toolmetal bismuth,bismuthbronze,blackbronze,brass,copper,gold,iron,meteoriciron,lead,molybdochalkos,silver,steel,tinbronze
block/wood birch,oak,maple,pine,acacia,kapok,baldcypress,larch,redwood,ebony,walnut,purpleheart
Icon Sign.png

Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.

Modding
Modding Introduction Getting Started Theme Pack
Content Modding Content Mods Developing a Content Mod Basic Tutorials Intermediate Tutorials Advanced Tutorials Content Mod Concepts
Code Modding Code Mods Setting up your Development Environment
Property Overview ItemEntityBlockBlock BehaviorsBlock ClassesBlock EntitiesBlock Entity BehaviorsWorld properties
Workflows & Infrastructure Modding Efficiency TipsMod-engine compatibilityMod ExtensibilityVS Engine
Additional Resources Community Resources Modding API Updates Programming Languages List of server commandsList of client commandsClient startup parametersServer startup parameters
Example ModsAPI DocsGitHub Repository