Изменения

Перейти к навигации Перейти к поиску
Новая страница: «← Индекс {{Переведите}} На этой странице объясняется, как редактиро...»
← [[Модификации:ИНдекс|Индекс]]
{{Переведите}}
На этой странице объясняется, как редактировать карты. Это расширенное руководство для моддеров.

==Вступление==
===Базовые компоненты===
<ul>
<li>A '''map''' is the layout of the terrain (like water, cliffs, and land), terrain features (like bushes), buildings, paths, and triggers for a particular area. When you reach the edge of an area or enter a building, and the screen fades to black during the transition, you're moving between maps.</li>

<li>Each map consists of several '''layers''' stacked one in front of the other. Objects in a layer closer to the front will hide objects in layers behind them. From back to front, the standard layers are...

{| class="wikitable"
|-
! Название слоя
! Типичное содержание
|-
| Back
| Terrain, water, and basic features (like permanent paths).
|-
| Buildings
| Placeholders for buildings (like the farmhouse). Any tiles placed on this layer will act like a wall unless the tile property has a "Passable" "T".
|-
| Paths
| Flooring, paths, grass, and debris (like stones, weeds, and stumps from the 'paths' tilesheet) which can be removed by the player.
|-
| Front
| Objects that are drawn on top of things behind them, like most trees. These objects will be drawn on top of the player if the player is North of them but behind the player if the player is south of them.
|-
| AlwaysFront
| Objects that are always drawn on top of other layers as well as the player. This is typically used for foreground effects like foliage cover.
|}</li>

[[File:MapLayers.png]]
<li>(Using Tiled) There are 2 different types of layers along with the 5 main layers, Objects Layer (cloud-like icon) and Tile Layer (grid icon). The Tile Layer is where you make map edits (placing and removing tiles) and the Objects Layers is where you add and edit tile data. Your layers must match the ones above. Note that depending on the map, they may be missing a Paths or AlwaysFront layer</li>

<li>Each layer consists of many '''tiles''', which are 16×16 pixel squares placed in a grid to form the visible map. Each tile can have properties (e.g. passable / blocked), special logic (e.g. an action to perform when the player steps on them), and a picture to show. The picture is represented by a sprite index (or tile index), which is its position in an associated spritesheet (see next).</li>

<li>Each map has one or more spritesheets (also known as tilesheets when talking about mods), which contains the available tiles and images that are put together to form the visible map.</li>
</ul>

===Tile coordinates===
Each tile has an (x, y) coordinate which represents its position on the map, where (0, 0) is the top-left tile. The ''x'' value increases towards the right, and ''y'' increases downwards. For example:

[[File:Modding - creating an XNB mod - tile coordinates.png]]

===Форматы карты===
There are two map formats used in Stardew Valley modding: <tt>.tmx</tt> (from the Tiled map editor) and <tt>.tbin</tt> (from the now-deprecated tIDE map editor). The features supported by both formats are almost identical, but there are a few differences:
{| class="wikitable"
|-
! feature
! <tt>.tmx</tt>
! <tt>.tbin</tt>
|-
| format
| ✓ XML (basically text)
| ✘ binary
|-
| edit in Tiled
| ✓ supported
| ✓ supported with plugin
|-
| edit directly
| ✓ can open in a text editor
| ✘ not supported
|-
| tile flip
| ✓ supported
| ✘ not supported
|-
| tile rotation
| ✓ supported
| ✘ not supported
|-
| source control
| ✓ efficient storage, can diff changes
| ✘ inefficient storage (need to copy entire file with each commit), can't diff changes
|}

<tt>.tmx</tt> is recommended per the above, but both formats are fine to use, and you can convert between them in Tiled by clicking ''File > Export As''.

==Getting started==
There are two main ways to edit a map.

===Using SMAPI===
Creating a SMAPI mod requires programming, but it's much more powerful and multiple SMAPI mods can edit the same map. If you want to use this approach:
# [[Modding:Modder Guide/Get Started|Create a SMAPI mod]].
# See instructions below for map changes.

Note that this doesn't preclude using Tiled too. You can create/edit maps in Tiled, then load/edit them in SMAPI.

