Changes

Updated the Feed map property, as it appears to be outdated
Line 2: Line 2:     
This page explains how to edit maps. This is an advanced guide for modders.
 
This page explains how to edit maps. This is an advanced guide for modders.
 +
 +
{{TOC|limit=3}}
    
==Intro==
 
==Intro==
Line 43: Line 45:     
[[File:Modding - creating an XNB mod - tile coordinates.png]]
 
[[File:Modding - creating an XNB mod - tile coordinates.png]]
 +
 +
You can use the {{Nexus mod|679|Debug Mode}} mod to see tile coordinates in-game.
    
===Map formats===
 
===Map formats===
Line 122: Line 126:  
==Map edits==
 
==Map edits==
 
===Editing maps===
 
===Editing maps===
Important note: when making custom maps, always start with a vanilla map and edit it. Don't try to create a new map in Tiled; the game needs certain tiles, map properties, etc to be present.
+
Important note: when making custom maps, always start with a vanilla map and edit it. Don't try to create a new map in Tiled; the game needs certain tiles, map properties, etc to be present. Also note that when making a map edit or adding a custom map, sizes bigger than 155 for height and 199 for width will break the layering.
    
# [[Modding:Editing XNB files|Unpack]] the game's <samp>Content/Maps</samp> folder and create a copy to edit your maps in.  Use this copy of the folder to edit any maps in before moving them to your mod release folder.
 
# [[Modding:Editing XNB files|Unpack]] the game's <samp>Content/Maps</samp> folder and create a copy to edit your maps in.  Use this copy of the folder to edit any maps in before moving them to your mod release folder.
Line 137: Line 141:  
Note that the map must be built in a certain pattern; look at the maps in the <samp>Content/Maps</samp> folder for examples. It's often easier to start from an existing map and modify it, instead of starting from scratch.
 
