Difference between revisions of "Modding:Crop data"
Jump to navigation
Jump to search
Pathoschild (talk | contribs) m (→Days in each stage of growth: fix) |
(Fix broken links, update raw data) |
||
(23 intermediate revisions by 10 users not shown) | |||
Line 4: | Line 4: | ||
==Raw data== | ==Raw data== | ||
− | + | Crop data is stored in <samp>Data\Crops.xnb</samp>, which can be [[Modding:Editing XNB files#unpacking|unpacked for editing]]. Here's a portion of the raw data as of {{version|1.6.8}} for reference: | |
− | < | + | {{collapse|Data|content=<syntaxhighlight lang="json"> |
− | + | { | |
− | + | "472": { | |
− | + | "Seasons": [ | |
− | + | "Spring" | |
− | + | ], | |
− | + | "DaysInPhase": [ | |
− | + | 1, | |
− | + | 1, | |
− | + | 1, | |
− | + | 1 | |
− | + | ], | |
− | + | "RegrowDays": -1, | |
− | + | "IsRaised": false, | |
− | + | "IsPaddyCrop": false, | |
− | + | "NeedsWatering": true, | |
− | 476: "1 1 1 1 | + | "PlantableLocationRules": null, |
− | + | "HarvestItemId": "24", | |
− | + | "HarvestMinStack": 1, | |
− | + | "HarvestMaxStack": 1, | |
− | + | "HarvestMaxIncreasePerFarmingLevel": 0.0, | |
− | + | "ExtraHarvestChance": 0.0, | |
− | + | "HarvestMethod": "Grab", | |
− | + | "HarvestMinQuality": 0, | |
− | + | "HarvestMaxQuality": null, | |
− | + | "TintColors": [], | |
− | + | "Texture": "TileSheets\\crops", | |
− | + | "SpriteIndex": 0, | |
− | + | "CountForMonoculture": true, | |
− | + | "CountForPolyculture": true, | |
− | + | "CustomFields": null | |
− | + | }, | |
− | + | "473": { | |
− | + | "Seasons": [ | |
− | + | "Spring" | |
− | + | ], | |
− | + | "DaysInPhase": [ | |
− | + | 1, | |
− | + | 1, | |
− | + | 1, | |
− | + | 3, | |
− | </ | + | 4 |
+ | ], | ||
+ | "RegrowDays": 3, | ||
+ | "IsRaised": true, | ||
+ | "IsPaddyCrop": false, | ||
+ | "NeedsWatering": true, | ||
+ | "PlantableLocationRules": null, | ||
+ | "HarvestItemId": "188", | ||
+ | "HarvestMinStack": 1, | ||
+ | "HarvestMaxStack": 1, | ||
+ | "HarvestMaxIncreasePerFarmingLevel": 0.0, | ||
+ | "ExtraHarvestChance": 0.0, | ||
+ | "HarvestMethod": "Grab", | ||
+ | "HarvestMinQuality": 0, | ||
+ | "HarvestMaxQuality": null, | ||
+ | "TintColors": [], | ||
+ | "Texture": "TileSheets\\crops", | ||
+ | "SpriteIndex": 1, | ||
+ | "CountForMonoculture": true, | ||
+ | "CountForPolyculture": true, | ||
+ | "CustomFields": null | ||
+ | }, | ||
+ | "474": { | ||
+ | "Seasons": [ | ||
+ | "Spring" | ||
+ | ], | ||
+ | "DaysInPhase": [ | ||
+ | 1, | ||
+ | 2, | ||
+ | 4, | ||
+ | 4, | ||
+ | 1 | ||
+ | ], | ||
+ | "RegrowDays": -1, | ||
+ | "IsRaised": false, | ||
+ | "IsPaddyCrop": false, | ||
+ | "NeedsWatering": true, | ||
+ | "PlantableLocationRules": null, | ||
+ | "HarvestItemId": "190", | ||
+ | "HarvestMinStack": 1, | ||
+ | "HarvestMaxStack": 1, | ||
+ | "HarvestMaxIncreasePerFarmingLevel": 0.0, | ||
+ | "ExtraHarvestChance": 0.0, | ||
+ | "HarvestMethod": "Grab", | ||
+ | "HarvestMinQuality": 0, | ||
+ | "HarvestMaxQuality": null, | ||
+ | "TintColors": [], | ||
+ | "Texture": "TileSheets\\crops", | ||
+ | "SpriteIndex": 2, | ||
+ | "CountForMonoculture": true, | ||
+ | "CountForPolyculture": true, | ||
+ | "CustomFields": null | ||
+ | }, | ||
+ | "475": { | ||
+ | "Seasons": [ | ||
+ | "Spring" | ||
+ | ], | ||
+ | "DaysInPhase": [ | ||
+ | 1, | ||
+ | 1, | ||
+ | 1, | ||
+ | 2, | ||
+ | 1 | ||
+ | ], | ||
+ | "RegrowDays": -1, | ||
+ | "IsRaised": false, | ||
+ | "IsPaddyCrop": false, | ||
+ | "NeedsWatering": true, | ||
+ | "PlantableLocationRules": null, | ||
+ | "HarvestItemId": "192", | ||
+ | "HarvestMinStack": 1, | ||
+ | "HarvestMaxStack": 1, | ||
+ | "HarvestMaxIncreasePerFarmingLevel": 0.0, | ||
+ | "ExtraHarvestChance": 0.2, | ||
+ | "HarvestMethod": "Grab", | ||
+ | "HarvestMinQuality": 0, | ||
+ | "HarvestMaxQuality": null, | ||
+ | "TintColors": [], | ||
+ | "Texture": "TileSheets\\crops", | ||
+ | "SpriteIndex": 3, | ||
+ | "CountForMonoculture": true, | ||
+ | "CountForPolyculture": true, | ||
+ | "CustomFields": null | ||
+ | }, | ||
+ | "476": { | ||
+ | "Seasons": [ | ||
+ | "Spring" | ||
+ | ], | ||
+ | "DaysInPhase": [ | ||
+ | 1, | ||
+ | 1, | ||
+ | 1, | ||
+ | 1 | ||
+ | ], | ||
+ | "RegrowDays": -1, | ||
+ | "IsRaised": false, | ||
+ | "IsPaddyCrop": false, | ||
+ | "NeedsWatering": true, | ||
+ | "PlantableLocationRules": null, | ||
+ | "HarvestItemId": "248", | ||
+ | "HarvestMinStack": 1, | ||
+ | "HarvestMaxStack": 1, | ||
+ | "HarvestMaxIncreasePerFarmingLevel": 0.0, | ||
+ | "ExtraHarvestChance": 0.0, | ||
+ | "HarvestMethod": "Grab", | ||
+ | "HarvestMinQuality": 0, | ||
+ | "HarvestMaxQuality": null, | ||
+ | "TintColors": [], | ||
+ | "Texture": "TileSheets\\crops", | ||
+ | "SpriteIndex": 4, | ||
+ | "CountForMonoculture": true, | ||
+ | "CountForPolyculture": true, | ||
+ | "CustomFields": null | ||
+ | }, | ||
+ | "273": { | ||
+ | "Seasons": [ | ||
+ | "Spring" | ||
+ | ], | ||
+ | "DaysInPhase": [ | ||
+ | 1, | ||
+ | 2, | ||
+ | 2, | ||
+ | 3 | ||
+ | ], | ||
+ | "RegrowDays": -1, | ||
+ | "IsRaised": false, | ||
+ | "IsPaddyCrop": true, | ||
+ | "NeedsWatering": true, | ||
+ | "PlantableLocationRules": null, | ||
+ | "HarvestItemId": "271", | ||
+ | "HarvestMinStack": 1, | ||
+ | "HarvestMaxStack": 1, | ||
+ | "HarvestMaxIncreasePerFarmingLevel": 0.1, | ||
+ | "ExtraHarvestChance": 0.1, | ||
+ | "HarvestMethod": "Scythe", | ||
+ | "HarvestMinQuality": 0, | ||
+ | "HarvestMaxQuality": null, | ||
+ | "TintColors": [], | ||
+ | "Texture": "TileSheets\\crops", | ||
+ | "SpriteIndex": 34, | ||
+ | "CountForMonoculture": false, | ||
+ | "CountForPolyculture": false, | ||
+ | "CustomFields": null | ||
+ | }, | ||
+ | "831": { | ||
+ | "Seasons": [ | ||
+ | "Summer" | ||
+ | ], | ||
+ | "DaysInPhase": [ | ||
+ | 1, | ||
+ | 2, | ||
+ | 3, | ||
+ | 4 | ||
+ | ], | ||
+ | "RegrowDays": -1, | ||
+ | "IsRaised": false, | ||
+ | "IsPaddyCrop": true, | ||
+ | "NeedsWatering": true, | ||
+ | "PlantableLocationRules": null, | ||
+ | "HarvestItemId": "830", | ||
+ | "HarvestMinStack": 1, | ||
+ | "HarvestMaxStack": 1, | ||
+ | "HarvestMaxIncreasePerFarmingLevel": 0.0, | ||
+ | "ExtraHarvestChance": 0.0, | ||
+ | "HarvestMethod": "Grab", | ||
+ | "HarvestMinQuality": 0, | ||
+ | "HarvestMaxQuality": null, | ||
+ | "TintColors": [], | ||
+ | "Texture": "TileSheets\\crops", | ||
+ | "SpriteIndex": 42, | ||
+ | "CountForMonoculture": false, | ||
+ | "CountForPolyculture": false, | ||
+ | "CustomFields": null | ||
+ | }, | ||
+ | "477": { | ||
+ | "Seasons": [ | ||
+ | "Spring" | ||
+ | ], | ||
+ | "DaysInPhase": [ | ||
+ | 1, | ||
+ | 2, | ||
+ | 2, | ||
+ | 1 | ||
+ | ], | ||
+ | "RegrowDays": -1, | ||
+ | "IsRaised": false, | ||
+ | "IsPaddyCrop": false, | ||
+ | "NeedsWatering": true, | ||
+ | "PlantableLocationRules": null, | ||
+ | "HarvestItemId": "250", | ||
+ | "HarvestMinStack": 1, | ||
+ | "HarvestMaxStack": 1, | ||
+ | "HarvestMaxIncreasePerFarmingLevel": 0.0, | ||
+ | "ExtraHarvestChance": 0.0, | ||
+ | "HarvestMethod": "Scythe", | ||
+ | "HarvestMinQuality": 0, | ||
+ | "HarvestMaxQuality": null, | ||
+ | "TintColors": [], | ||
+ | "Texture": "TileSheets\\crops", | ||
+ | "SpriteIndex": 5, | ||
+ | "CountForMonoculture": true, | ||
+ | "CountForPolyculture": true, | ||
+ | "CustomFields": null | ||
+ | }, | ||
+ | "478": { | ||
+ | "Seasons": [ | ||
+ | "Spring" | ||
+ | ], | ||
+ | "DaysInPhase": [ | ||
+ | 2, | ||
+ | 2, | ||
+ | 2, | ||
+ | 3, | ||
+ | 4 | ||
+ | ], | ||
+ | "RegrowDays": -1, | ||
+ | "IsRaised": false, | ||
+ | "IsPaddyCrop": false, | ||
+ | "NeedsWatering": true, | ||
+ | "PlantableLocationRules": null, | ||
+ | "HarvestItemId": "252", | ||
+ | "HarvestMinStack": 1, | ||
+ | "HarvestMaxStack": 1, | ||
+ | "HarvestMaxIncreasePerFarmingLevel": 0.0, | ||
+ | "ExtraHarvestChance": 0.0, | ||
+ | "HarvestMethod": "Grab", | ||
+ | "HarvestMinQuality": 0, | ||
+ | "HarvestMaxQuality": null, | ||
+ | "TintColors": [], | ||
+ | "Texture": "TileSheets\\crops", | ||
+ | "SpriteIndex": 6, | ||
+ | "CountForMonoculture": true, | ||
+ | "CountForPolyculture": true, | ||
+ | "CustomFields": null | ||
+ | } | ||
+ | } | ||
+ | </syntaxhighlight>}} | ||
==Format== | ==Format== | ||
+ | |||
+ | The asset <samp>Data\Crops</samp> consists of a string → model lookup, where... | ||
+ | * The key is the unqualified [[Modding:Common_data_field_types#Item_ID|item ID]] for the seed item. | ||
+ | * The value is model with the fields listed below. | ||
+ | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
− | ! | + | ! field |
− | ! | + | ! effect |
− | |||
|- | |- | ||
− | | | + | !colspan="2"| Growth |
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | <samp>Seasons</samp> |
− | | | + | | The seasons in which this crop can grow (any combination of <samp>spring</samp>, <samp>summer</samp>, <samp>fall</samp>, and <samp>winter</samp>). |
− | |||
− | |||
|- | |- | ||
− | | | + | | <samp>DaysInPhase</samp> |
− | | | + | | The number of days in each visual step of growth before the crop is harvestable. Each step corresponds to a sprite in the crop's row (see <samp>SpriteIndex</samp>). |
− | + | ||
− | + | For example, a crop with <code>"DaysInPhase": [ 1, 1, 1, 1 ]</code> will grow from seed to harvestable in 4 days, moving to the next sprite in the row each day. | |
|- | |- | ||
− | | | + | | <samp>RegrowDays</samp> |
− | + | | ''(Optional)'' The number of days before the crop regrows after harvesting, or -1 if it can't regrow. The crop will keep the full-grown sprite (i.e. the last phase in <samp>DaysInPhase</samp>) during this time. Default -1. | |
− | |||
− | |||
|- | |- | ||
− | | | + | | <samp>IsRaised</samp> |
− | + | | ''(Optional)'' Whether this is a raised crop on a trellis that can't be walked through. Default false. | |
− | | | ||
− | |||
|- | |- | ||
− | | | + | | <samp>IsPaddyCrop</samp> |
− | | | + | | ''(Optional)'' Whether this crop can be planted near water for a unique paddy dirt texture, faster growth time, and auto-watering. For example, [[Rice Shoot|rice]] and [[Taro Root|taro]] are paddy crops. Default false. |
− | | | ||
− | | | ||
|- | |- | ||
− | | | + | | <samp>NeedsWatering</samp> |
− | | | + | | ''(Optional)'' Whether this crop needs to be watered to grow (e.g. [[Fiber Seeds|fiber seeds]] don't). Default true. |
− | |||
− | | | ||
|- | |- | ||
− | | | + | !colspan="2"| Harvest |
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | | <samp>HarvestItemId</samp> |
− | | | + | | The item ID produced when this crop is harvested. |
− | |||
− | |||
|- | |- | ||
− | | | + | | <samp>HarvestMethod</samp> |
− | | | + | | ''(Optional)'' How the crop can be harvested. This can be <samp>Grab</samp> (crop is harvested by hand) or <samp>Scythe</samp> (harvested with a [[scythe]]). Default <samp>Grab</samp>. |
− | | | + | |- |
− | | | + | | <samp>HarvestMinStack</samp><br /><samp>HarvestMaxStack</samp> |
− | | | + | | ''(Optional)'' The minimum and maximum number of <samp>HarvestItemId</samp> to produce (before <samp>HarvestMaxIncreasePerFarmingLevel</samp> and <samp>ExtraHarvestChance</samp> are applied). A value within this range (inclusive) will be randomly chosen each time the crop is harvested. The minimum defaults to 1, and the maximum defaults to the minimum. |
+ | |- | ||
+ | | <samp>HarvestMinQuality</samp><br /><samp>HarvestMaxQuality</samp> | ||
+ | | ''(Optional)'' If set, the minimum and maximum quality of the harvest crop. These fields set a constraint that's applied after the quality is calculated normally, they don't affect the initial quality logic. | ||
+ | |- | ||
+ | | <samp>HarvestMaxIncreasePerFarmingLevel</samp> | ||
+ | | ''(Optional)'' The number of extra harvests to produce per farming level. This is rounded down to the nearest integer and added to <samp>HarvestMaxStack</samp>. Defaults to 0. | ||
− | + | For example, a value of 0.2 is equivalent to +1 max at level 5 and +2 at level 10. | |
− | The | + | |- |
+ | | <samp>ExtraHarvestChance</samp> | ||
+ | | ''(Optional)'' The probability that harvesting the crop will produce extra harvest items, as a value between 0 (never) and 0.9 (nearly always). This is repeatedly rolled until it fails, then the number of successful rolls is added to the produced count. For example, [[tomato]]es use 0.05. Default 0. This is [https://www.desmos.com/calculator/ok9c2tw6o5 a geometric series with expected value] of <samp>1/(1-ExtraHarvestChance) - 1</samp>, so it will grow faster than you expect it should. For example, with a value of <samp>0.9</samp>, this field has an expected value of nine additional crops. | ||
+ | |- | ||
+ | !colspan="2"| Appearance | ||
+ | |- | ||
+ | | <samp>Texture</samp> | ||
+ | | The asset name for the texture (under the game's <samp>Content</samp> folder) containing the crop sprite. For example, the vanilla crops use <samp>TileSheets\crops</samp>. | ||
+ | |- | ||
+ | | <samp>SpriteIndex</samp> | ||
+ | | ''(Optional)'' The index of this crop in the <samp>Texture</samp>, one crop per row, where 0 is the top row. Default 0. | ||
+ | |- | ||
+ | | <samp>TintColors</samp> | ||
+ | | ''(Optional)'' The colors with which to tint the sprite when drawn (e.g. for colored flowers). A random color from the list will be chosen for each crop. See [[#Color fields|color format]]. Default none. | ||
+ | |- | ||
+ | !colspan="2"| Achievements | ||
+ | |- | ||
+ | | <samp>CountForMonoculture</samp> | ||
+ | | ''(Optional)'' Whether the player can ship 300 of this crop's harvest item to unlock the monoculture [[achievements|achievement]]. Default false. | ||
+ | |- | ||
+ | | <samp>CountForPolyculture</samp> | ||
+ | | ''(Optional)'' Whether the player must ship 15 of this crop's harvest item (along with any other required crops) to unlock the polyculture [[achievements|achievement]]. Default false. | ||
+ | |- | ||
+ | !colspan="2"| Advanced | ||
+ | |- | ||
+ | | <samp>PlantableLocationRules</samp> | ||
+ | | ''(Optional)'' The rules to decide which locations you can plant the seed in, if applicable. The first matching rule is used. This can override location checks (e.g. crops being limited to the farm), but not built-in requirements like crops needing dirt. | ||
− | + | This consists of a list of models with these fields: | |
− | |||
− | = | + | {| class="wikitable" |
− | + | |- | |
+ | ! field | ||
+ | ! effect | ||
+ | |- | ||
+ | | <samp>Id</samp> | ||
+ | | The [[Modding:Common data field types#Unique string ID|unique string ID]] for this entry within the list. | ||
+ | |- | ||
+ | | <samp>Result</samp> | ||
+ | | Indicates whether the seed can be planted in a location if this entry is selected. The possible values are: | ||
+ | * <samp>Default</samp>: the seed can be planted if the location normally allows it. This can be used to stop processing further rules, and/or set a custom <samp>DeniedMessage</samp>. | ||
+ | * <samp>Allow</samp>: the seed can be planted here, regardless of whether the location normally allows it. | ||
+ | * <samp>Deny</samp>: the seed can't be planted here, regardless of whether the location normally allows it. | ||
+ | |- | ||
+ | | <samp>Condition</samp> | ||
+ | | ''(Optional)'' A [[Modding:Game state queries|game state query]] which indicates whether this entry applies. Default true. | ||
+ | |- | ||
+ | | <samp>PlantedIn</samp> | ||
+ | | ''(Optional)'' The planting context to apply this rule for. The possible values are <samp>Ground</samp> (planted directly in dirt), <samp>GardenPot</samp> (planted in a [[Garden Pot|garden pot]]), or <samp>Any</samp>. Default <samp>Any</samp>. | ||
+ | |- | ||
+ | | <samp>DeniedMessage</samp> | ||
+ | | ''(Optional)'' If this rule prevents planting the seed, the tokenizable string to show to the player (or <samp>null</samp> to default to the normal behavior for the context). This also applies when the <samp>Result</samp> is <samp>Default</samp>, if that causes the planting to be denied. | ||
+ | |} | ||
+ | |- | ||
+ | | <samp>CustomFields</samp> | ||
+ | | The [[Modding:Common_data_field_types#Custom_fields|custom fields]] for this entry. | ||
+ | |} | ||
− | + | For example, this adds a custom cucumber crop (assuming you've already added [[Modding:Items|custom items]] for cucumber seeds and cucumber): | |
− | + | {{#tag:syntaxhighlight|<nowiki> | |
− | + | { | |
− | + | "Format": "</nowiki>{{Content Patcher version}}<nowiki>", | |
− | + | "Changes": [ | |
− | + | { | |
+ | "Action": "EditData", | ||
+ | "Target": "Data/Crops", | ||
+ | "Entries": { | ||
+ | "Example.Id_CucumberSeeds": { | ||
+ | "Seasons": [ "summer" ], | ||
+ | "DaysInPhase": [ 1, 2, 2, 2 ], // grows in 7 days with four growing sprites | ||
+ | "HarvestItemId": "Example.Id_Cucumber", | ||
+ | "Texture": "{{InternalAssetKey: assets/crops.png}}", | ||
+ | "SpriteIndex": 0 | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ] | ||
+ | }</nowiki>|lang=javascript}} | ||
− | + | [[Category:Modding]] | |
− | + | [[fr:Modding:Données des récoltes]] | |
− | + | [[ru:Модификации:Культуры]] | |
− | + | [[zh:模组:农作物数据]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | [[ |
Latest revision as of 05:16, 31 May 2024
← Index
This page explains how the game stores and parses crops data. This is an advanced guide for mod developers.
Raw data
Crop data is stored in Data\Crops.xnb, which can be unpacked for editing. Here's a portion of the raw data as of 1.6.8 for reference:
Data |
---|
{
"472": {
"Seasons": [
"Spring"
],
"DaysInPhase": [
1,
1,
1,
1
],
"RegrowDays": -1,
"IsRaised": false,
"IsPaddyCrop": false,
"NeedsWatering": true,
"PlantableLocationRules": null,
"HarvestItemId": "24",
"HarvestMinStack": 1,
"HarvestMaxStack": 1,
"HarvestMaxIncreasePerFarmingLevel": 0.0,
"ExtraHarvestChance": 0.0,
"HarvestMethod": "Grab",
"HarvestMinQuality": 0,
"HarvestMaxQuality": null,
"TintColors": [],
"Texture": "TileSheets\\crops",
"SpriteIndex": 0,
"CountForMonoculture": true,
"CountForPolyculture": true,
"CustomFields": null
},
"473": {
"Seasons": [
"Spring"
],
"DaysInPhase": [
1,
1,
1,
3,
4
],
"RegrowDays": 3,
"IsRaised": true,
"IsPaddyCrop": false,
"NeedsWatering": true,
"PlantableLocationRules": null,
"HarvestItemId": "188",
"HarvestMinStack": 1,
"HarvestMaxStack": 1,
"HarvestMaxIncreasePerFarmingLevel": 0.0,
"ExtraHarvestChance": 0.0,
"HarvestMethod": "Grab",
"HarvestMinQuality": 0,
"HarvestMaxQuality": null,
"TintColors": [],
"Texture": "TileSheets\\crops",
"SpriteIndex": 1,
"CountForMonoculture": true,
"CountForPolyculture": true,
"CustomFields": null
},
"474": {
"Seasons": [
"Spring"
],
"DaysInPhase": [
1,
2,
4,
4,
1
],
"RegrowDays": -1,
"IsRaised": false,
"IsPaddyCrop": false,
"NeedsWatering": true,
"PlantableLocationRules": null,
"HarvestItemId": "190",
"HarvestMinStack": 1,
"HarvestMaxStack": 1,
"HarvestMaxIncreasePerFarmingLevel": 0.0,
"ExtraHarvestChance": 0.0,
"HarvestMethod": "Grab",
"HarvestMinQuality": 0,
"HarvestMaxQuality": null,
"TintColors": [],
"Texture": "TileSheets\\crops",
"SpriteIndex": 2,
"CountForMonoculture": true,
"CountForPolyculture": true,
"CustomFields": null
},
"475": {
"Seasons": [
"Spring"
],
"DaysInPhase": [
1,
1,
1,
2,
1
],
"RegrowDays": -1,
"IsRaised": false,
"IsPaddyCrop": false,
"NeedsWatering": true,
"PlantableLocationRules": null,
"HarvestItemId": "192",
"HarvestMinStack": 1,
"HarvestMaxStack": 1,
"HarvestMaxIncreasePerFarmingLevel": 0.0,
"ExtraHarvestChance": 0.2,
"HarvestMethod": "Grab",
"HarvestMinQuality": 0,
"HarvestMaxQuality": null,
"TintColors": [],
"Texture": "TileSheets\\crops",
"SpriteIndex": 3,
"CountForMonoculture": true,
"CountForPolyculture": true,
"CustomFields": null
},
"476": {
"Seasons": [
"Spring"
],
"DaysInPhase": [
1,
1,
1,
1
],
"RegrowDays": -1,
"IsRaised": false,
"IsPaddyCrop": false,
"NeedsWatering": true,
"PlantableLocationRules": null,
"HarvestItemId": "248",
"HarvestMinStack": 1,
"HarvestMaxStack": 1,
"HarvestMaxIncreasePerFarmingLevel": 0.0,
"ExtraHarvestChance": 0.0,
"HarvestMethod": "Grab",
"HarvestMinQuality": 0,
"HarvestMaxQuality": null,
"TintColors": [],
"Texture": "TileSheets\\crops",
"SpriteIndex": 4,
"CountForMonoculture": true,
"CountForPolyculture": true,
"CustomFields": null
},
"273": {
"Seasons": [
"Spring"
],
"DaysInPhase": [
1,
2,
2,
3
],
"RegrowDays": -1,
"IsRaised": false,
"IsPaddyCrop": true,
"NeedsWatering": true,
"PlantableLocationRules": null,
"HarvestItemId": "271",
"HarvestMinStack": 1,
"HarvestMaxStack": 1,
"HarvestMaxIncreasePerFarmingLevel": 0.1,
"ExtraHarvestChance": 0.1,
"HarvestMethod": "Scythe",
"HarvestMinQuality": 0,
"HarvestMaxQuality": null,
"TintColors": [],
"Texture": "TileSheets\\crops",
"SpriteIndex": 34,
"CountForMonoculture": false,
"CountForPolyculture": false,
"CustomFields": null
},
"831": {
"Seasons": [
"Summer"
],
"DaysInPhase": [
1,
2,
3,
4
],
"RegrowDays": -1,
"IsRaised": false,
"IsPaddyCrop": true,
"NeedsWatering": true,
"PlantableLocationRules": null,
"HarvestItemId": "830",
"HarvestMinStack": 1,
"HarvestMaxStack": 1,
"HarvestMaxIncreasePerFarmingLevel": 0.0,
"ExtraHarvestChance": 0.0,
"HarvestMethod": "Grab",
"HarvestMinQuality": 0,
"HarvestMaxQuality": null,
"TintColors": [],
"Texture": "TileSheets\\crops",
"SpriteIndex": 42,
"CountForMonoculture": false,
"CountForPolyculture": false,
"CustomFields": null
},
"477": {
"Seasons": [
"Spring"
],
"DaysInPhase": [
1,
2,
2,
1
],
"RegrowDays": -1,
"IsRaised": false,
"IsPaddyCrop": false,
"NeedsWatering": true,
"PlantableLocationRules": null,
"HarvestItemId": "250",
"HarvestMinStack": 1,
"HarvestMaxStack": 1,
"HarvestMaxIncreasePerFarmingLevel": 0.0,
"ExtraHarvestChance": 0.0,
"HarvestMethod": "Scythe",
"HarvestMinQuality": 0,
"HarvestMaxQuality": null,
"TintColors": [],
"Texture": "TileSheets\\crops",
"SpriteIndex": 5,
"CountForMonoculture": true,
"CountForPolyculture": true,
"CustomFields": null
},
"478": {
"Seasons": [
"Spring"
],
"DaysInPhase": [
2,
2,
2,
3,
4
],
"RegrowDays": -1,
"IsRaised": false,
"IsPaddyCrop": false,
"NeedsWatering": true,
"PlantableLocationRules": null,
"HarvestItemId": "252",
"HarvestMinStack": 1,
"HarvestMaxStack": 1,
"HarvestMaxIncreasePerFarmingLevel": 0.0,
"ExtraHarvestChance": 0.0,
"HarvestMethod": "Grab",
"HarvestMinQuality": 0,
"HarvestMaxQuality": null,
"TintColors": [],
"Texture": "TileSheets\\crops",
"SpriteIndex": 6,
"CountForMonoculture": true,
"CountForPolyculture": true,
"CustomFields": null
}
}
|
Format
The asset Data\Crops consists of a string → model lookup, where...
- The key is the unqualified item ID for the seed item.
- The value is model with the fields listed below.
field | effect | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Growth | |||||||||||||
Seasons | The seasons in which this crop can grow (any combination of spring, summer, fall, and winter). | ||||||||||||
DaysInPhase | The number of days in each visual step of growth before the crop is harvestable. Each step corresponds to a sprite in the crop's row (see SpriteIndex).
For example, a crop with | ||||||||||||
RegrowDays | (Optional) The number of days before the crop regrows after harvesting, or -1 if it can't regrow. The crop will keep the full-grown sprite (i.e. the last phase in DaysInPhase) during this time. Default -1. | ||||||||||||
IsRaised | (Optional) Whether this is a raised crop on a trellis that can't be walked through. Default false. | ||||||||||||
IsPaddyCrop | (Optional) Whether this crop can be planted near water for a unique paddy dirt texture, faster growth time, and auto-watering. For example, rice and taro are paddy crops. Default false. | ||||||||||||
NeedsWatering | (Optional) Whether this crop needs to be watered to grow (e.g. fiber seeds don't). Default true. | ||||||||||||
Harvest | |||||||||||||
HarvestItemId | The item ID produced when this crop is harvested. | ||||||||||||
HarvestMethod | (Optional) How the crop can be harvested. This can be Grab (crop is harvested by hand) or Scythe (harvested with a scythe). Default Grab. | ||||||||||||
HarvestMinStack HarvestMaxStack |
(Optional) The minimum and maximum number of HarvestItemId to produce (before HarvestMaxIncreasePerFarmingLevel and ExtraHarvestChance are applied). A value within this range (inclusive) will be randomly chosen each time the crop is harvested. The minimum defaults to 1, and the maximum defaults to the minimum. | ||||||||||||
HarvestMinQuality HarvestMaxQuality |
(Optional) If set, the minimum and maximum quality of the harvest crop. These fields set a constraint that's applied after the quality is calculated normally, they don't affect the initial quality logic. | ||||||||||||
HarvestMaxIncreasePerFarmingLevel | (Optional) The number of extra harvests to produce per farming level. This is rounded down to the nearest integer and added to HarvestMaxStack. Defaults to 0.
For example, a value of 0.2 is equivalent to +1 max at level 5 and +2 at level 10. | ||||||||||||
ExtraHarvestChance | (Optional) The probability that harvesting the crop will produce extra harvest items, as a value between 0 (never) and 0.9 (nearly always). This is repeatedly rolled until it fails, then the number of successful rolls is added to the produced count. For example, tomatoes use 0.05. Default 0. This is a geometric series with expected value of 1/(1-ExtraHarvestChance) - 1, so it will grow faster than you expect it should. For example, with a value of 0.9, this field has an expected value of nine additional crops. | ||||||||||||
Appearance | |||||||||||||
Texture | The asset name for the texture (under the game's Content folder) containing the crop sprite. For example, the vanilla crops use TileSheets\crops. | ||||||||||||
SpriteIndex | (Optional) The index of this crop in the Texture, one crop per row, where 0 is the top row. Default 0. | ||||||||||||
TintColors | (Optional) The colors with which to tint the sprite when drawn (e.g. for colored flowers). A random color from the list will be chosen for each crop. See color format. Default none. | ||||||||||||
Achievements | |||||||||||||
CountForMonoculture | (Optional) Whether the player can ship 300 of this crop's harvest item to unlock the monoculture achievement. Default false. | ||||||||||||
CountForPolyculture | (Optional) Whether the player must ship 15 of this crop's harvest item (along with any other required crops) to unlock the polyculture achievement. Default false. | ||||||||||||
Advanced | |||||||||||||
PlantableLocationRules | (Optional) The rules to decide which locations you can plant the seed in, if applicable. The first matching rule is used. This can override location checks (e.g. crops being limited to the farm), but not built-in requirements like crops needing dirt.
This consists of a list of models with these fields:
| ||||||||||||
CustomFields | The custom fields for this entry. |
For example, this adds a custom cucumber crop (assuming you've already added custom items for cucumber seeds and cucumber):
{
"Format": "2.0.0",
"Changes": [
{
"Action": "EditData",
"Target": "Data/Crops",
"Entries": {
"Example.Id_CucumberSeeds": {
"Seasons": [ "summer" ],
"DaysInPhase": [ 1, 2, 2, 2 ], // grows in 7 days with four growing sprites
"HarvestItemId": "Example.Id_Cucumber",
"Texture": "{{InternalAssetKey: assets/crops.png}}",
"SpriteIndex": 0
}
}
}
]
}