Changes

→‎Custom fruit trees: update for build 23254 (added PlantableLocationRules), fix typo
Line 1,430: Line 1,430:  
| <samp>TextureSpriteRow</samp>
 
| <samp>TextureSpriteRow</samp>
 
| The tree's row index in the <samp>Texture</samp> spritesheet (e.g. 0 for the first tree, 1 for the second tree, etc).
 
| The tree's row index in the <samp>Texture</samp> spritesheet (e.g. 0 for the first tree, 1 for the second tree, etc).
 +
|-
 +
| <samp>PlantableLocationRules</samp>
 +
| ''(Optional)'' The rules which override which locations the fruit tree can be planted in, if applicable. The first matching rule is used. This only affects the location check, so it can't override more specific checks like needing space between fruit trees.
 +
 +
This consists of a list of models with these fields:
 +
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 +
|-
 +
| <samp>Id</samp>
 +
| A key which uniquely identifies this entry within the list. The ID should only contain alphanumeric/underscore/dot characters. For custom entries for vanilla items, this should be prefixed with your mod ID like <samp>Example.ModId_RuleId</samp>.
 +
|-
 +
| <samp>Result</samp>
 +
| Indicates whether the sapling can be planted in a location if this entry is selected. The possible values are:
 +
* <samp>Default</samp>: the sapling can be planted if the location normally allows it.
 +
* <samp>Allow</samp>: the sapling can be planted here, regardless of whether the location normally allows it.
 +
* <samp>Deny</samp>: the sapling can't be planted here, regardless of whether the location normally allows it.
 +
|-
 +
| <samp>Condition</samp>
 +
| ''(Optional)'' A [[#Game state queries|game state query]] which indicates whether this entry applies. Default true.
 +
|}
 
|-
 
|-
 
| <samp>CustomFields</samp>
 
| <samp>CustomFields</samp>
Line 1,486: Line 1,509:  
For C# mods, the <samp>fruitsOnTree</samp> field (number of fruit on the tree) has been replaced by <samp>fruit</samp> (list of fruit items).
 
For C# mods, the <samp>fruitsOnTree</samp> field (number of fruit on the tree) has been replaced by <samp>fruit</samp> (list of fruit items).
   −
====Spawning wild trees====
+
====Spawning fruit trees====
 
Custom trees can be added to the game in two ways:
 
Custom trees can be added to the game in two ways:
 
* Spawn them on [[Modding:Maps|map tiles]] when the location is created, using the new <samp>SpawnTree: fruit {{t|tree ID}}</samp> tile property. This must be added on the <samp>Paths</samp> layer, which must also have tile index 34 from the <samp>paths</samp> tilesheet.
 
* Spawn them on [[Modding:Maps|map tiles]] when the location is created, using the new <samp>SpawnTree: fruit {{t|tree ID}}</samp> tile property. This must be added on the <samp>Paths</samp> layer, which must also have tile index 34 from the <samp>paths</samp> tilesheet.
translators
8,404

edits