Changes

→‎Custom locations: update for build 22309: split CreateLocations/Locations, split farm entry by type, add fish ChanceModifier* and MaxDistanceFromShore fields, replace fish Priority field with Precedence, simplify CrabPotAreas and FishAreas
Line 1,528: Line 1,528:  
! effect
 
! effect
 
|-
 
|-
| <samp>Locations</samp>
+
| <samp>CreateLocations</samp>
| The locations to add to the game.
+
| The location instances to create when the save is loaded.
    
This consists of a string → model lookup, where...
 
This consists of a string → model lookup, where...
Line 1,535: Line 1,535:  
* The value is a model with the fields listed below.
 
* The value is a model with the fields listed below.
   −
{| class="wikitable"
  −
|-
  −
! field
  −
! effect
  −
|-
  −
| <samp>CreateLocation</samp>
  −
| ''(Optional)'' If set, the in-game location will be added automatically using the provided data. If omitted, the location won't be created automatically.
  −
  −
This consists of a model with these fields:
   
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 1,558: Line 1,549:  
| ''(Optional)'' The full name of the C# location class to create. This must be one of the vanilla types to avoid a crash when saving. There are too many to list here, but the most useful types are likely <samp>StardewValley.GameLocation</samp> (default value) and <samp>StardewValley.Locations.DecoratableLocation</samp>.
 
| ''(Optional)'' The full name of the C# location class to create. This must be one of the vanilla types to avoid a crash when saving. There are too many to list here, but the most useful types are likely <samp>StardewValley.GameLocation</samp> (default value) and <samp>StardewValley.Locations.DecoratableLocation</samp>.
 
|}
 
|}
 +
|-
 +
| <samp>Locations</samp>
 +
| The gameplay data for locations in the game (regardless of whether they were created using the <samp>CreateLocations</samp> field or some other way).
 +
 +
This consists of a string → model lookup, where...
 +
