Line 429: |
Line 429: |
| | | |
| ==Custom wild trees== | | ==Custom wild trees== |
− | <span style="color: red;">'''TODO'''</span> | + | You can now create/edit [[Trees|wild trees]] by editing the <samp>Data/WildTrees</samp> asset. This consists of a string => model lookup, where the asset key is the wild tree ID: one of <samp>1</samp> (oak), <samp>2</samp> (maple), <samp>3</samp> (pinetree), <samp>6</samp> (palm tree), <samp>7</samp> (mushroom), <samp>8</samp> (mahogany), or a custom string ID defined by a mod. The asset value is a model with these fields: |
| + | |
| + | {| class="wikitable" |
| + | |- |
| + | ! field |
| + | ! effect |
| + | |- |
| + | | <samp>TreeType</samp> |
| + | | The tree ID; this should match the asset key. |
| + | |- |
| + | | <samp>Textures</samp> |
| + | | The tree textures to show in game. This can be a list containing either a single asset name, or four asset names (for spring, summer, fall, and winter in that order). |
| + | |- |
| + | | <samp>SeedItemID</samp> |
| + | | The [[#Custom items|qualified item ID]] for the seed item. |
| + | |- |
| + | | <samp>SeedPlantable</samp> |
| + | | ''(Optional)'' Whether the seed can be planted by the player. If this is false, it can only be spawned automatically via map properties. Default true. |
| + | |- |
| + | | <samp>GrowthChance</samp> |
| + | | ''(Optional)'' The probability each day that the tree will grow to the next stage without [[Tree Fertilizer|tree fertilizer]], expressed as a value from 0 (will never grow) to 1 (will grow every day). Defaults to 0.2 (20% chance). |
| + | |- |
| + | | <samp>FertilizedGrowthChance</samp> |
| + | | ''(Optional)'' Equivalent to <samp>GrowthChance</samp>, but with [[Tree Fertilizer|tree fertilizer]]. Defaults to 1 (100% chance). |
| + | |- |
| + | | <samp>SeedChance</samp> |
| + | | ''(Optional)'' The probability each day that the tree will produce a seed that will drop when the tree is shaken. Default 0.05 (5% chance). |
| + | |- |
| + | | <samp>SeedOnChopChance</samp> |
| + | | ''(Optional)'' The probability that a seed will drop when the player chops down the tree. Default 0.75 (75% chance). |
| + | |- |
| + | | <samp>DropWoodOnChop</samp> |
| + | | ''(Optional)'' Whether to drop [[wood]] when the player chops down the tree. Default true. |
| + | |- |
| + | | <samp>DropHardwoodOnLumberChop</samp> |
| + | | ''(Optional)'' Whether to drop [[hardwood]] when the player chops down the tree, if they have the [[Skills#Foraging|Lumberjack profession]]. Default true. |
| + | |- |
| + | | <samp>IsLeafy</samp> |
| + | | ''(Optional)'' Whether shaking or chopping the tree causes cosmetic leaves to drop from tree and produces a leaf rustle sound. When a leaf drops, the game will use one of the four leaf sprites in the tree's spritesheet in the slot left of the stump sprite. Default true. |
| + | |- |
| + | | <samp>IsLeafyInWinter</samp> |
| + | | ''(Optional)'' Whether <samp>IsLeafy</samp> also applies in winter. Default false. |
| + | |- |
| + | | <samp>GrowsInWinter</samp> |
| + | | ''(Optional)'' Whether the tree can grow in winter (subject to <samp>GrowthChance</samp> and <samp>FertilizedGrowthChance</samp>). Default false. |
| + | |- |
| + | | <samp>IsStumpDuringWinter</samp> |
| + | | ''(Optional)'' Whether the tree is reduced to a stump in winter and regrows in spring, like the vanilla [[Trees#Mushroom Tree|mushroom tree]]. Default false. |
| + | |- |
| + | | <samp>AllowWoodpeckers</samp> |
| + | | ''(Optional)'' Whether woodpeckers can spawn on the tree. Default true. |
| + | |- |
| + | | <samp>UseAlternateSeedSprite</samp> |
| + | | ''(Optional)'' Whether to render a different tree sprite when it has a seed ready. If true, the tree spritesheet should be double-width with the alternate textures on the right. Default false. |
| + | |- |
| + | | <samp>DebrisColor</samp> |
| + | | ''(Optional)'' The color of the cosmetic wood chips when chopping the tree. The valid values are <samp>12</samp> (brown/woody), <samp>100001</samp> (light green), <samp>100003</samp> (red), <samp>100004</samp> (yellow), <samp>100005</samp> (black), <samp>100007</samp> (charcoal / dim gray), <samp>100002</samp> (light blue), or any other value for white. Defaults to brown/woody. |
| + | |- |
| + | | <samp>AdditionalChopDrops</samp><br /><samp>BushChopDrops</samp><br /><samp>StumpChopDrops</samp> |
| + | | ''(Optional)'' The additional items to drop when the tree is chopped. One field applies depending on the tree's current state: <samp>AdditionalChopDrops</samp> for a full-grown tree, <samp>BushChopDrops</samp> for a bush (one step below full-grown), and <samp>StumpChopDrops</samp> for the stump left behind after chopping a full-grown tree. This consists of a list of models with these fields: |
| + | {| class="wikitable" |
| + | |- |
| + | ! field |
| + | ! effect |
| + | |- |
| + | | <samp>ItemID</samp> |
| + | | The [[#Custom items|qualified item ID]]. |
| + | |- |
| + | | <samp>MinCount</samp><br /><samp>MaxCount</samp> |
| + | | The minimum/maximum number of the item to drop. |
| + | |- |
| + | | <samp>Chance</samp> |
| + | | The probability that the item will drop, as a value between 0 (never drops) and 1 (always drops). This has no effect on other drops (e.g. if there are ten drops with 100% chance, all ten will drop). |
| + | |} |
| + | |- |
| + | | <samp>SpringTapItems</samp><br /><samp>SummerTapItems</samp><br /><samp>FallTapItems</samp><br /><samp>WinterTapItems</samp> |
| + | | The items produced by [[Tapper|tapping]] the tree in each season, as a list of models with these fields. If multiple items can be produced, the first available one is selected. |
| + | {| class="wikitable" |
| + | |- |
| + | ! field |
| + | ! effect |
| + | |- |
| + | | <samp>PossibleItems<samp> |
| + | | The possible items to produce, as a list of models with these fields. If there are multiple items listed, one will be chosen at random each time. |
| + | {| class="wikitable" |
| + | |- |
| + | ! field |
| + | ! effect |
| + | |- |
| + | | <samp>ItemID</samp> |
| + | | The [[#Custom items|qualified item ID]]. |
| + | |- |
| + | | <samp>MinCount</samp><br /><samp>MaxCount</samp> |
| + | | The minimum/maximum number of the item to produce when the tapper is emptied. |
| + | |- |
| + | | <samp>DaysUntilReady</samp> |
| + | | The number of days before the tapper is ready to empty. |
| + | |} |
| + | |- |
| + | | <samp>PreviousItemID</samp> |
| + | | ''(Optional)'' The condition when this item will be produced. This can be specified in two forms: |
| + | * the [[#Custom items|unqualified item ID]] of the previous item produced by this tapper; |
| + | * ''or'' a modulus day of month prefixed with <samp>%</samp> (like <code>%10</code> for the 10th and 20th day of the month). |
| + | If not specified, the condition is always true. |
| + | |} |
| + | |} |
| + | |
| + | Trees can then be added to the game by... |
| + | * spawning them on [[Modding:Maps|map tiles]] by adding <samp>Paths</samp> index 34 to the <samp>Paths</samp> layer, with a <samp>TreeType</samp> tile property with the tree ID; |
| + | * or giving the player a seed item in the usual ways (e.g. from [[#Custom shops|a shop]], [[Modding:Mail data|mail letter]], etc). |
| | | |
| ==Standardized data fields== | | ==Standardized data fields== |