Line 191: |
Line 191: |
| | | |
| * See ''[[#Update impact|update impact]]'' below. | | * See ''[[#Update impact|update impact]]'' below. |
| + | |
| + | ===Home renovations=== |
| + | Stardew Valley 1.5 adds [[Carpenter's Shop#House Renovations|house renovations]]. Mods can add or change removations by editing the <samp>Data/HomeRenovations</samp> asset. This consists of a string → model lookup, where the asset key is a unique renovation ID. The asset value is a model with these fields: |
| + | |
| + | {| class="wikitable" |
| + | |- |
| + | ! field |
| + | ! effect |
| + | |- |
| + | | <samp>TextStrings</samp> |
| + | | A translation key in the form <samp>{{t|asset name}}:{{t|key}}</samp> (like <samp>Strings\\Locations:ScienceHouse_Renovation_BuildCrib</samp>). The translation text should contain three slash-delimited fields: |
| + | {| class="wikitable" |
| + | |- |
| + | ! index |
| + | ! effect |
| + | |- |
| + | | 0 |
| + | | The translated display name shown in the renovation menu. |
| + | |- |
| + | | 1 |
| + | | The translated description shown in the renovation menu. |
| + | |- |
| + | | 2 |
| + | | The message shown to ask the player which area to renovate. |
| + | |} |
| + | For example, the vanilla 'remove crib' matches a translation in this format: |
| + | <pre>"Remove Crib/Remove the crib from your home./Select a crib to remove."</pre> |
| + | |- |
| + | | <samp>Requirements</samp> |
| + | | The criteria that must match for the renovation to appear as an option. This consists of a list of models with these fields: |
| + | {| class="wikitable" |
| + | |- |
| + | ! field |
| + | ! effect |
| + | |- |
| + | | <samp>Type</samp> |
| + | | The requirement type. This can be <samp>Mail</samp> (check if the player has the given [[Modding:Mail data#Mail flags|mail flag]]) or <samp>Value</samp> (check the value of a C# <samp>NetInt</samp> field on the farmhouse instance). Any other type always returns true. |
| + | |- |
| + | | <samp>Key</samp> |
| + | |   |
| + | * For a <samp>Mail</samp> requirement, the mail flag. |
| + | * For a <samp>Value</samp> requirement, the C# <samp>NetInt</samp> field name. |
| + | |- |
| + | | <samp>Value</samp> |
| + | |   |
| + | * For a <samp>Mail</samp> requirement, <samp>"0"</samp> (player must ''not'' have the flag) or <samp>"1"</samp> (player must have it). |
| + | * For a <samp>Value</samp> requirement, the required field value. The value can be prefixed with <samp>!</samp> to require any value ''except'' this one. |
| + | |} |
| + | |
| + | For example, <code>"Key": "renovation_bedroom_open", "Value": "1"</code> matches if the player has the <samp>renovation_bedroom_open</samp> mail flag. |
| + | |- |
| + | | <samp>RenovateActions</samp> |
| + | | The actions to perform after the renovation is applied. This consists of a list of models with these fields: |
| + | {| class="wikitable" |
| + | |- |
| + | ! field |
| + | ! effect |
| + | |- |
| + | | <samp>Type</samp> |
| + | | The action type. This can be <samp>Mail</samp> (add or remove a [[Modding:Mail data#Mail flags|mail flag]]) or <samp>Value</samp> (set the value of a C# field on the farmhouse instance). Any other type is ignored. |
| + | |- |
| + | | <samp>Key</samp> |
| + | |   |
| + | * For a <samp>Mail</samp> requirement, the mail flag to add or remove. |
| + | * For a <samp>Value</samp> requirement, the C# <samp>NetInt</samp> field name. |
| + | |- |
| + | | <samp>Value</samp> |
| + | |   |
| + | * For a <samp>Mail</samp> requirement, either <samp>"0"</samp> (remove the mail flag) or <samp>"1"</samp> (add it). |
| + | * For a <samp>Value</samp> requirement, either the integer value to set, or the exact string <samp>"selected"</samp> to set it to the index of the applied renovation. |
| + | |} |
| + | |- |
| + | | <samp>RectGroups</samp> |
| + | | The tile areas within the farmhouse where the renovation can be placed. |
| + | |- |
| + | | <samp>AnimationType</samp> |
| + | | ''(Optional)'' The animation to play when the renovation is applied. The possible values are <samp>destroy</samp> or <samp>build</samp>. Any other value defaults to <samp>build</samp>. |
| + | |- |
| + | | <samp>CheckForObstructions</samp> |
| + | | ''(Optional)'' Whether to prevent the player from applying the renovations if there are any players, NPCs, items, etc within the target area. Default false. |
| + | |- |
| + | | <samp>SpecialRect</samp> |
| + | | ''(Optional)'' A dynamic area to add to the <samp>RectGroups</samp> field. The only supported value is <c>crib</c>, which is the farmhouse area containing the cribs. |
| + | |} |
| + | |
| + | For example, this content pack redefines one of the vanilla home renovations: |
| + | |
| + | {{#tag:syntaxhighlight|<nowiki> |
| + | { |
| + | "Format": "</nowiki>{{Content Patcher version}}<nowiki>", |
| + | "Changes": [ |
| + | { |
| + | "Action": "EditData", |
| + | "Target": "Data/HomeRenovations", |
| + | "Entries": { |
| + | "open_bedroom": { |
| + | "TextStrings": "Strings\\Locations:ScienceHouse_Renovation_OpenBedroom", |
| + | "AnimationType": "destroy", |
| + | "CheckForObstructions": true, |
| + | "Requirements": [ |
| + | { |
| + | "Type": "Mail", |
| + | "Key": "renovation_bedroom_open", |
| + | "Value": "0" |
| + | } |
| + | ], |
| + | "RenovateActions": [ |
| + | { |
| + | "Type": "Mail", |
| + | "Key": "renovation_bedroom_open", |
| + | "Value": "1" |
| + | } |
| + | ], |
| + | "RectGroups": [ |
| + | { |
| + | "Rects": [ |
| + | { "X": 21, "Y": 10, "Width": 2, "Height": 8 }, |
| + | { "X": 21, "Y": 19, "Width": 2, "Height": 1 } |
| + | ] |
| + | } |
| + | ] |
| + | } |
| + | } |
| + | ] |
| + | }</nowiki>|lang=javascript}} |
| | | |
| ===Special orders=== | | ===Special orders=== |