模组:果树数据

来自Stardew Valley Wiki
跳到导航 跳到搜索

模组:目录

此页面解释游戏是如何存储和解析果树数据

原始数据

果树数据存储在Content\Data\FruitTrees.xnb

数据格式

字段 效果
DisplayName 这是个可标记字符串,用于放置树的名字。这应该返回一个不带“tree”的放置名(例如 Cherry 表示樱桃树)。这使用于 UI 信息中像 "Your <display name> tree wasn't able to grow last night".
Seasons The seasons in which the fruit tree bears fruit. This consists of an array of season names (any combination of spring, summer, fall, or winter).

Note: the previous 'island' season value is no longer valid. Using summer is equivalent to how it worked before (since we now have per-location seasons).

Fruit The fruit items to add to the tree each day while the tree is in-season. The first matching fruit (if any) is selected each day.

This consists of a list of models with these fields:

field effect
common fields See item spawn fields for the generic item fields supported for fruit items.

Notes:

  • If set to an item query which returns multiple items, one of them will be selected at random.
  • Season conditions are ignored in non-seasonal locations like the greenhouse and Ginger Island.
Season (Optional) If set, the group only applies if the tree's location is in this season. This is ignored in non-seasonal locations like the greenhouse and Ginger Island.
Chance (Optional) The probability that this entry is selected, as a value between 0 (never drops) and 1 (always drops). Default 1 (100% chance).
Texture The asset name for the texture under the game's Content folder. Use \ (or \\ in JSON) to separate name segments if needed. For example, vanilla fruit trees use TileSheets\fruitTrees.
TextureSpriteRow The tree's row index in the Texture spritesheet (e.g. 0 for the first tree, 1 for the second tree, etc).
PlantableLocationRules (Optional) The rules to decide which locations you can plant the sapling 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:

field effect
Id The unique string ID for this entry within the list.
Result Indicates whether the sapling can be planted in a location if this entry is selected. The possible values are:
  • Default: the sapling can be planted if the location normally allows it. This can be used to stop processing further rules, and/or set a custom DeniedMessage.
  • Allow: the sapling can be planted here, regardless of whether the location normally allows it.
  • Deny: the sapling can't be planted here, regardless of whether the location normally allows it.
Condition (Optional) A game state query which indicates whether this entry applies. Default true.
PlantedIn (Optional) The planting context to apply this rule for. The possible values are Ground (planted directly in the ground), GardenPot (planted in a garden pot), or Any. Default Any.

Note that saplings can't be planted in garden pots.

DeniedMessage (Optional) If this rule prevents planting the sapling, the tokenizable string to show to the player (or null to default to the normal behavior for the context). This also applies when the Result is Default, if that causes the planting to be denied.
CustomFields The custom fields for this entry.