Note that the map must be built in a certain pattern; look at the maps in the <samp>Content/Maps</samp> folder for examples. It's often easier to start from an existing map and modify it, instead of starting from scratch.
   −
{{note box|'''Using Content Patcher to add custom locations is strongly recommended.'''<br />You can add new locations in C# yourself, but be aware of factors like object persistence and NPC pathfinding that are easy to get wrong. If you ''really'' want to do it yourself, use the [[Modding:Modder Guide/APIs/Events#Specialised.LoadStageChanged|specialized <samp>LoadStageChanged</samp> event]] to add the location to <samp>Game1.locations</samp> during the <samp>CreatedInitialLocations</samp> or <samp>SaveAddedLocations</samp> stage.}}
+
{{note box|'''Using Content Patcher to add custom locations is strongly recommended.'''<br />You can add new locations in C# yourself, but be aware of factors like object persistence and NPC pathfinding that are easy to get wrong. If you ''really'' want to do it yourself, use the [[Modding:Modder Guide/APIs/Events#Specialised.LoadStageChanged|specialized <samp>LoadStageChanged</samp> event]] to add the location to <samp>Game1.locations</samp> during the <samp>CreatedInitialLocations</samp> and <samp>SaveAddedLocations</samp> stage.}}
    
===Adding tilesets===
 
===Adding tilesets===
Line 184: Line 188:     
===Map properties===
 
===Map properties===
Each map can have multiple map properties, which define attributes and behaviour associated with the map like lighting, music, warp points, etc. Each property has a name (which defines the type of property), type (always 'string' in Stardew Valley), and value (which configures the property). See [[#Known properties|known properties]] below.
+
Each map can have multiple map properties, which define attributes and behaviour associated with the map like lighting, music, warp points, etc. Each property has a name (which defines the type of property), type (always 'string' in Stardew Valley), and value (which configures the property). See [[#Known_map_properties|known properties]] below.
    
In Tiled:
 
In Tiled:
Line 192: Line 196:  
===Tile properties===
 
===Tile properties===
 
Tile properties are set on individual map tiles. They can change game behaviour (like whether the player can cross them), or perform actions when the player steps on or clicks the tile. Each property has a name, type (always 'string' in Stardew Valley), and value. In Tiled these are represented by two types: ''object properties'' only apply to the selected tile, while ''tile properties'' apply to every instance of that tile. In general you'll always set ''object properties'', so we'll only cover those.
 
Tile properties are set on individual map tiles. They can change game behaviour (like whether the player can cross them), or perform actions when the player steps on or clicks the tile. Each property has a name, type (always 'string' in Stardew Valley), and value. In Tiled these are represented by two types: ''object properties'' only apply to the selected tile, while ''tile properties'' apply to every instance of that tile. In general you'll always set ''object properties'', so we'll only cover those.
 +
 +
Note that tile properties need to have a tile associated with them; if there is no tile, they'll simply not be applied.
    
To view tile properties:
 
To view tile properties:
Line 283: Line 289:  
|}
 
|}
   −
==Known properties==
+
==Known map properties==
===Map properties===
+
¹
Known map properties:¹
+
====Building construction====
 +
{| class="wikitable"
 +
|-
 +
! property
 +
! explanation
 +
|-
 +
| <samp>CanBuildHere T</samp><br />''(valid in any outdoor location)''
 +
| Whether to allow constructing buildings in this location. The game will adjust automatically to account for it (e.g. Robin will let you choose where to build).
 +
|-
 +
| <samp>BuildConditions {{t|query}}</samp><br />''(valid in any outdoor location)''
 +
| If <samp>CanBuildHere</samp> is set, an optional [[Modding:Game state queries|game state query]] which indicates whether building is allowed currently.
 +
|-
 +
| <samp>LooserBuildRestrictions T</samp><br />''(valid in any outdoor location)''
 +
| If set, tiles don't need to be marked <samp>Buildable T</samp> or <samp>Diggable T</samp> in their properties. Tiles can be blocked with <samp>Buildable F</samp> instead. The other restrictions still apply.
 +
|-
 +
| <samp>ValidBuildRect {{t|x}} {{t|y}} {{t|width}} {{t|height}}</samp><br />''(valid in any outdoor location)''
 +
| The tile area within the map where buildings may be placed. If omitted, buildings may be placed in any open space in the map.
 +
|}
 +
 
 +
====Crops====
 +
{| class="wikitable"
 +
|-
 +
! property
 +
! explanation
 +
|-
 +
| <samp>AllowGiantCrops T</samp>
 +
| If set with any non-blank value, [[Crops#Giant Crops|giant crops]] can grow in this location (if crops are also allowed per the [[Modding:Migrate to Stardew Valley 1.6#Custom crops|crop data]] or [[Modding:Migrate to Stardew Valley 1.6#Custom location contexts|<samp>PlantableLocations</samp> context field]]).
 +
|-
 +
| <samp>DirtDecayChance {{t|chance}}</samp>
 +
| The probability that each dirt tile will disappear overnight if it doesn't contain a crop, as a value between 0 (never) and 1 (always). Defaults to 0 (greenhouses), 0.1 (farms), and 1 (anywhere else).
 +
|}
 +
 
 +
===Plants, forage, & item spawning===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 297: Line 335:  
| Allows [[grass]] that's alive on the last day of fall to survive through to winter.
 
| Allows [[grass]] that's alive on the last day of fall to survive through to winter.
 
|-
 
|-
| <samp>AmbientLight {{t|byte r}} {{t|byte g}} {{t|byte b}}</samp><br />''(valid in indoor locations and locations that ignore outdoor lighting)''
+
| <samp>EnableGrassSpread T</samp>²<br />''(valid in any location)''
| Sets the [[wikipedia:RGB color model|RGB colour]] that is subtracted from white (255,255,255) in order to create the ambient light.<br />''Example: <samp>AmbientLight 95 95 95</samp> for a normal indoor daytime lighting.''
+
| Gives [[grass]] in the location a chance to spread each day.
 
|-
 
|-
| <samp>BackwoodsEntry [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
+
| <samp>Fall_Objects T</samp>²<br /><samp>Spring_Objects T</samp>²<br /><samp>Summer_Objects T</samp>²<br /><samp>Winter_Objects T</samp>²
| The position the player is warped to when entering the farm from the Backwoods.
+
| Whether to spawn seasonal objects on spawnable tiles based on the data in <samp>Data\Locations.xnb</samp>.<br />''Example: <samp>Fall_Objects</samp>.''
 
|-
 
|-
| <samp>BrookSounds [{{t|int x}} {{t|int y}} {{t|int type}}]</samp><br />''(valid in outdoor locations)''
+
| <samp>Feed {{t|int x}} {{t|int y}}</samp><br />''(valid in coops and barns)''
| Adds sound sources. The {{t|x}} {{t|y}} fields are the tile coordinates, and {{t|type}} is the ambient sound ID. The {{t|type}} of sound can be one of...
+
| <s>Sets the spawn location of the [[Hay Hopper]] in a coop or barn.<br />''Example: <samp>Feed 3 2</samp>.''</s><br />The Feed map property has been deprecated with 1.6. The FeedHopper is now being defined in Data/Buildings as a IndoorItems entry "(BC)99"
* <samp>0</samp> (babblingBrook);
  −
* <samp>1</samp> (cracklingFire);
  −
* <samp>2</samp> (engine);
  −
* <samp>3</samp> (cricket).
   
|-
 
|-
| <samp>BusStopEntry [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
+
| <samp>ForceAllowTreePlanting T</samp>²<br />''(valid in any location)''
| The position the player is warped to when entering the farm from the Bus Stop.
+
| Allows planting trees (both wild and fruit) in this location, even if it normally wouldn't be allowed.
 
|-
 
|-
| <samp>CanCaskHere T</samp>²<br />''(valid in any location)''
+
| <samp>ForceSpawnForageables T</samp>²<br />''(valid in indoor locations)''
| Allows casks to work in that location.
+
| Enables forage items spawning in that location.
 
|-
 
|-
| <samp>ClearEmptyDirtOnNewMonth T</samp>²<br />''(valid in any location)''
+
| <samp>skipWeedGrowth T</samp>²<br />''(valid in any location)''
| Destroy most tilled dirt that doesn't contain crops when a new year starts.
+
| Prevents weeds from spawning and spreading in this location.
 
|-
 
|-
| <samp>DayTiles [{{t|string layerName}} {{t|int x}} {{t|int y}} {{t|int tilesheetIndex}}]+</samp><br />''(valid in any location)''
+
| <samp>SpawnBeachFarmForage T</samp>²<br />''(valid in farm)''
| Sets tiles to appear between 6AM to 7PM. Anytime before 7pm, this finds the tile at position ({{t|x}}, {{t|y}}) on the map layer matching {{t|layerName}}, changes its tilesheet index to the specified {{t|tilesheetIndex}}, and adds a glow to simulate daylight. The glow will only be added if the location is indoors and the {{t|tilesheetIndex}} is 256, 288, 405, 469, or 1224. The parameters can be repeated to affect multiple tiles.<br />''Example: <samp>DayTiles Front 3 1 256 Front 3 2 288</samp>.''
+
| Randomly spawns beach forage and [[Supply Crate|supply crates]] on the farm (like the [[Farm Maps|vanilla beach farm]]). Forage and crates will only appear on tiles which have the <samp>BeachSpawn T</samp> property on the <samp>Back</samp> layer, are clear for placement, and don't have a tile on the <samp>AlwaysFront</samp> layer.
 
|-
 
|-
| <samp>Doors [{{t|int x}} {{t|int y}} {{t|string sheetID}} {{t|int tileID}}]+</samp><br />''(valid in indoor locations)''
+
| <samp>SpawnForestFarmForage T</samp>²<br />''(valid in farm)''
| Adds functionality to interior doors. Used with <samp>Action Door</samp> tile properties. The {{t|x}} {{t|y}} fields are the tile coordinates, {{t|sheetID}} is the name of the sheet containing the door sprite, and {{t|tileID}} is the tile index in the spritesheet.
+
| Randomly spawns forest forage on the farm (like the [[Farm Maps|vanilla forest farm]]). Forage will only spawn on tiles which have the <samp>Type Grass</samp> tile property, are clear for placement, and don't have a tile on the <samp>AlwaysFront</samp> layer.
 
|-
 
|-
| <samp>EntryLocation {{t|tile X}} {{t|tile Y}}</samp><br />''(valid in farmhouse)''
+
| <samp>SpawnGrassFromPathsOnNewYear T</samp>²<br />''(valid in any location)''
| Sets the tile on which the player appears when they warp into the farmhouse.
+
| Spawns grass on every tile with index 22 on the <samp>Paths</samp> layer when a new year starts. See also <samp>SpawnRandomGrassOnNewYear</samp>.
 
|-
 
|-
| <samp>EnableGrassSpread T</samp>²<br />''(valid in any location)''
+
| <samp>SpawnDebrisOnNewMonth T</samp><br /><samp>SpawnDebrisOnNewYear T</samp>²<br />''(valid in any location)''
| Gives [[grass]] in the location a chance to spread each day.
+
| Spawns weeds, stones, or twigs at random positions when a new month/year starts (subject to their usual spawn rules).
 
|-
 
|-
| <samp>Fall_Objects T</samp>²<br /><samp>Spring_Objects T</samp>²<br /><samp>Summer_Objects T</samp>²<br /><samp>Winter_Objects T</samp>²
+
| <samp>SpawnMountainFarmOreRect {{t|tile X}} {{t|tile Y}} {{t|tile width}} {{t|tile height}}</samp><br />''(valid in farm)''
| Whether to spawn seasonal objects on spawnable tiles based on the data in <samp>Data\Locations.xnb</samp>.<br />''Example: <samp>Fall_Objects</samp>.''
+
| The tile area on the farm map where ores should randomly spawn (like the [[Farm Maps|vanilla hilltop farm]]). Ores will only spawn on tiles which have the <samp>Type Dirt</samp> tile property and are clear for object placement.
 
|-
 
|-
| <samp>FarmCaveEntry [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
+
| <samp>SpawnRandomGrassOnNewYear T</samp>²<br />''(valid in any location)''
| The position the player is warped to when entering the farm from the farm cave.
+
| Spawns grass at random positions when a new year starts (subject to its usual spawn rules). See also <samp>SpawnGrassFromPathsOnNewYear</samp>.
 
|-
 
|-
| <samp>FarmFishLocationOverride {{t|location name}} {{t|chance}}</samp><br />''(valid in farm)''
+
| <samp>Stumps [{{t|int x}} {{t|int y}} {{t|unused}}]+</samp><br />''(valid in any location)''
| Adds an alternative location name when catching fish, where the {{t|chance}} is a decimal value between 0 (never happens) and 1 (always happens). For example, <samp>FarmFishLocationOverride Mountain 0.5</samp> adds a 50% chance of catching mountain fish instead of the normal fish for that location. The location name is case-sensitive, and matches those shown by the {{nexus mod|679|Debug Mode mod}}.
+
| Adds stumps to the Secret Woods map daily. The third field for each stump appears to be unused.<br />''Example: <samp>Stumps 24 6 3 29 7 3 26 10 3 46 6 3 34 26 3 41 26 3</samp>.''
 
|-
 
|-
| <samp>FarmHouseEntry [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
+
| <samp>Treasure {{t|type}} {{t|int id}}</samp><br />''(valid in any location)''
| Changes the position of the Farm House. Corresponds to the front door, or the position the player will be warped to when leaving the house.
+
| Adds buried treasure that the player can dig up. {{t|type}} can be any of the following: <br /><samp>Coins, Copper, Coal, Iron, Gold, Iridium, CaveCarrot, Arch, Object</samp>.<br /> If set to <samp>Arch</samp> or <samp>Object</samp>, {{t|id}} may be used to specify the ID of the item that is buried.
 
|-
 
|-
| <samp>FarmHouseFlooring {{t|flooring id}}</samp><br />''(valid in farm)''
+
| <samp>Trees [{{t|int x}} {{t|int y}} {{t|int type}}]+</samp><br />''(valid in any location)''
| Sets the initial farmhouse floor to the given ID when creating a new save. These are mapped to the 4x4 tile areas in the <samp>Maps/walls_and_floors</samp> tilesheet starting at tile index 336 (where index 0 is mapped to the top-left square).<br />This is only enabled if <samp>FarmHouseFurniture</samp> is set.
+
| Adds trees to the map. The {{t|x}} {{t|y}} fields are the tile coordinates, and {{t|type}} is the tree type (0: oak, 1: maple, 2: pine, 5: palm, 6: mushroom tree, 7: mahogany).<br />''Example: <samp>Trees 17 18 2 20 31 2</samp>.''
 +
|}
 +
 
 +
===Warps & map positions===
 +
{| class="wikitable"
 
|-
 
|-
| <samp>FarmHouseFurniture [{{t|furniture ID}} {{t|tile X}} {{t|tile Y}} {{t|rotations}}]+</samp><br />''(valid in farm)''
+
! property
| Spawns initial furniture in the farmhouse when creating a new save. If you add multiple furniture to the same tile, the first one will be placed on the ground and the last one will be placed on the first one.<br />This is also required to enable the <samp>FarmHouseWallpaper</samp>, <samp>FarmHouseFlooring</samp>, and <samp>FarmHouseStarterSeedsPosition</samp> properties. You can enable it without spawning any furniture with <samp>FarmHouseFurniture -1 0 0 0</samp>.
+
! explanation
 
|-
 
|-
| <samp>FarmHouseStarterSeedsPosition {{t|tile X}} {{t|tile Y}}</samp><br />''(valid in farm)''
+
| <samp>AllowWakeUpWithoutBed {{t|allow}}</samp>
| Sets the tile position in the farmhouse where the seed package is placed when creating a new save.<br />This is only enabled if <samp>FarmHouseFurniture</samp> is set.
+
| Whether the player can wake up in this location without a bed, similar to the island farmhouse. This is typically used with <samp>PassOutLocations</samp> in [[Modding:Migrate to Stardew Valley 1.6#Custom location contexts|<samp>Data/LocationContexts</samp>]].
 
|-
 
|-
| <samp>FarmHouseWallpaper {{t|wallpaper id}}</samp><br />''(valid in farm)''
+
| <samp>BackwoodsEntry [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
| Sets the initial farmhouse wallpaper to the given ID when creating a new save. These are mapped to the 1x4 tile areas in the <samp>Maps/walls_and_floors</samp> tilesheet starting from the top-left.<br />This is only enabled if <samp>FarmHouseFurniture</samp> is set.
+
| The position the player is warped to when entering the farm from the Backwoods.
 
|-
 
|-
| <samp>FarmOceanCrabPotOverride T</samp>²<br />''(valid in farm)''
+
| <samp>BusStopEntry [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
| Causes crab pots on the farm should catch ocean fish.
+
| The position the player is warped to when entering the farm from the Bus Stop.
 
|-
 
|-
| <samp>Feed {{t|int x}} {{t|int y}}</samp><br />''(valid in coops and barns)''
+
| <samp>DefaultWarpLocation {{t|x}} {{t|y}}</samp><br />''(valid in any location)''
| Sets the spawn location of the [[Hay Hopper]] in a coop or barn.<br />''Example: <samp>Feed 3 2</samp>.''
+
| The default arrival tile, used when a player or NPC is added to the location without a target tile (e.g. using [[Modding:Console commands|debug commands]] like <samp>debug warp</samp> or <samp>debug eventbyid</samp>).
 
|-
 
|-
| <samp>ForceAllowTreePlanting T</samp>²<br />''(valid in any location)''
+
| <samp>EntryLocation {{t|tile X}} {{t|tile Y}}</samp><br />''(valid in farmhouse)''
| Allows planting trees (both wild and fruit) in this location, even if it normally wouldn't be allowed.
+
| Sets the tile on which the player appears when they warp into the farmhouse.
 
|-
 
|-
| <samp>forceLoadPathLayerLights T</samp>²<br />''(valid in outdoor non-festival locations)''
+
| <samp>FarmCaveEntry [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
| Whether to load lights from the <samp>Paths</samp> layer on maps where they would not normally be.<br />''Example: <samp>forceLoadPathLayerLights true</samp>.''
+
| The position the player is warped to when entering the farm from the farm cave.
 
|-
 
|-
| <samp>ForceSpawnForageables T</samp>²<br />''(valid in indoor locations)''
+
| <samp>FarmHouseEntry [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
| Enables forage items spawning in that location.
+
| Changes the position of the Farm House. Corresponds to the front door, or the position the player will be warped to when leaving the house.
 
|-
 
|-
 
| <samp>ForestEntry [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
 
| <samp>ForestEntry [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
Line 374: Line 412:  
|-
 
|-
 
| <samp>GrandpaShrineLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
 
| <samp>GrandpaShrineLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
| The position of grandpa's shrine. Corresponds to the upper left corner.
+
| The position of grandpa's shrine. Corresponds to the upper left corner of note.
 
|-
 
|-
 
| <samp>GreenhouseLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
 
| <samp>GreenhouseLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
 
| The default position of the greenhouse. Corresponds to the upper left corner of the greenhouse's foundation.
 
| The default position of the greenhouse. Corresponds to the upper left corner of the greenhouse's foundation.
 
|-
 
|-
| <samp>IgnoreLightingTiles T</samp>²<br />''(valid in indoor locations)''
+
| <samp>KitchenStandingLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farmhouse)''
| Whether to ignore lights on the <samp>Front</samp> and <samp>Buildings</samp> layers.<br />''Example: <samp>IgnoreLightingTiles true</samp>.''
+
| The position the player's spouse will stand when using the kitchen.
 +
|-
 +
| <samp>MailboxLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
 +
| The position of the player's mailbox. Corresponds to the upper left corner.
 +
|-
 +
| <samp>NPCWarp [{{t|int fromX}} {{t|int fromY}} {{t|string toArea}} {{t|int toX}} {{t|int toY}}]+</samp><br />''(valid in any location)''
 +
| Equivalent to <samp>Warp</samp>, but only usable by npcs.
 +
|-
 +
| <samp>PetBowlLocation {{t|x}} {{t|y}}</samp><br />''(valid in the farm)''
 +
| The default position of the pet bowl
 +
|-
 +
| <samp>ShippingBinLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
 +
| The position of the default shipping bin. Corresponds to the upper left corner.
 +
|-
 +
| <samp>SpouseAreaLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
 +
| The position of the the 4x4 outdoor spouse area. Corresponds to the upper left corner.[[File:SpouseArea.png|upright=0.5|right|thumb]]
 +
|-
 +
| <samp>SpouseRoomPosition {{t|x}} {{t|y}}</samp><br />''(valid in farmhouse)''
 +
| The top-left position at which to place the [[Marriage#Spouse Rooms|spouse room]].
 +
|-
 +
| <samp>TravelingCartPosition {{t|x}} {{t|y}}</samp><br />''(valid in the forest)''
 +
| The top-left position at which to place the [[Traveling Cart]]. This is the top-left corner of the collision box, so the roof will extend two tiles above this tile.
 +
|-
 +
| <samp>Warp [{{t|int fromX}} {{t|int fromY}} {{t|string toArea}} {{t|int toX}} {{t|int toY}}]+</samp><br />''(valid in any location)''
 +
| Sets the tiles which warp the player to another map (''e.g.,'' doors). The {{t|fromX}} {{t|fromY}} fields are the tile coordinates that initiate the warp, and {{t|toArea}} {{t|toX}} {{t|toY}} are the name of the in-game location to warp to and the tile coordinates within it.<br />''Example: 6 20 Mountain 76 9.''
 +
|-
 +
| <samp>WarpTotemEntry[{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
 +
| The position the player is warped to when teleporting to the farm via Warp Totem or Return Scepter.
 +
|}
 +
 
 +
===Audio===
 +
{| class="wikitable"
 +
|-
 +
! property
 +
! explanation
 +
|-
 +
| <samp>BrookSounds [{{t|int x}} {{t|int y}} {{t|int type}}]</samp><br />''(valid in outdoor locations)''
 +
| Adds sound sources. The {{t|x}} {{t|y}} fields are the tile coordinates, and {{t|type}} is the ambient sound ID. The {{t|type}} of sound can be one of...
 +
* <samp>0</samp> (babblingBrook);
 +
* <samp>1</samp> (cracklingFire);
 +
* <samp>2</samp> (engine);
 +
* <samp>3</samp> (cricket).
 +
|-
 +
| <samp>Music {{t|string name}}</samp><br />''(valid in any location)''
 +
| Sets the music that plays when the player enters, where {{t|name}} is the cue name in the audio files.<br />''Example: <samp>Music MarlonsTheme</samp>.'' (Deprecated; use the music fields in [[Modding:Location data#Music|<samp>Data/Locations</samp>]] instead. This property is only applied if the location has no music in <samp>Data/Locations</samp>.)
 +
|-
 +
| <samp>Music {{t|int start}} {{t|int end}} {{t|string name}}</samp><br />''(valid in any location)''
 +
| Sets the music that plays when the player enters, where {{t|name}} is the cue name in the audio files, music will only play if the time is between {{t|int start}} (inclusive) and {{t|int end}} (exclusive).<br />''Example: <samp>Music 800 1200 MarlonsTheme</samp>.'' (Deprecated; use the music fields in [[Modding:Location data#Music|<samp>Data/Locations</samp>]] instead. This property is only applied if the location has no music in <samp>Data/Locations</samp>.)
 +
|}
 +
 
 +
===Lighting===
 +
{| class="wikitable"
 
|-
 
|-
| <samp>indoorWater T</samp>²<br />''(valid in indoor locations)''
+
! property
| Enables water logic (ie. fishing, etc.) in that location.
+
! explanation
 
|-
 
|-
| <samp>IsFarm T</samp>²<br />''(valid in any location)''
+
| <samp>AmbientLight {{t|byte r}} {{t|byte g}} {{t|byte b}}</samp><br />''(valid in indoor locations and locations that ignore outdoor lighting)''
| Marks the location as a farm. This only affects generic location/interaction logic which checks the in-code <code>location.IsFarm</code> property; logic hardcoded into the game's <code>Farm</code> class (''e.g.,'' farm animals, pets, crows/scarecrows, greenhouse, farm buildings, etc) is still limited to the actual farm.
+
| Sets the [[wikipedia:RGB color model|RGB colour]] that is subtracted from white (255,255,255) in order to create the ambient light.<br />''Example: <samp>AmbientLight 95 95 95</samp> for a normal indoor daytime lighting.''
 
|-
 
|-
| <samp>IsGreenhouse T</samp>²<br />''(valid in any location)''
+
| <samp>forceLoadPathLayerLights T</samp>²<br />''(valid in outdoor non-festival locations)''
| Marks the location as a greenhouse.
+
| Whether to load lights from the <samp>Paths</samp> layer on maps where they would not normally be.<br />''Example: <samp>forceLoadPathLayerLights true</samp>.''
 
|-
 
|-
| <samp>KitchenStandingLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farmhouse)''
+
| <samp>IgnoreLightingTiles T</samp>²<br />''(valid in indoor locations)''
| The position the player's spouse will stand when using the kitchen.
+
| Whether to ignore lights on the <samp>Front</samp> and <samp>Buildings</samp> layers.<br />''Example: <samp>IgnoreLightingTiles true</samp>.''
 
|-
 
|-
 
| <samp>Light [{{t|int x}} {{t|int y}} {{t|int type}}]+</samp><br />''(valid in any location)''
 
| <samp>Light [{{t|int x}} {{t|int y}} {{t|int type}}]+</samp><br />''(valid in any location)''
Line 405: Line 494:  
Any other value will crash the game.<br />''Example: <samp>Light 3 8 4 6 8 4 11 8 4 3 2 5 10 2 5 6 19 5 5 15 5 5 11 5 11 12 5</samp> (Adventurer's Guild).''
 
Any other value will crash the game.<br />''Example: <samp>Light 3 8 4 6 8 4 11 8 4 3 2 5 10 2 5 6 19 5 5 15 5 5 11 5 11 12 5</samp> (Adventurer's Guild).''
 
|-
 
|-
| <samp>LocationContext Default</samp><br />''(valid in any location)''
+
| <samp>WindowLight [{{t|int x}} {{t|int y}} {{t|int type}}]+</samp><br />''(valid in any location)''
| Sets the map to be part of the mainland for game logic purposes, like weather.
+
| Adds light sources that are only lit during the day when it is not raining (like the light coming through a window). See <samp>Light</samp> for details.
 +
|}
 +
 
 +
===Map & tile changes===
 +
{| class="wikitable"
 +
|-
 +
! property
 +
! explanation
 +
|-
 +
| <samp>ClearEmptyDirtOnNewMonth T</samp>²<br />''(valid in any location)''
 +
| Destroy most tilled dirt that doesn't contain crops when a new year starts.
 +
|-
 +
| <samp>DayTiles [{{t|string layerName}} {{t|int x}} {{t|int y}} {{t|int tilesheetIndex}}]+</samp><br />''(valid in any location)''
 +
| Sets tiles to appear between 6AM to 7PM. Anytime before 7pm, this finds the tile at position ({{t|x}}, {{t|y}}) on the map layer matching {{t|layerName}}, changes its tilesheet index to the specified {{t|tilesheetIndex}}, and adds a glow to simulate daylight. The glow will only be added if the location is indoors and the {{t|tilesheetIndex}} is 256, 288, 405, 469, or 1224. The parameters can be repeated to affect multiple tiles.<br />''Example: <samp>DayTiles Front 3 1 256 Front 3 2 288</samp>.''
 +
|-
 +
| <samp>NightTiles [{{t|string layerName}} {{t|int x}} {{t|int y}} {{t|int tilesheetIndex}}]+</samp><br />''(valid in any location)''
 +
| Changes the tile after 7pm. Outside, it works along <samp>DayTiles</samp>: set a <samp>DayTiles</samp> tile for the map to load between 6am to 7pm, then a <samp>NightTiles</samp> to load between 7pm to the end of the day. It is mostly used for lamps in the game. Note that night time starts at different times depending on season ([[Day Cycle#Darkness|Day Cycle]]).
 +
|-
 +
| <samp>Doors [{{t|int x}} {{t|int y}} {{t|string sheetID}} {{t|int tileID}}]+</samp><br />''(valid in indoor locations)''
 +
| Adds functionality to interior doors. Used with <samp>Action Door</samp> tile properties. The {{t|x}} {{t|y}} fields are the tile coordinates, {{t|sheetID}} is the name of the sheet containing the door sprite, and {{t|tileID}} is the tile index in the spritesheet.
 +
|}
 +
 
 +
===Fishing===
 +
{| class="wikitable"
 
|-
 
|-
| <samp>LocationContext Island</samp><br />''(valid in any location)''
+
! property
| Sets the map to be part of Ginger Island for game logic purposes, like weather.
+
! explanation
 
|-
 
|-
| <samp>MailboxLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
+
| <samp>FarmFishLocationOverride {{t|location name}} {{t|chance}}</samp><br />''(valid in farm)''
| The position of the player's mailbox. Corresponds to the upper left corner.
+
| Adds an alternative location name when catching fish, where the {{t|chance}} is a decimal value between 0 (never happens) and 1 (always happens). For example, <samp>FarmFishLocationOverride Mountain 0.5</samp> adds a 50% chance of catching mountain fish instead of the normal fish for that location. The location name is case-sensitive, and matches those shown by the {{nexus mod|679|Debug Mode mod}}.
 
|-
 
|-
| <samp>Music {{t|string name}}</samp><br />''(valid in any location)''
+
| <samp>FarmOceanCrabPotOverride T</samp>²<br />''(valid in farm)''
| Sets the music that plays when the player enters, where {{t|name}} is the cue name in the audio files.<br />''Example: <samp>Music MarlonsTheme</samp>.''
+
| Causes crab pots on the farm should catch ocean fish.
 +
|}
 +
 
 +
===Farmhouse interior===
 +
{| class="wikitable"
 
|-
 
|-
| <samp>Music {{t|int start}} {{t|int end}} {{t|string name}}</samp><br />''(valid in any location)''
+
! property
| Sets the music that plays when the player enters, where {{t|name}} is the cue name in the audio files, music will only play if the time is between {{t|int start}} (inclusive) and {{t|int end}} (exclusive).<br />''Example: <samp>Music 800 1200 MarlonsTheme</samp>.''
+
! explanation
 
|-
 
|-
| <samp>NightTiles [{{t|string layerName}} {{t|int x}} {{t|int y}} {{t|int tilesheetIndex}}]+</samp><br />''(valid in any location)''
+
| <samp>FarmHouseFlooring {{t|flooring id}}</samp><br />''(valid in farm)''
| Changes the tile after 7pm. Outside, it works along <samp>DayTiles</samp>: set a <samp>DayTiles</samp> tile for the map to load between 6am to 7pm, then a <samp>NightTiles</samp> to load between 7pm to the end of the day. It is mostly used for lamps in the game.
+
| Sets the initial farmhouse floor to the given ID when creating a new save. These are mapped to the 4x4 tile areas in the <samp>Maps/walls_and_floors</samp> tilesheet starting at tile index 336 (where index 0 is mapped to the top-left square).
 
|-
 
|-
| <samp>NPCWarp [{{t|int fromX}} {{t|int fromY}} {{t|string toArea}} {{t|int toX}} {{t|int toY}}]+</samp><br />''(valid in any location)''
+
| <samp>FarmHouseFurniture [{{t|furniture ID}} {{t|tile X}} {{t|tile Y}} {{t|rotations}}]+</samp><br />''(valid in farm)''
| Equivalent to <samp>Warp</samp>, but only usable by npcs.
+
| Spawns initial furniture in the farmhouse when creating a new save. If you add multiple furniture to the same tile, the first one will be placed on the ground and the last one will be placed on the first one.<br />
 
|-
 
|-
| <samp>Outdoors T</samp>²<br />''(valid in any location)''
+
| <samp>FarmHouseStarterGift [{{t|id}} {{o|count}}]+</samp>
| Sets whether the location is outdoors.<br />''Example: <samp>Outdoors true</samp>.''
+
| The items that should appear in the initial gift box placed in the farmhouse when the save is created. This consists of one or more pairs of item ID (which can be qualified or unqualified) and count. The count is optional on the last entry.
 +
 
 +
For example, this will add 10 pufferfish (object 128) and a blobfish mask (hat 56):
 +
<pre>FarmHouseStarterGift (O)128 10 (H)56 1</pre>
 +
 
 +
If omitted, the default items (usually a 15 parsnip seeds) are added instead.
 
|-
 
|-
| <samp>ProduceArea {{t|int x}} {{t|int y}} {{t|int width}} {{t|int height}}</samp><br />''(valid in coops and barns)''
+
| <samp>FarmHouseStarterSeedsPosition {{t|tile X}} {{t|tile Y}}</samp><br />''(valid in farm)''
| Sets the area where animals can spawn within a coop or barn.<br />''Example: <samp>ProduceArea 6 4 8 7</samp>.''
+
| Sets the tile position in the farmhouse where the seed package is placed when creating a new save.
 
|-
 
|-
| <samp>ScreenshotRegion {{t|int left}} {{t|int top}} {{t|int right}} {{t|int bottom}}</samp><br />''(valid in any location)''
+
| <samp>FarmHouseWallpaper {{t|wallpaper id}}</samp><br />''(valid in farm)''
| Constrains the portion of the map rendered when screenshots are taken.<br />''Example: <samp>ScreenshotRegion 0 27 69 61</samp>.''
+
| Sets the initial farmhouse wallpaper to the given ID when creating a new save. These are mapped to the 1x4 tile areas in the <samp>Maps/walls_and_floors</samp> tilesheet starting from the top-left.
 +
|}
 +
 
 +
===Other location metadata===
 +
{| class="wikitable"
 
|-
 
|-
| <samp>SeasonOverride [{{t|string season}}]</samp><br />''(valid in any location)''
+
! property
| Assumes a specific season for most game checks. (If a crop is in season, which tilesheet to use, etc.)
+
! explanation
 
|-
 
|-
| <samp>ShippingBinLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
+
| <samp>CanCaskHere T</samp>²<br />''(valid in any location)''
| The position of the default shipping bin. Corresponds to the upper left corner.
+
| Allows casks to work in that location.
 
|-
 
|-
| <samp>skipWeedGrowth T</samp>²<br />''(valid in any location)''
+
| <samp>indoorWater T</samp>²<br />''(valid in indoor locations)''
| Prevents weeds from spawning and spreading in this location.
+
| Enables water logic (ie. fishing, etc.) in that location.
 
|-
 
|-
| <samp>SpawnBeachFarmForage T</samp>²<br />''(valid in farm)''
+
| <samp>IsFarm T</samp>²<br />''(valid in any location)''
| Randomly spawns beach forage and [[Supply Crate|supply crates]] on the farm (like the [[Farm Maps|vanilla beach farm]]). Forage and crates will only appear on tiles which have the <samp>BeachSpawn T</samp> property on the <samp>Back</samp> layer, are clear for placement, and don't have a tile on the <samp>AlwaysFront</samp> layer.
+
| Marks the location as a farm. This only affects generic location/interaction logic which checks the in-code <code>location.IsFarm</code> property; logic hardcoded into the game's <code>Farm</code> class (''e.g.,'' farm animals, pets, crows/scarecrows, greenhouse, farm buildings, etc) is still limited to the actual farm.
 
|-
 
|-
| <samp>SpawnForestFarmForage T</samp>²<br />''(valid in farm)''
+
| <samp>IsGreenhouse T</samp>²<br />''(valid in any location)''
| Randomly spawns forest forage on the farm (like the [[Farm Maps|vanilla forest farm]]). Forage will only spawn on tiles which have the <samp>Type Grass</samp> tile property, are clear for placement, and don't have a tile on the <samp>AlwaysFront</samp> layer.
+
| Marks the location as a greenhouse.
 
|-
 
|-
| <samp>SpawnGrassFromPathsOnNewYear T</samp>²<br />''(valid in any location)''
+
| <samp>LocationContext Default</samp><br />''(valid in any location)''
| Spawns grass on every tile with index 22 on the <samp>Paths</samp> layer when a new year starts. See also <samp>SpawnRandomGrassOnNewYear</samp>.
+
| Sets the map to be part of the mainland for game logic purposes, like weather.
 
|-
 
|-
| <samp>SpawnDebrisOnNewMonth T</samp><br /><samp>SpawnDebrisOnNewYear T</samp>²<br />''(valid in any location)''
+
| <samp>LocationContext Island</samp><br />''(valid in any location)''
| Spawns weeds, stones, or twigs at random positions when a new month/year starts (subject to their usual spawn rules).
+
| Sets the map to be part of Ginger Island for game logic purposes, like weather.
 
|-
 
|-
| <samp>SpawnMountainFarmOreRect {{t|tile X}} {{t|tile Y}} {{t|tile width}} {{t|tile height}}</samp><br />''(valid in farm)''
+
| <samp>Outdoors T</samp>²<br />''(valid in any location)''
| The tile area on the farm map where ores should randomly spawn (like the [[Farm Maps|vanilla hilltop farm]]). Ores will only spawn on tiles which have the <samp>Type Dirt</samp> tile property and are clear for object placement.
+
| Sets whether the location is outdoors.<br />''Example: <samp>Outdoors true</samp>.''
 
|-
 
|-
| <samp>SpawnRandomGrassOnNewYear T</samp>²<br />''(valid in any location)''
+
| <samp>ProduceArea {{t|int x}} {{t|int y}} {{t|int width}} {{t|int height}}</samp><br />''(valid in coops and barns)''
| Spawns grass at random positions when a new year starts (subject to its usual spawn rules). See also <samp>SpawnGrassFromPathsOnNewYear</samp>.
+
| Sets the area where animals can spawn within a coop or barn.<br />''Example: <samp>ProduceArea 6 4 8 7</samp>.''
 
|-
 
|-
| <samp>SpouseAreaLocation [{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
+
| <samp>ScreenshotRegion {{t|int left}} {{t|int top}} {{t|int right}} {{t|int bottom}}</samp><br />''(valid in any location)''
| The position of the the outdoor spouse area. Corresponds to the upper left corner.
+
| Constrains the portion of the map rendered when screenshots are taken.<br />''Example: <samp>ScreenshotRegion 0 27 69 61</samp>.''
 
|-
 
|-
| <samp>Stumps [{{t|int x}} {{t|int y}} {{t|unused}}]+</samp><br />''(valid in [[Secret Woods]])''
+
| <samp>SeasonOverride [{{t|string season}}]</samp><br />''(valid in any location)''
| Adds stumps to the Secret Woods map daily. The third field for each stump appears to be unused.<br />''Example: <samp>Stumps 24 6 3 29 7 3 26 10 3 46 6 3 34 26 3 41 26 3</samp>.''
+
| Assumes a specific season for most game checks. (If a crop is in season, which tilesheet to use, etc.)
 
|-
 
|-
 
| <samp>TreatAsOutdoors T</samp>²<br />''(valid in indoor locations)''
 
| <samp>TreatAsOutdoors T</samp>²<br />''(valid in indoor locations)''
 
| The location is treated as outdoors for the purposes of spawning anything other than lights from the <samp>Paths</samp> layer and yielding [[Coal]] from breaking rocks.<br />''Example: <samp>TreatAsOutdoors true</samp>.''
 
| The location is treated as outdoors for the purposes of spawning anything other than lights from the <samp>Paths</samp> layer and yielding [[Coal]] from breaking rocks.<br />''Example: <samp>TreatAsOutdoors true</samp>.''
|-
  −
| <samp>Trees [{{t|int x}} {{t|int y}} {{t|int type}}]+</samp><br />''(valid in any location)''
  −
| Adds trees to the map. The {{t|x}} {{t|y}} fields are the tile coordinates, and {{t|type}} is the tree type (1: oak, 2: maple, 3: pine, 6: palm, 7: mushroom tree).<br />''Example: <samp>Trees 17 18 2 20 31 2</samp>.''
   
|-
 
|-
 
| <samp>UniquePortrait [{{t|str name}}]+</samp><br />''(valid in any location)''
 
| <samp>UniquePortrait [{{t|str name}}]+</samp><br />''(valid in any location)''
| Switches the portraits for the named NPCs to the unique variants for the location. An NPC <samp>Jane</samp> in location <samp>Room</samp> will switch to portrait <samp>Portraits/Jane_Room</samp>.<br />''Example: <samp>UniquePortrait Maru</samp>.''
+
| Switches the portraits for the named NPCs to the unique variants for the location. An NPC <samp>Jane</samp> in location <samp>Room</samp> will switch to portrait <samp>Portraits/Jane_Room</samp>.<br />''Example: <samp>UniquePortrait Maru</samp>.'' (Deprecated; use [[Modding:Migrate to Stardew Valley 1.6#Custom NPC appearance|custom NPC appearances]] instead. These properties will override NPC appearances.)
 
|-
 
|-
 
| <samp>UniqueSprite [{{t|str name}}]+</samp><br />''(valid in any location)''
 
| <samp>UniqueSprite [{{t|str name}}]+</samp><br />''(valid in any location)''
| Switches the spritesheets for the named NPCs to the unique variants for the location. An NPC <samp>Jane</samp> in location <samp>Room</samp> will switch to spritesheet <samp>Characters/Jane_Room</samp>.<br />''Example: <samp>UniqueSprite Maru</samp>.''
+
| Switches the spritesheets for the named NPCs to the unique variants for the location. An NPC <samp>Jane</samp> in location <samp>Room</samp> will switch to spritesheet <samp>Characters/Jane_Room</samp>.<br />''Example: <samp>UniqueSprite Maru</samp>.'' (Deprecated; use [[Modding:Migrate to Stardew Valley 1.6#Custom NPC appearance|custom NPC appearances]] instead. These properties will override NPC appearances.)
 
|-
 
|-
 
| <samp>ViewportFollowPlayer T</samp>²<br />''(valid in any location)''
 
| <samp>ViewportFollowPlayer T</samp>²<br />''(valid in any location)''
 
| Forces the viewport to stay centered on the player.<br />''Example: <samp>ViewportFollowPlayer</samp>.''
 
| Forces the viewport to stay centered on the player.<br />''Example: <samp>ViewportFollowPlayer</samp>.''
|-
  −
| <samp>Warp [{{t|int fromX}} {{t|int fromY}} {{t|string toArea}} {{t|int toX}} {{t|int toY}}]+</samp><br />''(valid in any location)''
  −
| Sets the tiles which warp the player to another map (''e.g.,'' doors). The {{t|fromX}} {{t|fromY}} fields are the tile coordinates that initiate the warp, and {{t|toArea}} {{t|toX}} {{t|toY}} are the name of the in-game location to warp to and the tile coordinates within it.<br />''Example: 6 20 Mountain 76 9.''
  −
|-
  −
| <samp>WarpTotemEntry[{{t|int x}} {{t|int y}}]</samp><br />''(valid in farm)''
  −
| The position the player is warped to when teleporting to the farm via Warp Totem or Return Scepter.
  −
|-
  −
| <samp>WindowLight [{{t|int x}} {{t|int y}} {{t|int type}}]+</samp><br />''(valid in any location)''
  −
| Adds light sources that are only lit during the day when it is not raining (like the light coming through a window). See <samp>Light</samp> for details.
   
|}
 
|}
   −
The following properties are used but apparently have no effect: <samp>Arch</samp>, <samp>Debris</samp>, <samp>Spouse</samp>, and <samp>Fish</samp>.
     −
<small>¹ Map properties are primary handled in various methods of the <samp>GameLocation</samp> class, particularly <samp>resetLocalState</samp>.</small><br />
+
<small>¹ Map properties are primarily handled in various methods of the <samp>GameLocation</samp> class, particularly <samp>resetLocalState</samp>.</small><br />
 
<small>² The <samp>T</samp> value (short for ''true'') is conventional, but any non-empty value will work too.</small>
 
<small>² The <samp>T</samp> value (short for ''true'') is conventional, but any non-empty value will work too.</small>
   −
===Tile properties===
+
==Known tile properties==
Known tile properties (excluding specialised properties like <samp>TouchAction WomensLocker</samp>):¹
+
This excludes very specialised properties like <samp>TouchAction WomensLocker</samp>.¹
    +
===General===
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 546: Line 659:  
| <samp>NoSpawn All</samp><br /><samp>NoSpawn True</samp>
 
| <samp>NoSpawn All</samp><br /><samp>NoSpawn True</samp>
 
| Combines <samp>NoSpawn Grass</samp> and <samp>NoSpawn Tree</samp>.
 
| Combines <samp>NoSpawn Grass</samp> and <samp>NoSpawn Tree</samp>.
 +
|-
 +
| <samp>Back</samp>
 +
| <samp>NoSpawn False</samp>
 +
| Disables any previous <samp>NoSpawn</samp> property on the tile. For example, this can be used to enable spawning on a tile which has a <samp>NoSpawn</samp> tile index property.
 
|-
 
|-
 
| <samp>Back</samp>
 
| <samp>Back</samp>
Line 607: Line 724:  
| <samp>Order {{T|I}}</samp>
 
| <samp>Order {{T|I}}</samp>
 
| To place on index 29 and 30 of the Paths tilsheet. Set the order the cabins will spawn at the creation of a Multiplayer save.
 
| To place on index 29 and 30 of the Paths tilsheet. Set the order the cabins will spawn at the creation of a Multiplayer save.
 +
|-
 +
| <samp>Paths</samp>
 +
| <samp>SpawnTree {{t|type}} {{t|ID}} {{o|stage on spawn}} {{o|stage on regrow}}</samp>
 +
| Spawns a tree when the map is created, where:
 +
* {{t|type}} is <samp>wild</samp> (spawn a [[trees|wild tree]]) or <samp>fruit</samp> (spawn a [[Fruit Trees|fruit tree]]).
 +
* {{t|ID}} is the tree's key in <samp>Data/FruitTrees</samp> or <samp>Data/WildTrees</samp>.
 +
* {{o|stage on spawn}} is the preferred tree growth stage when first populating the save (if applicable).
 +
* {{o|stage on regrow}} is the preferred tree growth stage when regrowing trees on day update (if applicable).
 +
 +
The tile must have [[#Paths layer|<samp>Paths</samp> tile index]] 34.
 
|}
 
|}
    +
===TouchAction===
 
The <samp>TouchAction</samp> property makes something happen when the player steps on the tile:
 
The <samp>TouchAction</samp> property makes something happen when the player steps on the tile:
   Line 616: Line 744:  
! property
 
! property
 
! explanation
 
! explanation
|-
  −
| <samp>Back</samp>
  −
| <samp>TouchAction Bus</samp>
  −
| Starts the Bus Ride to the Desert mini-cutscene, works in conjunction with Action BusTicket.
   
|-
 
|-
 
| <samp>Back</samp>
 
| <samp>Back</samp>
Line 631: Line 755:  
| <samp>Back</samp>
 
| <samp>Back</samp>
 
| <samp>TouchAction DesertBus</samp>
 
| <samp>TouchAction DesertBus</samp>
| Lets you ride the bus back to the Bus Stop..
+
| Lets you ride the bus back to the Bus Stop.
 
|-
 
|-
 
| <samp>Back</samp>
 
| <samp>Back</samp>
Line 648: Line 772:  
| <samp>TouchAction MagicWarp {{t|string area}} {{t|int x}} {{t|int y}} {{o|string prerequisite}}</samp>
 
| <samp>TouchAction MagicWarp {{t|string area}} {{t|int x}} {{t|int y}} {{o|string prerequisite}}</samp>
 
| Warps the player to the {{t|x}} {{t|y}} tile coordinates in the given {{t|area}} with a magic sound and effects. If the {{o|prerequisite}} field is specified, only occurs if that flag is set via <samp>Game1.player.mailReceived</samp>.
 
| Warps the player to the {{t|x}} {{t|y}} tile coordinates in the given {{t|area}} with a magic sound and effects. If the {{o|prerequisite}} field is specified, only occurs if that flag is set via <samp>Game1.player.mailReceived</samp>.
 +
|-
 +
| <samp>Back</samp>
 +
| <samp>TouchAction PlayEvent {{t|event id}} {{o|check preconditions}} {{o|skip if seen}} {{o|fallback action}}</samp>
 +
| Equivalent to <samp>Action PlayEvent</samp>, but activated on touch. Note that {{o|fallback action}} is an <samp>Action</samp> tile property, ''not'' a <samp>TouchAction</samp> tile property.
 
|-
 
|-
 
| <samp>Back</samp>
 
| <samp>Back</samp>
Line 662: Line 790:  
|}
 
|}
    +
===Action===
 
The <samp>Action</samp> property makes something happen when the player interacts (''e.g.,'' clicks) with the tile:
 
The <samp>Action</samp> property makes something happen when the player interacts (''e.g.,'' clicks) with the tile:
   Line 693: Line 822:  
| <samp>Action Blacksmith</samp>
 
| <samp>Action Blacksmith</samp>
 
| Opens Clint's shop menu, if Clint is nearby.
 
| Opens Clint's shop menu, if Clint is nearby.
 +
|-
 +
| <samp>Buildings</samp>
 +
| <samp>Action Buy</samp>
 +
| In the SeedShop, opens Pierre's shop menu, if Pierre is nearby (or the box version if he's visiting Ginger Island). In Sandy's house, opens Sandy's shop menu, if Sandy is neaby. Does nothing in other locations.
 
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
Line 699: Line 832:  
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
| <samp>Action BusTicket</samp>
+
| <samp>Action BuildingSilo</samp>
| Offers to let you go to the Calico Desert if the Bus has been repaired. Works in conjunction with TouchAction Bus.
+
| If a building covers this tile, enables [[silo]] interactions on this tile subject to the building's <samp>HayCapacity</samp> field in <samp>Data/Buildings</samp>.
 +
|-
 +
| <samp>Buildings</samp>
 +
| <samp>Action BuildingToggleAnimalDoor</samp>
 +
| If a building covers this tile, opens or closes its animal door.
 
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
Line 710: Line 847:  
| Opens the snack shop in the theater. (Only from inside the theater.)
 
| Opens the snack shop in the theater. (Only from inside the theater.)
 
|-
 
|-
 +
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
 
| <samp>Action Carpenter</samp>
 
| <samp>Action Carpenter</samp>
Line 728: Line 866:  
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
 
| <samp>Action ClubSeller</samp>
 
| <samp>Action ClubSeller</samp>
| Shows a dialogue which lets the player buy a [[Statue of Endless Fortune]] for one million gold.
+
| Shows a dialogue which lets the player buy a [[Statue Of Endless Fortune]] for one million gold.
 
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
Line 749: Line 887:  
| <samp>Action Door {{t|npcName}} {{o|npcName}}</samp>
 
| <samp>Action Door {{t|npcName}} {{o|npcName}}</samp>
 
| Sets up an interior door that cannot be opened unless the player has two or more hearts of friendship with any of the named NPC(s). Placed on the lower of the two door tiles. See [[Modding:Dialogue|dialogue format]].<br />''Example: Action Door Abigail''
 
| Sets up an interior door that cannot be opened unless the player has two or more hearts of friendship with any of the named NPC(s). Placed on the lower of the two door tiles. See [[Modding:Dialogue|dialogue format]].<br />''Example: Action Door Abigail''
 +
|-
 +
| <samp>Buildings</samp>
 +
| <samp>Action DropBox {{t|ID}}</samp>
 +
| A location that allows the player to drop off items when a [[Modding:Special orders|special order]] with the given {{t|ID}} is active.
 
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
Line 773: Line 915:  
| <samp>Action EvilShrineRight</samp>
 
| <samp>Action EvilShrineRight</samp>
 
| Toggles monster spawning for your farm.
 
| Toggles monster spawning for your farm.
 +
|-
 +
| <samp>Buildings</samp>
 +
| <samp>Action Forge</samp>
 +
| Opens the [[Forge]] menu.
 
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
Line 799: Line 945:  
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
| <samp>Action kitchen</samp>
+
| <samp>Action kitchen</samp><br />''(valid in any location)''
| Shows the cooking menu, if you're in the Farmhouse.
+
| Shows the cooking menu.
 
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
Line 807: Line 953:  
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
| <samp>Action LockedDoorWarp [{{t|int toX}} {{t|int toY}} {{t|string toArea}} {{t|int openTime}} {{t|int closeTime}}]</samp>
+
| <samp>Action LockedDoorWarp [{{t|int toX}} {{t|int toY}} {{t|string toArea}} {{t|int openTime}} {{t|int closeTime}} {{t|NPC}} {{t|friendship}}]</samp>
| Creates an activation warp normally used on doors with a time window for when it can be used. Note that you must use 24-hour times, ''i.e.,'' 2000 for 8pm. <br />''Example: 6 29 SeedShop 900 2100''
+
| Creates an activation warp normally used on doors with a time window for when it can be used. Note that you must use 24-hour times, ''i.e.,'' 2000 for 8pm. The last two terms, if specified, add a friendship requirement on top of the time requirement. <br />''Example: 7 9 LeahHouse 1000 1800 Leah 500''
 
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
Line 821: Line 967:  
| <samp>Action Mailbox</samp>
 
| <samp>Action Mailbox</samp>
 
| Shows the next letter from the player's mailbox (if any).
 
| Shows the next letter from the player's mailbox (if any).
|-
  −
| <samp>Buildings</samp>
  −
| <samp>Action Material</samp>
  −
| Shows a summary of the player's stockpiled wood and stone.
   
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
Line 853: Line 995:  
| <samp>Action NextMineLevel</samp>
 
| <samp>Action NextMineLevel</samp>
 
| Warps the player to the next mine level (or level 1 if they're not in the mine).
 
| Warps the player to the next mine level (or level 1 if they're not in the mine).
 +
|-
 +
| <samp>Buildings</samp>
 +
| <samp>Action None</samp>
 +
| Does nothing. This is used to mark the tile interactive if the click will be handled separately.
 
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
Line 861: Line 1,007:  
| <samp>Action NPCMessage {{t|str name}} "{{t|str dialogueKey}}"</samp>
 
| <samp>Action NPCMessage {{t|str name}} "{{t|str dialogueKey}}"</samp>
 
| If the named NPC is within 14 tiles of the player, reads dialogue with the given key from the string files and displays a dialogue box. See [[Modding:Dialogue|dialogue format]].<br />''Example: Action NPCMessage Abigail "Strings\\StringsFromCSFiles:Event.cs.1022"''
 
| If the named NPC is within 14 tiles of the player, reads dialogue with the given key from the string files and displays a dialogue box. See [[Modding:Dialogue|dialogue format]].<br />''Example: Action NPCMessage Abigail "Strings\\StringsFromCSFiles:Event.cs.1022"''
 +
|-
 +
| <samp>Buildings</samp>
 +
| <samp>Action ObeliskWarp {{t|location name}} {{t|x}} {{t|y}} {{o|whether to dismount}}</samp>
 +
| Warps the player to the specified location name and position with the [[Warp Totem|Obelisk]] animation/sound effects.
 +
|-
 +
| <samp>Buildings</samp>
 +
| <samp>Action OpenShop {{t|shop id}} {{o|from direction}} {{o|open time}} {{o|close time}} {{o|owner tile area}}</samp>
 +
| Open the [[Modding:Shops|shop]] with the given {{t|shop id}}. All arguments besides the ID are optional:
 +
* {{o|from direction}}: if specified, the player must be standing in this direction relative to the shop (one of <samp>down</samp>, <samp>up</samp>, <samp>left</samp>, <samp>right</samp>, or <samp>none</samp>). Setting this to <samp>none</samp> disables the requirement. The default for most vanilla shops is <samp>down</samp>.
 +
* {{o|open time}} and {{o|close time}}: the start & end times in 26-hour format when the shop is available. Interacting with the tile outside those times does nothing.
 +
* {{o|owner tile area}}: if specified, the tile area which must contain one of the shop owners for the shop to be available. For a custom shop, these are defined by its <samp>Owners</samp> field. This can be specified in two forms: <samp>{{t|x}} {{t|y}}</samp> for a single tile, or <samp>{{t|x}} {{t|y}} {{t|width}} {{t|height}}</samp> for a multi-tile area.
 +
|-
 +
| <samp>Buildings</samp>
 +
| <samp>Action PlayEvent {{t|event id}} {{o|check preconditions}} {{o|skip if seen}} {{o|fallback action}}</samp>
 +
| Immediately start an [[Modding:Event data|event]], subject to the conditions:
 +
* {{o|check preconditions}}: whether to ignore the action if the [[Modding:Event data#Event preconditions|event's preconditions]] don't match (one of <samp>true</samp> or <samp>false</samp>). Default true.
 +
* {{o|skip if seen}}: whether to ignore the action if the player has already seen the given event. Default true.
 +
 +
If the event doesn't start for any reason (including the preceding conditions):
 +
* If {{o|fallback action}} is specified, it'll be run as an action. This can be any <samp>Action</samp> tile property (without the "Action " prefix), like <code>Action PlayEvent 60367 true true PlayEvent 520702 false false</code> to play a different event.
 +
* Otherwise the action is silently ignored.
 +
 +
For example, <code>Action PlayEvent 60367 false false</code> will replay the bus arrival event from the start of the game.
 
|-
 
|-
 
| <samp>Buildings</samp>
 
| <samp>Buildings</samp>
Line 929: Line 1,098:  
! restrictions
 
! restrictions
 
|-
 
|-
| 0–7
+
| 0–6
| Unused. NPCs automatically path to their schedule points, with routes influenced by tile type.
+
| Unused. NPCs automatically path to their schedule points, with routes influenced by tile type. These tiles depicted directional arrows before they were erased in update 1.6.
|  
+
|
 +
|-
 +
| 7
 +
| Used in the [[Modding:Migrate_to_Stardew_Valley_1.5.5#Custom_spouse_rooms|spouse room]], [[Modding:Migrate_to_Stardew_Valley_1.5.5#Custom_spouse_outside_areas|spouse patio]], and [[Movie Theater]] to mark where an NPC should stand. Can be given a "direction" property in TileData.
 +
| Used for spouse areas and the Movie Theater.
 
|-
 
|-
 
| 8
 
| 8
Line 938: Line 1,111:  
|-
 
|-
 
| 9–12
 
| 9–12
| Spawn a [[trees|tree]] when the location is created. Outside the farm, 50% chance to respawn each day. (See also 31–32.)<br />Available trees: oak (9), maple (10), pine (11), and palm 1 (12).
+
| Spawn a [[trees|tree]] when the location is created. Trees have a 50% chance to respawn each day outside the farm. (See also 31–32.)<br />Available trees: oak (9), maple (10), pine (11), and palm 1 (12).
 
| Outdoors only.
 
| Outdoors only.
 
|-
 
|-
Line 950: Line 1,123:  
|-
 
|-
 
| 20
 
| 20
| Spawn a [[boulder]] the farm is created, with the top-left corner on this tile..
+
| Spawn a [[boulder]] when the farm is created, with the top-left corner on this tile.
 
| Farm only.
 
| Farm only.
 
|-
 
|-
Line 982: Line 1,155:  
|-
 
|-
 
| 31–32
 
| 31–32
| Spawn a [[trees|tree]] when the location is created. Outside the farm, 50% chance to respawn each day. (See also 9–12.)<br />Available trees: palm 2 (31), mahogany (32).
+
| Spawn a [[trees|tree]] when the location is created. Trees have a 50% chance to respawn each day outside the farm. (See also 9–12.)<br />Available trees: palm 2 (31), mahogany (32).
 
| Outdoors only.
 
| Outdoors only.
 
|-
 
|-
 
| 33
 
| 33
 
| Spawn a [[Golden Walnut|golden walnut]] bush when the location is created.
 
| Spawn a [[Golden Walnut|golden walnut]] bush when the location is created.
 +
| Outdoors only.
 +
|-
 +
| 34
 +
| Enables the <samp>SpawnTree</samp> [[Modding:Maps#Known tile properties|tile property]] on this tile, which lets you spawn/regrow wild or fruit trees.
 +
| Outdoors only.
 +
|-
 +
| 35
 +
| Has no effect in-game. This is just a visual indicator you can use when editing maps (e.g. to keep track of where you set tile properties).
 +
|
 +
|-
 +
| 36
 +
| Spawn blue [[grass]] when the location is created, or randomly afterwards.
 
| Outdoors only.
 
| Outdoors only.
 
|}
 
|}
Line 1,118: Line 1,303:  
This page mainly covers editing maps with Tiled, but you can make the same changes programmatically using a [[Modding:Modder Guide/Get Started|C# SMAPI mod]]. There are two main approaches to changing a location in C# code.
 
This page mainly covers editing maps with Tiled, but you can make the same changes programmatically using a [[Modding:Modder Guide/Get Started|C# SMAPI mod]]. There are two main approaches to changing a location in C# code.
   −
===Using an asset editor===
+
===Using the <samp>AssetRequested</samp> event===
Most map edits should be applied using an [[Modding:Modder Guide/APIs/Content|asset editor]], so your changes aren't lost if another mod reloads the map. This works with the <samp>Map</samp> asset directly before it's used by the [[Modding:Modder Guide/Game Fundamentals#GameLocation et al|in-game location]], so you can't use location methods at this point.
+
Most map edits should be applied using [[Modding:Modder Guide/APIs/Content|the <samp>AssetRequested</samp> event]], so your changes aren't lost if another mod reloads the map. This works with the <samp>Map</samp> asset directly before it's used by the [[Modding:Modder Guide/Game Fundamentals#GameLocation et al|in-game location]]; that means you can't use location methods at this point, but you can make any changes you want before the map is read (e.g. change warps). See the [[Modding:Modder Guide/APIs/Events|events page]] for help using events.
   −
First you'll need to set up an asset editor, which mainly involves implementing <samp>IAssetEditor</samp> on your mod class. For example, this mod code edits the town map:
+
For example, this mod code edits the town map and adds an optional <samp>GetTile</samp> helper method:
    
<syntaxhighlight lang="C#">
 
<syntaxhighlight lang="C#">
 
/// <summary>The mod entry point.</summary>
 
/// <summary>The mod entry point.</summary>
internal class ModEntry : Mod, IAssetEditor
+
internal sealed class ModEntry : Mod
 
{
 
{
 
     /// <inheritdoc />
 
     /// <inheritdoc />
     public override void Entry(IModHelper helper) { }
+
     public override void Entry(IModHelper helper)
 
  −
    /// <inheritdoc />
  −
    public bool CanEdit<T>(IAssetInfo asset)
   
     {
 
     {
         return asset.AssetNameEquals("Maps/Town");
+
         helper.Events.Content.AssetRequested += this.OnAssetRequested;
 
     }
 
     }
   −
     /// <inheritdoc />
+
     /// <inheritdoc cref="IContentEvents.AssetRequested"/>
     public void Edit<T>(IAssetData asset)
+
     /// <param name="sender">The event sender.</param>
 +
    /// <param name="e">The event data.</param>
 +
    private void OnAssetRequested(object?/ sender, AssetRequestedEventArgs e)
 
     {
 
     {
         IAssetDataForMap editor = asset.AsMap();
+
         if (e.Name.IsEquivalentTo("Maps/Town"))
        Map map = editor.Data;
+
        {
 +
            e.Edit(asset =>
 +
            {
 +
                IAssetDataForMap editor = asset.AsMap();
 +
                Map map = editor.Data;
   −
        // your code here
+
                // your code here
 +
            });
 +
        }
 
     }
 
     }
   Line 1,280: Line 1,470:  
</ul>
 
</ul>
   −
==See also==
+
==Modder Help and Tricks==
 +
* Feel Free to visit the Stardew Valley Discord and ask for help if you need it in the #Making Mods Section.
 
* Discord user foggywizard#7430 [https://imgur.com/a/l1Ql16D annotated some screenshot guides for using Tiled]. These include an annotated overview, how to find where the coordinates are, and how to rename a tilesheet.
 
* Discord user foggywizard#7430 [https://imgur.com/a/l1Ql16D annotated some screenshot guides for using Tiled]. These include an annotated overview, how to find where the coordinates are, and how to rename a tilesheet.
 +
* [https://stardewmodding.wiki.gg/wiki/Tutorial:How_Draylon_curves_his_cliffs Tutorial]: How Discord user Draylon curves his cliffs
    
[[Category:Modding]]
 
[[Category:Modding]]
    
[[ru:Модификации:Карты]]
 
[[ru:Модификации:Карты]]
16

edits