Json block behaviors OmniAttachable: Difference between revisions

From Vintage Story Wiki
→‎Usage: Update example to use loadFromPropertiesCombine
(Update)
(→‎Usage: Update example to use loadFromPropertiesCombine)
 
Line 14: Line 14:
If the block passes the attachment checks, then it is oriented to the parent. In order to do so, one of the variant groups must contain all facing codes. By default that variant group uses the <code>orientation</code> code, but a different code selected with the <code>facingCode</code> property.
If the block passes the attachment checks, then it is oriented to the parent. In order to do so, one of the variant groups must contain all facing codes. By default that variant group uses the <code>orientation</code> code, but a different code selected with the <code>facingCode</code> property.


All of the states of the orientation group can be directly specified, or the "up" and "down" states can be added to the ones from the <code>abstract/horizontalorientation</code> [[Json:block:worldvariantgroups|world property]]:
All of the states of the orientation group can be directly specified, or the <code>abstract/verticalorientation</code> states can be added to the ones from the <code>abstract/horizontalorientation</code> [[Json:block:worldvariantgroups|world property]]:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
variantgroups: [
variantgroups: [
{ code:"orientation", states: ["up", "down"], loadFromProperties: "abstract/horizontalorientation" }
{ code:"orientation", loadFromPropertiesCombine: ["abstract/horizontalorientation", "abstract/verticalorientation"] }
],
],
</syntaxhighlight>
</syntaxhighlight>
Confirmedusers
261

edits