* The key is the internal name of the location to change. (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.
 +
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! effect
 
|-
 
|-
 
| <samp>DisplayName</samp>
 
| <samp>DisplayName</samp>
Line 1,606: Line 1,609:  
| ''(Optional)'' The fishing areas for [[Crab Pot|crab pots]] placed in the location.
 
| ''(Optional)'' The fishing areas for [[Crab Pot|crab pots]] placed in the location.
   −
This consists of a list of models with these fields:
+
This consists of a string → model lookup, where the key is the crab pot area ID and the value consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! field
 
! field
 
! effect
 
! effect
|-
  −
| <samp>ID</samp>
  −
| A unique identifier for this entry within the current list. The ID should only contain alphanumeric/underscore/dot characters. For custom areas, this should be prefixed with your mod ID like <samp>Example.ModId_AreaName</samp>.
   
|-
 
|-
 
| <samp>FishTypes</samp>
 
| <samp>FishTypes</samp>
 
| A list of fish types that can be caught in this location. This is matched against field index 4 in [[Modding:Fish data|<samp>Data/Fish</samp>]] for 'trap' (i.e. crab pot) fish. The vanilla types are <samp>freshwater</samp> and <samp>ocean</samp>.
 
| A list of fish types that can be caught in this location. This is matched against field index 4 in [[Modding:Fish data|<samp>Data/Fish</samp>]] for 'trap' (i.e. crab pot) fish. The vanilla types are <samp>freshwater</samp> and <samp>ocean</samp>.
|-
  −
| <samp>Condition</samp>
  −
| ''(Optional)'' A [[#Game state queries|game state query]] which indicates whether this area should be available. Defaults to always true.
   
|-
 
|-
 
| <samp>Position</samp>
 
| <samp>Position</samp>
 
| ''(Optional)'' The tile area within the location where the crab pot must be placed, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. Default null (anywhere).
 
| ''(Optional)'' The tile area within the location where the crab pot must be placed, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. Default null (anywhere).
 +
 +
Areas with a <samp>Position</samp> value have priority over those without.
 
|}
 
|}
 
|-
 
|-
Line 1,628: Line 1,627:  
| ''(Optional)'' The fishing areas for fish caught with a fishing rod in the location. This provide a quick way to specify the tile areas for fish without repeating the position each time, using the fish <samp>FishAreaId</samp> field.
 
| ''(Optional)'' The fishing areas for fish caught with a fishing rod in the location. This provide a quick way to specify the tile areas for fish without repeating the position each time, using the fish <samp>FishAreaId</samp> field.
   −
This consists of a list of models with these fields:
+
This consists of a string → model lookup, where the key is the fish area ID and the value consists of a list of models with these fields:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
 
! field
 
! field
 
! effect
 
! effect
|-
  −
| <samp>Id</samp>
  −
| A unique identifier for this entry within the current list. The ID should only contain alphanumeric/underscore/dot characters. For custom areas, this should be prefixed with your mod ID like <samp>Example.ModId_AreaName</samp>.
  −
  −
This is semi-optional — if omitted, it'll be auto-generated from the <samp>AreaId</samp> field. However multiple entries with the same ID may cause unintended behavior, so it's often a good idea to set a globally unique ID instead.
  −
|-
  −
| <samp>AreaId</samp>
  −
| The area ID that can be referenced by a fish's <samp>FishAreaId</samp> field.
  −
|-
  −
| <samp>Condition</samp>
  −
| ''(Optional)'' A [[#Game state queries|game state query]] which indicates whether this area should be available. Defaults to always true.
   
|-
 
|-
 
| <samp>Position</samp>
 
| <samp>Position</samp>
 
| ''(Optional)'' The tile area within the location where the fishing rod's bobber must land to be within this area, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. Default null (anywhere).
 
| ''(Optional)'' The tile area within the location where the fishing rod's bobber must land to be within this area, specified as an object with <samp>X</samp>, <samp>Y</samp>, <samp>Width</samp>, and <samp>Height</samp> fields. Default null (anywhere).
 +
 +
Areas with a <samp>Position</samp> value have priority over those without.
 
|}
 
|}
 
|-
 
|-
Line 1,695: Line 1,685:  
| ''(Optional)'' The minimum distance from the nearest shore (measured in tiles) at which the fish can be caught, where zero is water directly adjacent to shore.
 
| ''(Optional)'' The minimum distance from the nearest shore (measured in tiles) at which the fish can be caught, where zero is water directly adjacent to shore.
 
|-
 
|-
| <samp>Priority</samp>
+
| <samp>MaxDistanceFromShore</samp>
| ''(Optional)'' This fish's precedence when checking for a fish to spawn, where lower values are checked first. Fish with the same priority level are shuffled randomly. Default 0.
+
| ''(Optional)'' The maximum distance from the nearest shore (measured in tiles) at which the fish can be caught, where zero is water directly adjacent to shore. Default -1 (no limit).
 +
|-
 +
| <samp>Precedence</samp>
 +
| ''(Optional)'' The order in which this fish should be checked, where fish with lower values are checked first. This can be a negative value. Fish with the same precedence are shuffled randomly. Default 0.
 
|-
 
|-
 
| <samp>CheckFishRequirements</samp>
 
| <samp>CheckFishRequirements</samp>
Line 1,703: Line 1,696:  
| <samp>SetFlagOnCatch</samp>
 
| <samp>SetFlagOnCatch</samp>
 
| ''(Optional)'' The mail flag to set for the current player when this fish is successfully caught. Default none.
 
| ''(Optional)'' The mail flag to set for the current player when this fish is successfully caught. Default none.
 +
|-
 +
| <samp>ChanceModifiers</samp>
 +
| ''(Optional)'' [[#Quantity modifiers|Quantity modifiers]] applied to the <samp>Chance</samp> value. Default none.
 +
|-
 +
| <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>.
 
|}
 
|}
 
|-
 
|-
translators
8,447

edits