Line 96: |
Line 96: |
| | | |
| ==Data format (Stardew Valley 1.6 and later)== | | ==Data format (Stardew Valley 1.6 and later)== |
− | ====Location format====
| + | {{upcoming|1.6}} |
− | The asset consists of a string → model lookup, where...
| + | |
| + | You can add or edit locations by editing the <samp>Data/Locations</samp> asset. |
| + | |
| + | This consists of a string → model lookup, where... |
| * The key is the internal name of the location to change, which will also be used as the location's <samp>Name</samp> (not <samp>DisplayName</samp>) field. This should only contain alphanumeric/underscore/dot characters, and custom locations' names should be prefixed with your mod ID like <samp>Example.ModId_LocationName</samp>. (The farm will use <samp>Farm_{{t|type key}}</samp> for a vanilla farm type, or <samp>Farm_{{t|type ID}}</samp> for a custom farm type, or <samp>Farm_Standard</samp> if no type-specific entry was found.) | | * The key is the internal name of the location to change, which will also be used as the location's <samp>Name</samp> (not <samp>DisplayName</samp>) field. This should only contain alphanumeric/underscore/dot characters, and custom locations' names should be prefixed with your mod ID like <samp>Example.ModId_LocationName</samp>. (The farm will use <samp>Farm_{{t|type key}}</samp> for a vanilla farm type, or <samp>Farm_{{t|type ID}}</samp> for a custom farm type, or <samp>Farm_Standard</samp> if no type-specific entry was found.) |
| * The value is a model with the fields listed below. | | * The value is a model with the fields listed below. |
| | | |
− | '''Basic info''':
| + | ===Basic info=== |
− | {| class="wikitable" style="margin-left: 2em;" | + | {| class="wikitable" |
| |- | | |- |
| ! field | | ! field |
Line 108: |
Line 111: |
| |- | | |- |
| | <samp>DisplayName</samp> | | | <samp>DisplayName</samp> |
− | | ''(Optional but strongly recommended)'' A [[#Tokenizable string format|tokenizable string]] for the translated location name. This is used anytime the location name is shown in-game for base game logic or mods. | + | | ''(Optional but strongly recommended)'' A [[Modding:Migrate to Stardew Valley 1.6#Tokenizable string format|tokenizable string]] for the translated location name. This is used anytime the location name is shown in-game for base game logic or mods. |
| |- | | |- |
| | <samp>DefaultArrivalTile</samp> | | | <samp>DefaultArrivalTile</samp> |
Line 117: |
Line 120: |
| |} | | |} |
| | | |
− | '''Creation''':
| + | ===Creation=== |
− | {| class="wikitable" style="margin-left: 2em;" | + | {| class="wikitable" |
| |- | | |- |
| ! field | | ! field |
Line 144: |
Line 147: |
| |} | | |} |
| | | |
− | '''Contents''':
| + | ===Contents=== |
− | {| class="wikitable" style="margin-left: 2em;" | + | {| class="wikitable" |
| |- | | |- |
| ! field | | ! field |
Line 162: |
Line 165: |
| |- | | |- |
| | ''common fields'' | | | ''common fields'' |
− | | See [[#Item spawn fields|item spawn fields]] for the generic item fields supported by artifact spot drops. | + | | See [[Modding:Migrate to Stardew Valley 1.6#Item spawn fields|item spawn fields]] for the generic item fields supported by artifact spot drops. |
| | | |
− | If set to an [[#Item queries|item query]] which returns multiple items, one of them will be selected at random. | + | If set to an [[Modding:Migrate to Stardew Valley 1.6#Item queries|item query]] which returns multiple items, one of them will be selected at random. |
| |- | | |- |
| | <samp>Chance</samp> | | | <samp>Chance</samp> |
Line 235: |
Line 238: |
| |- | | |- |
| | ''common fields'' | | | ''common fields'' |
− | | See [[#Item spawn fields|item spawn fields]] for the generic item fields supported by forage items. | + | | See [[Modding:Migrate to Stardew Valley 1.6#Item spawn fields|item spawn fields]] for the generic item fields supported by forage items. |
| | | |
− | This must return an <samp>Object</samp> item (or subclass of <samp>Object</samp>). If set to an [[#Item queries|item query]] which returns multiple items, one of them will be selected at random. | + | This must return an <samp>Object</samp> item (or subclass of <samp>Object</samp>). If set to an [[Modding:Migrate to Stardew Valley 1.6#Item queries|item query]] which returns multiple items, one of them will be selected at random. |
| |- | | |- |
| | <samp>Chance</samp> | | | <samp>Chance</samp> |
Line 295: |
Line 298: |
| |- | | |- |
| | <samp>CanBeInherited</samp> | | | <samp>CanBeInherited</samp> |
− | | ''(Optional)'' Whether this fish can be spawned in another location via the <samp>LOCATION_FISH</samp> [[#Item queries|item query]]. Default true. | + | | ''(Optional)'' Whether this fish can be spawned in another location via the <samp>LOCATION_FISH</samp> [[Modding:Migrate to Stardew Valley 1.6#Item queries|item query]]. Default true. |
| |- | | |- |
| | <samp>SetFlagOnCatch</samp> | | | <samp>SetFlagOnCatch</samp> |
Line 301: |
Line 304: |
| |- | | |- |
| | <samp>ChanceModifiers</samp> | | | <samp>ChanceModifiers</samp> |
− | | ''(Optional)'' [[#Quantity modifiers|Quantity modifiers]] applied to the <samp>Chance</samp> value. Default none. | + | | ''(Optional)'' [[Modding:Migrate to Stardew Valley 1.6#Quantity modifiers|Quantity modifiers]] applied to the <samp>Chance</samp> value. Default none. |
| |- | | |- |
| | <samp>ChanceModifierMode</samp> | | | <samp>ChanceModifierMode</samp> |
− | | ''(Optional)'' [[#Quantity modifiers|quantity modifier modes]] which indicate what to do if multiple modifiers in the <samp>ChanceModifiers</samp> field apply at the same time. Default <samp>Stack</samp>. | + | | ''(Optional)'' [[Modding:Migrate to Stardew Valley 1.6#Quantity modifiers|quantity modifier modes]] which indicate what to do if multiple modifiers in the <samp>ChanceModifiers</samp> field apply at the same time. Default <samp>Stack</samp>. |
| |} | | |} |
| |- | | |- |
Line 325: |
Line 328: |
| |- | | |- |
| | ''common fields'' | | | ''common fields'' |
− | | See [[#Item spawn fields|item spawn fields]] for the generic item fields supported by forage items. | + | | See [[Modding:Migrate to Stardew Valley 1.6#Item spawn fields|item spawn fields]] for the generic item fields supported by forage items. |
| | | |
− | This must return an <samp>Object</samp> (<samp>(O)</samp>)-type item. If it uses an [[#Item queries|item query]] that returns multiple items, one will be selected at random. If it returns null or a non-<samp>Object</samp> item, the spawn attempt will be skipped (with a logged warning if the item type is invalid). | + | This must return an <samp>Object</samp> (<samp>(O)</samp>)-type item. If it uses an [[Modding:Migrate to Stardew Valley 1.6#Item queries|item query]] that returns multiple items, one will be selected at random. If it returns null or a non-<samp>Object</samp> item, the spawn attempt will be skipped (with a logged warning if the item type is invalid). |
| |- | | |- |
| | <samp>Chance</samp> | | | <samp>Chance</samp> |
Line 352: |
Line 355: |
| |} | | |} |
| | | |
− | '''Music''':
| + | ===Music=== |
− | {| class="wikitable" style="margin-left: 2em;" | + | {| class="wikitable" |
| |- | | |- |
| ! field | | ! field |
Line 373: |
Line 376: |
| |- | | |- |
| | <samp>Condition</samp> | | | <samp>Condition</samp> |
− | | ''(Optional)'' A [[#Game state queries|game state query]] which indicates whether this entry applies. Default true. | + | | ''(Optional)'' A [[Modding:Migrate to Stardew Valley 1.6#Game state queries|game state query]] which indicates whether this entry applies. Default true. |
| |- | | |- |
| | <samp>Track</samp> | | | <samp>Track</samp> |
− | | The [[#Custom audio|audio track ID]] to play. | + | | The [[Modding:Migrate to Stardew Valley 1.6#Custom audio|audio track ID]] to play. |
| |} | | |} |
| |- | | |- |
Line 402: |
Line 405: |
| |} | | |} |
| | | |
− | '''Advanced''':
| + | ===Advanced=== |
− | {| class="wikitable" style="margin-left: 2em;" | + | {| class="wikitable" |
| |- | | |- |
| ! field | | ! field |
Line 409: |
Line 412: |
| |- | | |- |
| | <samp>CustomFields</samp> | | | <samp>CustomFields</samp> |
− | | The [[#Custom data fields|custom fields]] for this entry. | + | | The [[Modding:Migrate to Stardew Valley 1.6#Custom data fields|custom fields]] for this entry. |
| |} | | |} |
| | | |
− | ====<samp>Default</samp> entry==== | + | ==Default entry== |
− | The asset has a location with the key <samp>Default</samp>. The <samp>ArtifactSpots</samp>, <samp>Fish</samp>, and <samp>Forage</samp> fields for this entry are added to every other location's equivalent fields, so this lets you add artifact spots / fish / forage in all locations.
| + | The <samp>Data/Locations</samp> asset has a location with the key <samp>Default</samp>. The <samp>ArtifactSpots</samp>, <samp>Fish</samp>, and <samp>Forage</samp> fields for this entry are added to every other location's equivalent fields, so this lets you add artifact spots / fish / forage in all locations. |
| | | |
| ==Location names== | | ==Location names== |