Difference between revisions of "Modding:Crop data"
m ((+zh link)) |
|||
Line 165: | Line 165: | ||
[[fr:Modding:Données des récoltes]] | [[fr:Modding:Données des récoltes]] | ||
[[ru:Модификации:Культуры]] | [[ru:Модификации:Культуры]] | ||
+ | [[zh:模组:农作物数据]] |
Revision as of 18:45, 16 January 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 Content\Data\Crops.xnb, which can be unpacked for editing. Here's the raw data as of 1.5.1 for reference:
Data |
---|
{
"472": "1 1 1 1/spring/0/24/-1/0/false/false/false",
"473": "1 1 1 3 4/spring/1/188/3/0/false/true/false",
"474": "1 2 4 4 1/spring/2/190/-1/0/false/false/false",
"475": "1 1 1 2 1/spring/3/192/-1/0/true 1 1 0 .2/false/false",
"476": "1 1 1 1/spring/4/248/-1/0/false/false/false",
"273": "1 2 2 3/spring/34/271/-1/1/true 1 1 10 .1/false/false",
"831": "1 2 3 4/summer/42/830/-1/0/false/false/false",
"477": "1 2 2 1/spring/5/250/-1/1/false/false/false",
"478": "2 2 2 3 4/spring/6/252/-1/0/false/false/false",
"745": "1 1 2 2 2/spring/36/400/4/0/true 1 1 0 .02/false/false",
"479": "1 2 3 3 3/summer/7/254/-1/0/false/false/false",
"480": "2 2 2 2 3/summer/8/256/4/0/true 1 1 0 .05/false/false",
"481": "1 3 3 4 2/summer/9/258/4/0/true 3 3 0 .02/false/false",
"482": "1 1 1 1 1/summer/10/260/3/0/true 1 1 0 .03/false/false",
"483": "1 1 1 1/summer fall/11/262/-1/1/false/false/false",
"484": "2 1 2 1/summer/12/264/-1/0/false/false/false",
"485": "2 1 2 2 2/summer/13/266/-1/0/false/false/false",
"486": "2 3 2 3 3/summer/14/268/-1/0/false/false/false",
"833": "1 3 3 4 3/summer/43/832/7/0/false/false/false",
"433": "1 2 2 3 2/spring summer/40/433/2/0/true 4 4 0 .02/false/false",
"802": "2 2 2 3 3/spring summer fall winter/41/90/3/0/false/false/false",
"487": "2 3 3 3 3/summer fall/15/270/4/0/false/false/false",
"302": "1 1 2 3 4/summer/37/304/1/0/false/true/false",
"301": "1 1 2 3 3/fall/38/398/3/0/false/true/false",
"299": "1 2 2 2/fall/39/300/-1/1/false/false/false",
"488": "1 1 1 1 1/fall/16/272/5/0/true 1 1 0 .002/false/false",
"489": "2 2 1 2 1/fall/17/274/-1/0/false/false/false",
"490": "1 2 3 4 3/fall/18/276/-1/0/false/false/false",
"491": "1 1 1 1/fall/19/278/-1/0/false/false/false",
"492": "1 3 3 3/fall/20/280/-1/0/false/false/false",
"493": "1 2 1 1 2/fall/21/282/5/0/true 2 2 0 .1/false/false",
"494": "1 1 2 2/fall/22/284/-1/0/false/false/false",
"499": "2 7 7 7 5/spring summer fall/24/454/7/0/false/false/false",
"427": "1 1 2 2/spring/26/591/-1/0/false/false/true 255 186 255 223 191 255 255 246 0 255 80 0 255 158 193",
"429": "1 2 2 2/spring/27/597/-1/0/false/false/true 35 127 255 109 131 255 112 207 255 191 228 255 94 121 255 40 150 255",
"453": "1 2 2 2/summer/28/376/-1/0/false/false/true 255 0 0 254 254 254 255 170 0",
"455": "1 2 3 2/summer/29/593/-1/0/false/false/true 0 208 255 99 255 210 255 212 0 255 144 122 255 0 238 206 91 255",
"431": "1 2 3 2/summer fall/30/421/-1/0/false/false/false",
"425": "1 4 4 3/fall/31/595/-1/0/false/false/true 187 0 255 119 137 255 71 227 255 255 127 144 205 178 255 140 119 255",
"347": "2 4 6 6 6/fall/32/417/-1/0/false/false/false",
"495": "3 4/spring/23/16/-1/0/false/false/false",
"496": "3 4/summer/23/396/-1/0/false/false/false",
"497": "3 4/fall/23/404/-1/0/false/false/false",
"498": "3 4/winter/23/412/-1/0/false/false/false",
"885": "1 2 2 2/spring summer fall winter/44/771/-1/1/true 4 7 0 .01/false/false",
"890": "1 1 1 1/spring summer fall winter/47/889/-1/0/false/false/false",
}
|
Format
Index | Field | Example Value | |
---|---|---|---|
Key | Seed Index (from ObjectInformation.xnb) | 473 (Bean Starter) | 455 (Spangle Seeds) |
0 | Days in each stage of growth | 1 1 1 3 4 | 1 2 3 2 |
1 | Growth Season(s) | spring | summer |
2 | Index in Sprite Sheet (Content\TileSheets\Crops.xnb) | 1 | 29 |
3 | Index of Harvest (from ObjectInformation.xnb) | 188 (Green Bean) | 593 (Summer Spangle) |
4 | Regrow after Harvest | 3 | -1 |
5 | Harvest Method | 0 | 0 |
6 | Chance for Extra Harvest | true 1 2 6 0 | false |
7 | Raised Seeds | true | false |
8 | Tint Color | false | true 0 208 255 99 255 210 255 212 0 255 144 122 255 0 238 206 91 255 |
Days in each stage of growth
The number of days in each visual step of growth. The final stage will be harvestable after the specified number of days.
Note that speedgrow/agricultralist can only remove up to 3 days per stage of growth, so if your growth stages are very long the fertilizers may appear to work weirdly.
Regrow after harvest
Either -1 for no regrowth, or the number of days until the crop can be harvested again.
Harvest method
1 for Scythe, 0 for all others
Chance for extra harvest
If this value is true, then the numbers that follow are parsed as:
- minHarvest
- maxHarvest
- maxHarvestIncreasePerFarmingLevel
- chanceForExtraCrops
The game determines the number of crops gained at a single harvest using the following code from Crops.cs::harvest(), where num is the number of crops gained:
if (this.minHarvest > 1 || this.maxHarvest > 1)
num = random.Next(this.minHarvest, Math.Max(this.minHarvest + 1, this.maxHarvest + 1 + Game1.player.FarmingLevel / this.maxHarvestIncreasePerFarmingLevel));
if (this.chanceForExtraCrops > 0.0)
while (random.NextDouble() < Math.Min(0.9, this.chanceForExtraCrops))
num++;
if (random.NextDouble() < (double)Game1.dailyLuck / 1200.0 + 9.9999997473787516E-05)
num *= 2;
The value in chanceForExtraCrops may add additional crops to a harvest, calculated independently of the other 3 variables. For example, each harvest of a Potato Seed (475) has ≈20% chance of yielding an extra potato, in addition to the one Potato given as standard harvest. Each harvest of a Blueberry Seed (481) has ≈2% chance of yielding an extra Blueberry, in addition to the 3 Blueberries given as standard harvest.
Raised seeds
True for trellis crops (Grapes, Hops, Green Beans), false for all others.
Tint color
If Tint Color is true, a string of rgb() values follows. In the example above, Summer Spangle can be one of 6 different colors:
- rgb(0, 208, 255)
- rgb(99, 255, 210)
- rgb(255, 212, 0)
- rgb(255, 144, 122)
- rgb(255, 0, 238)
- rgb(206, 91, 255)