===Using Tiled===
Tiled is a popular map editor that can be used to edit Stardew Valley maps, no programming needed. You need to [[Modding:Editing XNB files|unpack the map's XNB]], edit the map, and make a {{nexus mod|1915|Content Patcher}} or SMAPI mod to load your map. If you want to use this approach:

<ol>
<li>Install the [http://www.mapeditor.org/ latest version of Tiled].</li>
<li>Once installed, at the top left, go to Edit > Preferences > Plugins and enable the tbin plugin (<tt>tbin.dll</tt> on Windows, <tt>libtbin.so</tt> on Linux, or <tt>libtbin.dylib</tt> on Mac).
<li>Set the following settings:
{| class="wikitable"
|-
! setting
! value
! reason
|-
| ''View > Snapping > Snap to Grid''
| ✓ enabled
| This is required to convert objects back into the game's format.
|-
| ''View > Highlight Current Layer''
| ✓ enabled
| This makes it more clear which tile you're editing.
|}</li>
<li>See [[Modding:Editing XNB files]] for help unpacking & packing the map files.</li>
<li>See instructions below for map changes.</li>
</ol>

(If you use xnbcli to [[Modding:Editing XNB files#Unpack game files|unpack the original game maps]], you'll need the <tt>.tbin</tt> plugin even if you plan to use <tt>.tmx</tt> since xnbcli still produces <tt>.tbin</tt> files.)

==Map edits==
===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.

If you're using Tiled:
# [[Modding:Editing XNB files|Unpack]] the game's <tt>Content/Maps</tt> 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.
# Use the same method to unpack the map you want to edit if it is not a vanilla one, then place the map in your editing folder.
# Open the <tt>.tbin</tt> or <tt>.tmx</tt> file via Tiled. Note: make sure the file is in the same folder as the unpacked tilesheets!
# Make your changes.
# Save the file. Don't use <tt>Save as</tt>, as it can corrupt the map.
# Move the <tt>.tbin</tt> or <tt>.tmx</tt> file, and any custom tilesheets it needs, to your mod release folder. Place them in the <tt>assets</tt> folder.
# Load your map via SMAPI or Content Patcher (or another framework mod).

===Custom map===
You can add a new map and location to the game.

If you're using SMAPI:
:<syntaxhighlight lang="C#">
public override void Entry(IModHelper helper)
{
// the game clears locations when loading the save, so do it after the save loads
helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded;
}

private void OnSaveLoaded(object sender, SaveLoadedEventArgs args)
{
// get the internal asset key for the map file
string mapAssetKey = this.Helper.Content.GetActualAssetKey("assets/map.tmx", ContentSource.ModFolder);

// add the location
GameLocation location = new GameLocation(mapAssetKey, "YourLocationName") { IsOutdoors = false, IsFarm = false };
Game1.locations.Add(location);
}
</syntaxhighlight>

: '''Note:'''
:# Your map has to be built in a certain pattern; look at the maps in the <tt>Content/Maps</tt> directory for an example on how a map has to be built.
:# After loading your save file, you can use this command to jump to the map: <tt>debug warp YourLocationName X Y</tt>

If you're using Tiled:
: You can create the map in Tiled, but you need SMAPI to add it to the game.

===Custom tilesheet===
You can add custom sprites, tiles, or images to a map. Be sure to [[#Tilesheet order|prefix custom tilesheet IDs with <code>z_</code>]] to avoid shifting the vanilla tilesheet indexes.

If you're using SMAPI:
:<syntaxhighlight lang="c#">
public override void Entry(IModHelper helper)
{
helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded;
}

private void OnSaveLoaded(object sender, SaveLoadedEventArgs args)
{
// This gets the asset key for a tilesheet.png file from your mod's folder. You can also load a game tilesheet like
// this: helper.Content.GetActualAssetKey("spring_town", ContentSource.GameContent).
string tilesheetPath = this.Helper.Content.GetActualAssetKey("tilesheet.png", ContentSource.ModFolder);

// Get an instance of the in-game location you want to patch. For the farm, use Game1.getFarm() instead.
GameLocation location = Game1.getLocationFromName("Town");

// Add the tilesheet.
TileSheet tilesheet = new TileSheet(
id: "z_your-custom-spritesheet", // a unique ID for the tilesheet
map: location.map,
imageSource: tilesheetPath,
sheetSize: new xTile.Dimensions.Size(32, 64), // the tile size of your tilesheet image.
tileSize: new xTile.Dimensions.Size(16, 16) // should always be 16x16 for maps
);
location.map.AddTileSheet(tilesheet);
location.map.LoadTileSheets(Game1.mapDisplayDevice);
}
</syntaxhighlight>
: To change tiles using the new tilesheet, see [[#Tiles]] below.

If you're using Tiled:
:# Create your spritesheet and place it in the same folder as your <tt>.tbin</tt> or <tt>.tmx</tt> map file. This should be a PNG image with images divided into 16x16 tiles (see [[Modding:Editing XNB files#Intro]] for examples).
:# Open the map in Tiled.
:# Add the custom spritesheet:
:## In the ''Tilesets'' pane, click the [[File:Modding - creating an XNB mod - Tiled 'new tilesheet' button.png]] button.
:## Give it a descriptive name (like 'cute bugs') and choose the image source.
:## Make sure that ''Embed in map'' is checked.
:## Keep the defaults for the other settings and click ''OK''.
:# Add custom sprites to the map:
:## In the ''Layers'' pane, click the layer you want to edit.
:## In the ''Tilesets'' pane, click the tab for your custom spritesheet.
:## In the ''Tilesets'' pane, click one tile to select it. To choose multiple, click and drag the cursor.
:## Move the cursor to the map, and you'll see an overlay with the tiles you selected.
:## Click the map to place those tiles on the selected layer.

===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.

If you're using SMAPI:
: <syntaxhighlight lang="c#">
public override void Entry(IModHelper helper)
{
helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded;
}

private void OnSaveLoaded(object sender, SaveLoadedEventArgs args)
{
// get the 'Music' value
string currentMusic = Game1.currentLocation.map.Properties.TryGetValue("Music", out PropertyValue rawMusic)
? rawMusic.ToString()
: null;

// add or set the 'Music' value
Game1.currentLocation.map.Properties["Music"] = "MarlonsTheme";

// remove the 'Music' value
Game1.currentLocation.map.Properties.Remove("Music");
}
</syntaxhighlight>

If you're using Tiled:
:# Click ''Map'' on the toolbar and choose ''Map Properties''.
:# View and edit properties using the GUI.

===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.

If you're using SMAPI:
: <syntaxhighlight lang="C#">
public override void Entry(IModHelper helper)
{
helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded;
}

private void OnSaveLoaded(object sender, SaveLoadedEventArgs args)
{
// example location & tile coordinate
GameLocation location = Game1.currentLocation;
int tileX = 10;
int tileY = 20;

// get property
string value = location.doesTileHaveProperty(tileX, tileY, "Diggable", "Back");

// add or set property
location.setTileProperty(tileX, tileY, "Back", "Diggable", "T");

// remove tile property
Layer layer = location.map.GetLayer("Back");
Tile tile = layer.PickTile(new xTile.Dimensions.Location(tileX, tileY) * Game1.tileSize, Game1.viewport.Size);
tile.Properties.Remove("Diggable");
//tile.TileIndexProperties.Remove("Diggable"); // NOTE: removing a tile index property will affect all tiles of this type
}
</syntaxhighlight>

If you're using Tiled:
: 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.
:# Select the object layer in the ''Layers'' pane.
:# Choose the [[File:Modding - creating an XNB mod - Tiled 'select object' button.png]] ''select object'' tool in the toolbar.
:# Click the object whose properties you want to view. Objects are represented with a gray selection box on the map:<br />[[File:Modding - creating an XNB mod - map object.png]]
:# The object properties will be shown in the ''Properties'' pane.<br />[[File:Modding - creating an XNB mod - Tiled tile properties pane.png]]

: To edit properties for an existing object:
:* Change a value: click the value field and enter the new value.
:* Change a name: select the property and click the [[File:Modding - creating an XNB mod - Tiled 'edit' button.png]] icon.
:* Add a property: click the [[File:Modding - creating an XNB mod - Tiled 'add' button.png]] icon, enter the property name, make sure the selected type is "string", and click OK.

: To add a new object:
:# Select the object layer in the ''Layers'' pane.<br />''There should be one object layer for each tile layer. If the object layer is missing, create one with the same name as the right tile layer.''
:# Choose the [[File:Modding - creating an XNB mod - Tiled 'insert rectangle' button.png]] ''insert rectangle'' tool from the toolbar.
:# Click and drag the rectangle over the tile you want to edit . Make sure it snaps to the tile grid (see [[#Using Tiled]]), and only one tile is selected.
:# Rename it TileData in <tt>Name</tt>
:## See previous for how to edit its properties.

===Tiles===
You can edit the tiles for an existing map.

If you're using SMAPI:
:<syntaxhighlight lang="c#">
public override void Entry(IModHelper helper)
{
helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded;
}

private void OnSaveLoaded(object sender, SaveLoadedEventArgs args)
{
// example location & tile coordinate
GameLocation location = Game1.currentLocation;
int tileX = 10;
int tileY = 20;

// remove tile from layer
location.removeTile(tileX, tileY, "Back");

// add tile
Layer layer = location.map.GetLayer("Back");
TileSheet tilesheet = location.map.GetTileSheet("tilesheet name");
layer.Tiles[tileX, tileY] = new StaticTile(layer, tilesheet, BlendMode.Alpha, tileIndex: 100); // change tile index

// toggle water tile behaviour
location.waterTiles[tileX, tileY] = false; // true: water, false: not water
}
</syntaxhighlight>

If you're using Tiled:
: See [http://doc.mapeditor.org Tiled documentation].

===Tile animation===
[[File:Modding - creating an XNB mod - example animation.gif|right]]
You can animate tiles to create effects like Gil in his rocking chair (see example at right).

If you're using SMAPI:
:<syntaxhighlight lang="c#">
public override void Entry(IModHelper helper)
{
helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded;
}

private void OnSaveLoaded(object sender, SaveLoadedEventArgs args)
{
GameLocation location = Game1.currentLocation;

// add animated tile
Layer layer = location.map.GetLayer("Buildings");
TileSheet tilesheet = location.map.GetTilesheet("tilesheet name");
layer.Tiles[tileX, tileY] = new AnimatedTile(
layer,
new StaticTile[] {
new StaticTile(layer, tilesheet, BlendMode.Alpha, tileID),
new StaticTile(layer, tilesheet, BlendMode.Alpha, tileID),
new StaticTile(layer, tilesheet, BlendMode.Alpha, tileID),
new StaticTile(layer, tilesheet, BlendMode.Alpha, tileID)
},
250 // interval in milliseconds
);
}
</syntaxhighlight>

If you're using Tiled:
:# Click the edit button (wrench icon) for the tilesheet in the ''Tilesets'' pane.
:# Select the tile you want to animate in the new view.
:# Click ''Tileset > Tile Animation Editor'' in the toolbar to show that window.
:# In the new window, drag tiles from the tilesheet into the box on the left to create a ''frame'' (one image in the sequence). If you need to delete frames, select the frame(s) and press Backspace/Delete(Windows) or fn + Backspace(Apple)
:# Double-click the numbers to change how long each frame stays on the screen before the next one (in milliseconds). '''Make sure every frame has the same time; the game can't handle variable frame times.''' For example, here's the animation editor showing one of the tiles of Gil rocking:<br />[[File:Modding - creating an XNB mod - Tiled example animation pane.gif]]
:# When you're done, close the pane.
:# The animated tiles in the ''Tilesets'' pane will now have a little symbol in the bottom-right corner:<br />[[File:Modding - creating an XNB mod - Tiled example animation tileset.png]]<br />The animation is now part of that tile. Every instance of that tile on the map will now have the same animation.

===Tile flip/rotation===
[[File:Tiled tile rotation.png|thumb|An example tile rotated four ways, below the Tiled flip/rotate buttons.]]

You can rotate and flip tiles without needing to create rotated/flipped versions of the tilesheet. This needs SMAPI 3.4 or later to be installed; the base game doesn't recognize tile transforms.

If you're using SMAPI:
:<syntaxhighlight lang="c#">
public override void Entry(IModHelper helper)
{
helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded;
}

private void OnSaveLoaded(object sender, SaveLoadedEventArgs args)
{
// get a tile
GameLocation location = Game1.currentLocation;
Layer layer = location.map.GetLayer("Buildings");
Tile tile = layer.Tiles[tileX, tileY];

// rotate it 45°
tile.Properties["@Rotation"] = 45;

// flip it (0 = normal, 1 = horizontal, 2 = vertical)
tile.Properties["@Flip"] = 1;
}
</syntaxhighlight>

If you're using Tiled:
: '''Note: this only works when editing a <tt>.tmx</tt> file. Tile transforms aren't supported by the <tt>.tbin</tt> plugin.

:# With the stamp tool selected, click the tile in the tilesheet you want to use.
:# Click the flip or rotate buttons (see image at right).
:# Click the map to place the flipped/rotated tile.

==Known properties==
===Map properties===
Known map properties:¹
{| class="wikitable"
|-
! property
! explanation
|-
| <tt>AmbientLight {{t|byte r}} {{t|byte g}} {{t|byte b}}</tt><br />''(valid in indoor locations and locations that ignore outdoor lighting)''
| 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: <tt>AmbientLight 95 95 95</tt> for a normal indoor daytime lighting.''
|-
| <tt>BackwoodsEntry [{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| The position the player is warped to when entering the farm from the Backwoods.
|-
| <tt>BrookSounds [{{t|int x}} {{t|int y}} {{t|int type}}]</tt><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...
* <tt>0</tt> (babblingBrook);
* <tt>1</tt> (cracklingFire);
* <tt>2</tt> (engine);
* <tt>3</tt> (cricket).
|-
| <tt>BusStopEntry [{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| The position the player is warped to when entering the farm from the Bus Stop.
|-
| <tt>CanCaskHere T</tt>²<br />''(valid in any location)''
| Allows casks to work in that location.
|-
| <tt>DayTiles [{{t|string layerName}} {{t|int x}} {{t|int y}} {{t|int tilesheetIndex}}]+</tt><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: <tt>DayTiles Front 3 1 256 Front 3 2 288</tt>.''
|-
| <tt>Doors [{{t|int x}} {{t|int y}} {{t|string sheetID}} {{t|int tileID}}]+</tt><br />''(valid in indoor locations)''
| Adds functionality to interior doors. Used with <tt>Action Door</tt> 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.
|-
| <tt>Fall_Objects T</tt>²<br /><tt>Spring_Objects T</tt>²<br /><tt>Summer_Objects T</tt>²<br /><tt>Winter_Objects T</tt>²
| Whether to spawn seasonal objects on spawnable tiles based on the data in <tt>Data\Locations.xnb</tt>.<br />''Example: <tt>Fall_Objects</tt>.''
|-
| <tt>FarmCaveEntry [{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| The position the player is warped to when entering the farm from the farm cave.
|-
| <tt>FarmHouseEntry[{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| 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.
|-
| <tt>Feed {{t|int x}} {{t|int y}}</tt><br />''(valid in coops and barns)''
| Sets the spawn location of the [[Hay Hopper]] in a coop or barn.<br />''Example: <tt>Feed 3 2</tt>.''
|-
| <tt>forceLoadPathLayerLights T</tt>²<br />''(valid in outdoor non-festival locations)''
| Whether to load lights from the <tt>Paths</tt> layer on maps where they would not normally be.<br />''Example: <tt>forceLoadPathLayerLights true</tt>.''
|-
| <tt>ForceSpawnForageables T</tt>²<br />''(valid in indoor locations)''
| Enables forage items spawning in that location.
|-
| <tt>ForestEntry [{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| The position the player is warped to when entering the farm from the Cindersap Forest.
|-
| <tt>GrandpaShrineLocation [{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| The position of grandpa's shrine. Corresponds to the upper left corner.
|-
| <tt>GreenhouseLocation [{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| The default position of the greenhouse. Corresponds to the upper left corner of the greenhouse's foundation.
|-
| <tt>IgnoreLightingTiles T</tt>²<br />''(valid in indoor locations)''
| Whether to ignore lights on the <tt>Front</tt> and <tt>Buildings</tt> layers.<br />''Example: <tt>IgnoreLightingTiles true</tt>.''
|-
| <tt>indoorWater T</tt>²<br />''(valid in indoor locations)''
| Enables water logic (ie. fishing, etc.) in that location.
|-
| <tt>KitchenStandingLocation [{{t|int x}} {{t|int y}}]</tt><br />''(valid in farmhouse)''
| The position the player's spouse will stand when using the kitchen.
|-
| <tt>Light [{{t|int x}} {{t|int y}} {{t|int type}}]+</tt><br />''(valid in any location)''
| Adds light sources. The {{t|type}} field is the kind of light source (e.g. 4 for twin candles), and {{t|x}} {{t|y}} are the tile coordinates.The {{t|type}} of light source can be one of...
* <tt>1</tt> (lantern);
* <tt>2</tt> (window);
* <tt>4</tt> (sconce);
* <tt>5</tt> (cauldron);
* <tt>6</tt> (indoor window);
* <tt>7</tt> (projector).
Any other value will crash the game.<br />''Example: <tt>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</tt> (Adventurer's Guild).''
|-
| <tt>LocationContext Default</tt><br />''(valid in any location)''
| Sets the map to be part of the mainland for game logic purposes, like weather.
|-
| <tt>LocationContext Island</tt><br />''(valid in any location)''
| Sets the map to be part of Ginger Island for game logic purposes, like weather.
|-
| <tt>MailboxLocation [{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| The position of the player's mailbox. Corresponds to the upper left corner.
|-
| <tt>Music {{t|string name}}</tt><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: <tt>Music MarlonsTheme</tt>.''
|-
| <tt>Music {{t|int start}} {{t|int end}} {{t|string name}}</tt><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: <tt>Music 800 1200 MarlonsTheme</tt>.''
|-
| <tt>NightTiles [{{t|string layerName}} {{t|int x}} {{t|int y}} {{t|int tilesheetIndex}}]+</tt><br />''(valid in any location)''
| Changes the tile after 7pm. Outside, it works along <tt>DayTiles</tt>: set a <tt>DayTiles</tt> tile for the map to load between 6am to 7pm, then a <tt>NightTiles</tt> to load between 7pm to the end of the day. It is mostly used for lamps in the game.
|-
| <tt>NPCWarp [{{t|int fromX}} {{t|int fromY}} {{t|string toArea}} {{t|int toX}} {{t|int toY}}]+</tt><br />''(valid in any location)''
| Equivalent to <tt>Warp</tt>, but only usable by npcs.
|-
| <tt>Outdoors T</tt>²<br />''(valid in any location)''
| Sets whether the location is outdoors.<br />''Example: <tt>Outdoors true</tt>.''
|-
| <tt>ProduceArea {{t|int x}} {{t|int y}} {{t|int width}} {{t|int height}}</tt><br />''(valid in coops and barns)''
| Sets the area where animals can spawn within a coop or barn.<br />''Example: <tt>ProduceArea 6 4 8 7</tt>.''
|-
| <tt>ScreenshotRegion {{t|int left}} {{t|int top}} {{t|int right}} {{t|int bottom}}</tt><br />''(valid in any location)''
| Constrains the portion of the map rendered when screenshots are taken.<br />''Example: <tt>ScreenshotRegion 0 27 69 61</tt>.''
|-
| <tt>SeasonOverride [{{t|string season}}]</tt><br />''(valid in any location)''
| Assumes a specific season for most game checks. (If a crop is in season, which tilesheet to use, etc.)
|-
| <tt>ShippingBinLocation [{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| The position of the default shipping bin. Corresponds to the upper left corner.
|-
| <tt>skipWeedGrowth T</tt>²<br />''(valid in any location)''
| Prevents weeds from spawning and spreading in this location.
|-
| <tt>SpouseAreaLocation [{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| The position of the the outdoor spouse area. Corresponds to the upper left corner.
|-
| <tt>Stumps [{{t|int x}} {{t|int y}} {{t|unused}}]+</tt><br />''(valid in [[Secret Woods]])''
| Adds stumps to the Secret Woods map daily. The third field for each stump appears to be unused.<br />''Example: <tt>Stumps 24 6 3 29 7 3 26 10 3 46 6 3 34 26 3 41 26 3</tt>.''
|-
| <tt>TreatAsOutdoors T</tt>²<br />''(valid in indoor locations)''
| The location is treated as outdoors for the purposes of spawning anything other than lights from the <tt>Paths</tt> layer and yielding [[Coal]] from breaking rocks.<br />''Example: <tt>TreatAsOutdoors true</tt>.''
|-
| <tt>Trees [{{t|int x}} {{t|int y}} {{t|int type}}]+</tt><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: <tt>Trees 17 18 2 20 31 2</tt>.''
|-
| <tt>UniquePortrait [{{t|str name}}]+</tt><br />''(valid in any location)''
| Switches the portraits for the named NPCs to the unique variants for the location. An NPC <tt>Jane</tt> in location <tt>Room</tt> will switch to portrait <tt>Portraits/Jane_Room</tt>.<br/>''Example: <tt>UniquePortrait Maru</tt>.''
|-
| <tt>UniqueSprite [{{t|str name}}]+</tt><br />''(valid in any location)''
| Switches the spritesheets for the named NPCs to the unique variants for the location. An NPC <tt>Jane</tt> in location <tt>Room</tt> will switch to spritesheet <tt>Characters/Jane_Room</tt>.<br/>''Example: <tt>UniqueSprite Maru</tt>.''
|-
| <tt>ViewportFollowPlayer T</tt>²<br />''(valid in any location)''
| Forces the viewport to stay centered on the player.<br />''Example: <tt>ViewportFollowPlayer</tt>.''
|-
| <tt>Warp [{{t|int fromX}} {{t|int fromY}} {{t|string toArea}} {{t|int toX}} {{t|int toY}}]+</tt><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.''
|-
| <tt>WarpTotemEntry[{{t|int x}} {{t|int y}}]</tt><br />''(valid in farm)''
| The position the player is warped to when teleporting to the farm via Warp Totem or Return Scepter.
|-
| <tt>WindowLight [{{t|int x}} {{t|int y}} {{t|int type}}]+</tt><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 <tt>Light</tt> for details.
|}

The following properties are used but apparently have no effect: <tt>Arch</tt>, <tt>Debris</tt>, <tt>Spouse</tt>, and <tt>Fish</tt>.

<small>¹ Map properties are primary handled in various methods of the <tt>GameLocation</tt> class, particularly <tt>resetLocalState</tt>.</small><br />
<small>² The <tt>T</tt> value (short for ''true'') is conventional, but any non-empty value will work too.</small>

===Tile properties===
Known tile properties (excluding specialised properties like <tt>TouchAction WomensLocker</tt>):¹

{| class="wikitable"
|-
! layer
! property
! explanation
|-
| <tt>Back</tt>
| <tt>Bed T</tt>²
| If the player stands on this tile, they're considered in bed for the purposes of stamina regen (in multiplayer) and pass-out logic.
|-
| <tt>Back</tt>
| <tt>Buildable T</tt>²
| Allows farm buildings to be placed on this tile if there are no other obstructions.
|-
| <tt>Back</tt>
| <tt>Diggable T</tt>²
| Marks the tile as diggable with the hoe and enables planting crops. Also allows [[grass]] to spread to this tile.
|-
| <tt>Back</tt>
| <tt>NoFishing T</tt>²
| Prevents the player from casting the line onto this tile when fishing.
|-
| <tt>Back</tt>
| <tt>NoFurniture T</tt>²
| Prevents the player from placing furniture on this tile.
|-
| <tt>Back</tt>
| <tt>NoSpawn All</tt><br /><tt>NoSpawn True</tt>
| Combines <tt>NoSpawn Grass</tt> and <tt>NoSpawn Tree</tt>.
|-
| <tt>Back</tt>
| <tt>NoSpawn Grass</tt>
| Prevents debris (e.g. weeds or stones) from spawning on this tile.
|-
| <tt>Back</tt>
| <tt>NoSpawn Tree</tt>
| Prevents trees from spawning on this tile. Prevents the player from planting trees on this tile, except on the farm. If a tree is already on this tile, prevents it from growing.
|-
| <tt>Back</tt>
| <tt>NoSprinklers T</tt>²
| Prevents sprinklers from being placed on this tile.
|-
| <tt>Back</tt>
| <tt>NPCBarrier T</tt>²
| Prevents NPCs from crossing this tile.
|-
| <tt>Back</tt>
| <tt>Passable T</tt>²
| Lets players walk or place objects on this tile, even if they'd normally be blocked by a building tile or different property. Different from <tt>Buildings Passable T</tt> below.
|-
| <tt>Back</tt>
| <tt>Placeable T</tt>²
| '''Prevents''' players from placing objects on this tile.
|-
| <tt>Back</tt>
| <tt>Type {{t|str type}}</tt>
| Sets the tile type for various game logic (e.g. step sounds or planting crops), where {{t|type}} is one of ''Dirt'', ''Stone'', ''Grass'', or ''Wood''.
|-
| <tt>Back</tt>
| <tt>Water T</tt>²
| Marks the tile as a water tile for various game logic (i.e. items splash into it, can refill watering can from it, can possibly fish in it, can possibly place crab pots in it, will water nearby paddy crops, will block most open-tile checks, will regenerate health in it if indoors, and will draw animated overlay over it if outdoors; if in the Mines, Sewer, or Submarine; or otherwise not in the Desert).
|-
| <tt>Back</tt>
| <tt>WaterSource T</tt>²
| Lets the player refill the watering can from this tile.
|-
| <tt>Buildings</tt>
| <tt>Passable T</tt>²
| When placed on a water tile, the game no longer considers it open water (e.g. if it's a bridge). Different from <tt>Back Passable T</tt> above.
|-
| <tt>Paths</tt>
| <tt>Order {{T|I}}</tt>
| 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.
|}

The <tt>TouchAction</tt> property makes something happen when the player steps on the tile:

{| class="wikitable"
|-
! layer
! property
! explanation
|-
| <tt>Back</tt>
| <tt>TouchAction Bus</tt>
| Starts the Bus Ride to the Desert mini-cutscene, works in conjunction with Action BusTicket.
|-
| <tt>Back</tt>
| <tt>TouchAction ChangeIntoSwimsuit</tt>
| Changes the player into their swimsuit and disables running.
|-
| <tt>Back</tt>
| <tt>TouchAction ChangeOutOfSwimsuit</tt>
| Changes the player into their regular clothes and enables running.
|-
| <tt>Back</tt>
| <tt>TouchAction DesertBus</tt>
| Lets you ride the bus back to the Bus Stop..
|-
| <tt>Back</tt>
| <tt>TouchAction Emote {{t|string npc}} {{t|int emoteID}}</tt>
| Finds the NPC whose name matches the {{t|npc}} field, and causes them to show the given {{t|emoteID}} above their head (4: empty can, 8: question mark, 12: angry, 16: exclamation, 20: heart, 24: sleep, 28: sad, 32: happy, 36: x, 40: pause, 52: videogame, 56: music note, 60: blush).
|-
| <tt>Back</tt>
| <tt>TouchAction FacingDirection {{t|string npc}} {{t|int direction}}</tt>
| Finds the NPC whose name matches the {{t|npc}} field, and make them face the given direction (0: up, 1: right, 2: down, 3: left).
|-
| <tt>Back</tt>
| <tt>TouchAction legendarySword</tt>
| Gives them the [[Galaxy Sword]] when holding a [[Prismatic Shard]].
|-
| <tt>Back</tt>
| <tt>TouchAction MagicWarp {{t|string area}} {{t|int x}} {{t|int y}} {{o|string prerequisite}}</tt>
| 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 <tt>Game1.player.mailReceived</tt>.
|-
| <tt>Back</tt>
| <tt>TouchAction PoolEntrance</tt>
| Switches the player between swimming and walking mode.
|-
| <tt>Back</tt>
| <tt>TouchAction Sleep</tt>
| Ends the day if the player confirms.
|}

The <tt>Action</tt> property makes something happen when the player interacts (e.g. clicks) with the tile:

{| class="wikitable"
|-
! layer
! property
! explanation
|-
| <tt>Buildings</tt>
| <tt>Action AdventureShop</tt>
| Shows the Adventurer's Guild shop screen.
|-
| <tt>Buildings</tt>
| <tt>Action Arcade_Prairie</tt>
| Shows the ''Journey of the Prairie King'' arcade game.
|-
| <tt>Buildings</tt>
| <tt>Action Arcade_Minecart</tt>
| Shows the ''Junimo Kart'' arcade game.
|-
| <tt>Buildings</tt>
| <tt>Action BuyBackpack</tt>
| Shows a menu which lets the player upgrade their backpack if an upgrade is available.
|-
| <tt>Buildings</tt>
| <tt>Action Billboard</tt>
| Shows the calendar menu.
|-
| <tt>Buildings</tt>
| <tt>Action Blacksmith</tt>
| Opens Clint's shop menu.
|-
| <tt>Buildings</tt>
| <tt>Action BrokenBeachBridge</tt>
| Prompts you to use wood to repair the bridge.
|-
| <tt>Buildings</tt>
| <tt>Action BusTicket</tt>
| Offers to let you go to the Calico Desert if the Bus has been repaired. Works in conjunction with TouchAction Bus.
|-
| <tt>Buildings</tt>
| <tt>Action BuyQiCoins</tt>
| Shows a dialogue which lets the player buy 100 Casino club coins.
|-
| <tt>Buildings</tt>
| <tt>Action ColaMachine</tt>
| Offers to let the player buy a Joja cola.
|-
| <tt>Buildings</tt>
| <tt>Action ClubCards</tt><br /><tt>Action Blackjack</tt>
| Shows the casino blackjack minigame.
|-
| <tt>Buildings</tt>
| <tt>Action ClubComputer</tt><br /><tt>Action FarmerFile</tt>
| Shows a dialogue with play stats (steps taken, gifts given, dirt hoed, etc).
|-
| <tt>Buildings</tt>
| <tt>Action ClubSeller</tt>
| Shows a dialogue which lets the player buy a [[Statue of Endless Fortune]] for one million gold.
|-
| <tt>Buildings</tt>
| <tt>Action ClubShop</tt>
| Shows the casino shop menu.
|-
| <tt>Buildings</tt>
| <tt>Action ClubSlots</tt>
| Shows the casino slots minigame.
|-
| <tt>Buildings</tt>
| <tt>Action Dialogue {{t|text}}</tt>
| Shows a generic dialogue box with the given text. See [[Modding:Dialogue|dialogue format]].<br />''Example: Action Dialogue Hi there @!''
|-
| <tt>Buildings</tt>
| <tt>Action DivorceBook</tt>
| Shows divorce options for the player's current marriage status (as if they clicked the [[Marriage#Divorce|divorce book]]).
|-
| <tt>Buildings</tt>
| <tt>Action Door {{t|npcName}} {{o|npcName}}</tt>
| 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''
|-
| <tt>Buildings</tt>
| <tt>Action ElliotBook</tt>
| TODO: Explain what this does.
|-
| <tt>Buildings</tt>
| <tt>Action ElliotPiano</tt>
| TODO: Explain what this does.
|-
| <tt>Buildings</tt>
| <tt>Action EnterSewer</tt>
| Warps you to the sewer if you have obtained the key.
|-
| <tt>Buildings</tt>
| <tt>Action EvilShrineLeft</tt>
| Turns your kids into doves for a prismatic shard.
|-
| <tt>Buildings</tt>
| <tt>Action EvilShrineCenter</tt>
| Erases your ex-spouses memory of you.
|-
| <tt>Buildings</tt>
| <tt>Action EvilShrineRight</tt>
| Toggles monster spawning for your farm.
|-
| <tt>Buildings</tt>
| <tt>Action Garbage {{t|ID}}</tt>
| Has a chance to give a specific item to the player based on the {{t|ID}}. Can only be clicked once per day. TODO: Explain what each {{t|ID}} means.
|-
| <tt>Buildings</tt>
| <tt>Action Gunther</tt>
| Opens the museum menu where you can donate artifacts or claim rewards.
|-
| <tt>Buildings</tt>
| <tt>Action HMGTF</tt>
| Gives you "[[??HMTGF??]]" when you have a [[Super Cucumber]] in your hand.
|-
| <tt>Buildings</tt>
| <tt>Action IceCreamStand</tt>
| If Summer, shows the Ice Cream Stand shopping screen. Otherwise, the player will be told to come back in the summer.
|-
| <tt>Buildings</tt>
| <tt>Action JojaShop</tt>
| Shows the Joja shopping screen.
|-
| <tt>Buildings</tt>
| <tt>Action Jukebox</tt>
| Shows the jukebox menu to choose the ambient music.
|-
| <tt>Buildings</tt>
| <tt>Action kitchen</tt>
| Shows the cooking menu.
|-
| <tt>Buildings</tt>
| <tt>Action Letter {{t|string text}}</tt>
| Shows the letter menu on-screen with the given text, with the syntax used by <tt>Data\mail.xnb</tt>.<br />''Example: <tt>Action Letter Hey there!^I had some extra wood lying around... I thought maybe you could use it. Take care! ^ -Robin %item object 388 50 %%</tt>''
|-
| <tt>Buildings</tt>
| <tt>Action LockedDoorWarp [{{t|int toX}} {{t|int toY}} {{t|string toArea}} {{t|int openTime}} {{t|int closeTime}}]</tt>
| 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''
|-
| <tt>Buildings</tt>
| <tt>Action LuauSoup</tt>
| Used for the Luau Festival, this is where you insert a food item for the soup.
|-
| <tt>Buildings</tt>
| <tt>Action MagicInk</tt>
| Adds the Magic Ink to your wallet.
|-
| <tt>Buildings</tt>
| <tt>Action Mailbox</tt>
| Shows the next letter from the player's mailbox (if any).
|-
| <tt>Buildings</tt>
| <tt>Action Material</tt>
| Shows a summary of the player's stockpiled wood and stone.
|-
| <tt>Buildings</tt>
| <tt>Action Message {{t|string messageKey}}</tt>
| Loads a message with the given key from the ''Content\Strings\StringsFromMaps.xnb'' file and displays it in a dialogue box.
|-
| <tt>Buildings</tt>
| <tt>Action MessageOnce {{t|int eventID}} {{t|string message}}</tt>
| If the player hasn't seen the event with ID {{t|eventID}}, marks that event seen and displays the given message text in a dialogue box. This does ''not'' parse [[Modding:Dialogue|dialogue format]].
|-
| <tt>Buildings</tt>
| <tt>Action MessageSpeech {{t|string messageKey}}</tt>
| Identical to <tt>Action Message</tt>, but replaces the usual inspection cursor with a speech cursor.
|-
| <tt>Buildings</tt>
| <tt>Action MineSign {{t|string message}}</tt>
| Shows a mini-dialogue box with the given raw message text. This does ''not'' parse [[Modding:Dialogue|dialogue format]].
|-
| <tt>Buildings</tt>
| <tt>Action MinecartTransport</tt>
| Shows the minecart destination menu (or a message if not unlocked).
|-
| <tt>Buildings</tt>
| <tt>Action MineElevator</tt>
| Shows the mine elevator menu (to warp to a mine level) if the player has reached mine level 5+, else a mine elevator not working message.
|-
| <tt>Buildings</tt>
| <tt>Action NextMineLevel</tt>
| Warps the player to the next mine level (or level 1 if they're not in the mine).
|-
| <tt>Buildings</tt>
| <tt>Action Notes {{t|int noteID}}</tt>
| If the player has found the specified lost book, displays its museum note text and marks it read.<br />''Example: Action Notes 17''
|-
| <tt>Buildings</tt>
| <tt>Action NPCMessage {{t|str name}} "{{t|str dialogueKey}}"</tt>
| 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"''
|-
| <tt>Buildings</tt>
| <tt>Action playSound {{t|str cueName}}</tt>
| Play the sound or music with the given name.
|-
| <tt>Buildings</tt>
| <tt>Action QiCoins</tt>
| Shows a dialogue which lets the player buy 10 Casino club coins if they have none, else shows how many they have.
|-
| <tt>Buildings</tt>
| <tt>Action SandDragon</tt>
| Used for Part 3 of the Mysterious Mr. Qi Quest.
|-
| <tt>Buildings</tt>
| <tt>Action Shop</tt>
| On festival maps, opens the festival shop. No effect on non-festival maps.
|-
| <tt>Buildings</tt>
| <tt>Action TownMailbox {{t|ID}}</tt>
| TODO: Explain what this does.
|-
| <tt>Buildings</tt>
| <tt>Action Warp {{t|int x}} {{t|int y}} {{t|str area}}</tt>
| Warps the player to the {{t|x}} {{t|y}} tile coordinate in the {{t|area}} game location.<br />''Example: Action Warp 76 9 Mountain''
|-
| <tt>Buildings</tt>
| <tt>Action WarpCommunityCenter</tt>
| Warps the player to the inside of the Community Center if they have access (else show an "it's locked" message).
|-
| <tt>Buildings</tt>
| <tt>Action WarpGreenhouse</tt>
| Warps the player to the inside of their greenhouse if they've unlocked it, else shows a message about the greenhouse ruins.
|-
| <tt>Buildings</tt>
| <tt>Action WizardBook</tt>
| If unlocked, you buy buildings from the wizard here.
|-
| <tt>Buildings</tt>
| <tt>Action WizardHatch</tt>
| If you're good enough friends with the wizard you warp to his basement, if not you get told you can't go in.
|-
| <tt>Buildings</tt>
| <tt>Action WizardShrine</tt>
| Shows the character customisation menu normally available from the Wizard's tower.
|}

<small>¹ Tile properties are handled throughout the codebase using <tt>GameLocation::doesTileHaveProperty</tt>. Actions and touch actions are handled by <tt>GameLocation::performAction</tt> and <tt>GameLocation::performTouchAction</tt> respectively. Emote IDs are listed as <tt>Character</tt> constants.</small><br />
<small>² The <tt>T</tt> value (short for ''true'') is conventional, but any non-empty value will work too.</small>

==Paths layer==
The <tt>Paths</tt> layer has icon tiles from the <tt>paths</tt> tilesheet which affect game behavior on the map:

[[File:PathsExplanation.png|thumb|The tile indexes shown in the table.]]

{| class="wikitable"
|-
! tile index
! explanation
! restrictions
|-
| 0–7
| No effect? TODO: verify how the pathing logic uses it.
|
|-
| 8
| Add this tile to the [[#Map properties 2|<tt>Light</tt> map property]] with light type 4 (sconce).
| Indoors and festivals only.²
|-
| 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).
| Outdoors only.
|-
| 13–18
| Spawn debris when the location is created, or randomly each day. Outside the farm, respawn in spring.<br />Available debris: [[weeds|seasonal weed]] (13–15), rock (16–17), twig (18).
| Outdoors only.
|-
| 19
| Spawn a [[Large Log|large log]] when the farm is created, with the top-left corner on this tile.
| Farm only.
|-
| 20
| Spawn a [[boulder]] the farm is created, with the top-left corner on this tile..
| Farm only.
|-
| 21
| Spawn a [[Large Stump|hardwood stump]] when the farm is created (and every day on the forest farm), with the top-left corner on this tile.
| Farm only.
|-
| 22
| Spawn [[grass]] when the location is created, or randomly afterwards.
| Outdoors only.
|-
| 23
| Spawn a random oak, maple, or pine [[trees|tree]] at growth stage 2–3 when the location is created.
| Outdoors only.
|-
| 24–26
| Spawn a normal bush when the location is created. Medium bushes grow [[blackberry|blackberries]] and [[salmonberry|salmonberries]].<br />Available bushes: large (24), medium (25), small (26).
| Outdoors only.
|-
| 27
| When the location is created, add this tile to the [[#Map properties 2|<tt>BrookSounds</tt> map property]] with the <tt>babblingBrook</tt> sound.
| Outdoors only.
|-
| 28
| Spawn a [[grub]] here (33% chance per day, unless the map already has 50 grubs).
| [[Mutant Bug Lair]] only.
|-
| 29–30
| Place prebuilt [[cabin]]s in [[multiplayer]] based on the layout (29=nearby or 30=separate) and [[#Tile properties 2|<tt>Order</tt> tile property]], with the top-left corner on this tile.
| Farm only.
|-
| 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).
| Outdoors only.
|-
| 33
| Spawn a [[Golden Walnut|golden walnut]] bush when the location is created.
| Outdoors only.
|}

Notes:
# In the [[Mutant Bug Lair]], debris spawn rate is reduced to 33% chance per day.
# Restriction can be overridden with <tt>forceLoadPathLayerLights</tt> map property.

==Potential issues==
===Tilesheet order===
When you replace a vanilla map, '''don't''' change the order or IDs of the original tilesheets. Prefix new tilesheet IDs with <code>z_</code> to avoid changing the original order.

; Why this causes problems
: For example, let's say you replace a map which normally has these tilesheets in Tiled:
: [[File:Tiled tileset order A.png|thumb|none|The original tilesheet order.]]

: When you add a new tilesheet, note that the order changes from ''[paths, untitled tile sheet]'' to ''[customSheet, paths, untitled tile sheet]'':
: [[File:Tiled tileset order B.png|thumb|none|'''Wrong''' way to add a new tilesheet (changes the original order).]]

: If the game tries to access a tile from the first tilesheet, it will get it from <tt>customSheet</tt> instead of the expected <tt>Paths</tt> tilesheet. That can cause anything from visual glitches (e.g. showing the wrong tile images) to outright crashes (especially if the new tilesheet is smaller than the one it expected).

: To avoid that, always keep the original tilesheets in the same order and prefix new tilesheets with <code>z_</code> so they're added at the end:
: [[File:Tiled tileset order C.png|thumb|none|Correct way to add a new tilesheet.]]

; How to fix an affected tilesheet
: See ''[[#"mod reordered the original tilesheets"|"mod reordered the original tilesheets"]]'' below.

===Local copy of a vanilla tilesheet===
When editing a map in Tiled, you may need to copy vanilla tilesheets like <tt>path.png</tt> or <tt>spring_town.png</tt> into the map folder for Tiled to find. If the tilesheet is still there when you load the game, SMAPI will use it for your map instead of the game's vanilla tilesheet, which may have unintended effects (e.g. edits from recolor mods won't work in your map).

To avoid issues, you can either...
* Delete vanilla tilesheets from the folder before testing or releasing the mod.
* Rename the tilesheet file to start with a dot (like <tt>.spring_town.png</tt>) and reference that. When SMAPI loads the map in-game, it'll automatically ignore the dot and look for <tt>spring_town.png</tt> in the local files or <tt>Content/Maps</tt> folder.

===Map-specific issues===
The game makes some assumptions about maps which may break for modded maps. These are the known issues:
{| class="wikitable"
|-
! affected maps
! issue
|-
| <tt>Maps/Farm</tt><br /><tt>Maps/Farm_Combat</tt><br /><tt>Maps/Farm_Fishing</tt><br /><tt>Maps/Farm_Foraging</tt><br /><tt>Maps/Farm_Mining</tt>
| &#32;
* The farm's <tt>Paths</tt> layer must have at least one tile with index 22 (grass spawn). This is used to initialise the grass code when the save is loaded, even if no grass is spawned.<ref>The grass sound is set in <tt>Grass::loadSprite</tt>, which is called from <tt>GameLocation::loadObjects</tt> if the <tt>Paths</tt> layer has tile index 22. (The game spawns a grass for each such tile, and later removes them.)</ref>
|-
| <tt>Maps/FarmHouse*</tt>
| &#32;
* The two bed tiles where the player can walk must have two properties: <tt>Bed T</tt> (used to decide if the player is in bed) and <tt>TouchAction Sleep</tt>.
* Deleting or changing the wallpapers and floors will cause a game crash.
* The <tt>DayTiles</tt> and <tt>NightTiles</tt> map properties are cleared when loading the spouse room, so custom values for those properties won't work for married players.
|-
| <tt>Maps/SpouseRooms</tt>
| &#32;
* If you add or resize any tilesheet, you must also edit <tt>Maps/FarmHouse1_marriage</tt> and <tt>Maps/FarmHouse2_marriage</tt> to have the same changes (even if you don't make any other changes to the farmhouse). This is needed because the tilesheet references and sizes are stored as part of the map file.
|}
<small><references /></small>

==='Save as' in Tiled===
When you use 'save as' in Tiled, never save into a different folder. That will change all the tilesheet references to point to the old folder, so it'll no longer work in-game. Instead, copy/move the map files to a different folder if needed.

===Locating tilesheets in Tiled===
When a map tilesheet is missing, never use the locate option to use a tilesheet from a different folder. That will add a complex tilesheet path which won't work in-game. Instead copy the tilesheets into the same folder as the map, and reference them from there.

==Troubleshooting==
See also [[#Potential issues|''potential issues'']] above for common issues.

==="Tilesheet paths must be a relative path without directory climbing (../)"===
; What does this mean?
: Your map uses a tilesheet that's outside its folder root. That might happen if you [[#'Save as' in Tiled|used 'save as' in Tiled to save into a different folder]], copied & pasted tiles between maps in different folders, or manually added a tilesheet from a different folder.

: For example:
<pre style="margin-left: 2em;">
📁 Stardew Valley/
📁 Content/
📁 Maps/
🗎 townInterior <──┐
📁 Mods/ │
📁 YourModName/ │ ../../../Content/Maps/townInterior
📁 assets/ │
🗎 your-map.tmx ───┘
</pre>

: This isn't allowed since it's very fragile (e.g. players might install your mod in a different folder path).

; How do I fix it?
:# Copy the tilesheets you're using into the same folder as the map.
:# For unchanged vanilla tilesheets, rename them to start with a dot (like <tt>.townInterior.png</tt>). This tells SMAPI to ignore the file when loading the map in-game, and load the one in the <tt>Content</tt> folder instead.
:# In Tiled, click the edit icon under the tilesheet.
:# In the tab that opens, click ''Tileset > Tileset Properties''.
:# Click the 'Image' field, then the 'Edit' button to locate the tilesheet in the same folder.
For a screenshot guide of steps 3-5, [https://imgur.com/a/rukygAr see these images] provided by Discord user foggywizard#7430.

: After fixing it, the above example would look like this:
<pre style="margin-left: 2em;">
📁 Stardew Valley/
📁 Mods/
📁 YourModName/
📁 assets/
🗎 your-map.tmx ───┐
🗎 .townInterior.png <──┘ .townInterior.png
</pre>

==="mod reordered the original tilesheets"===
; What does this mean?
: See [[#Tilesheet order|''tilesheet order'']] for more info.

; How do I fix it?
: Always keep the original tilesheets in the same order and prefix new tilesheets with <code>z_</code> so they're added at the end:
: [[File:Tiled tileset order C.png|thumb|none|Correct way to add a new tilesheet.]]

: To rename an affected tilesheet in Tiled:
<gallery style="margin-left: 2em;">
File:Tiled rename tileset A.png|In the tileset pane, click the tab for the tileset and then click the edit icon.
File:Tiled rename tileset B.png|Click ''Tileset > Tileset Properties'' from the top menu to show the properties pane.
File:Tiled rename tileset C.png|Change the name in the ''Name'' field.
</gallery>

==="mod has no tilesheet with ID '<name>'"===
; What does this mean?
: You replaced one of the vanilla maps, but your custom map doesn't have all of the original map's tilesheets (or you changed their names in Tiled). This will cause a crash if the game tries to access the missing tilesheet.

; How do I fix it?
: Compare the original and custom maps in Tiled. For each tilesheet in the original map, make sure it's also in the custom map '''and''' has the same name (even if you're not using it).

: If you need to rename a tilesheet:
:# In the tileset pane, click the tab for the tileset and then click the edit icon.
:# Click ''Tileset > Tileset Properties'' from the top menu to show the properties pane.
:# Change the ''Name'' field to match the original map's tilesheet name.


===Смотри также===
* 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.

[[Category:Модификации]]
[[en:Modding:Maps]]
602

правки

Навигация