Line 1: |
Line 1: |
| ← [[Modding:Index]] | | ← [[Modding:Index]] |
| | | |
| + | This page explains how to create and edit in-game locations. |
| + | |
| + | ==Terminology== |
| + | A few terms may be used interchangeably or have different meanings depending on the context. In the context of Stardew Valley: |
| + | |
| + | * A '''location''' is part of the game code and save data. It manages the in-game area and everything inside it (including non-map entities like players). The location is read/written to the save file, and is only loaded when loading the save file. |
| + | * A '''[[Modding:Maps|map]]''' is an asset which describes the tile layout, tilesheets, and map/tile properties for the in-game area. The map is reloaded each time you load a save, and each time a mod changes the map. |
| + | * A '''[[Modding:World map|world map]]''' is the image shown for a world region in the in-game menu. |
| + | |
| + | In other words, a ''location'' (part of the game code) references the ''map'' (loaded from the <samp>Content</samp> folder): |
| + | |
| + | <pre> |
| + | ┌─────────────────────────────────┐ |
| + | │ Location │ |
| + | │ - objects │ |
| + | │ - furniture │ |
| + | │ - crops │ |
| + | │ - bushes and trees │ |
| + | │ - NPCs and players │ |
| + | │ - etc │ |
| + | │ │ |
| + | │ ┌─────────────────────────┐ │ |
| + | │ │ Map asset │ │ |
| + | │ │ - tile layout │ │ |
| + | │ │ - map/tile properties │ │ |
| + | │ │ - tilesheets │ │ |
| + | │ └─────────────────────────┘ │ |
| + | └─────────────────────────────────┘ |
| + | </pre> |
| + | |
| + | ==Data format== |
| Data/Locations controls many things about locations. | | Data/Locations controls many things about locations. |
| | | |
Line 64: |
Line 95: |
| In order to have artifacts work, custom locations need to add their data to this file, which can be done with mods such as Content Patcher. | | In order to have artifacts work, custom locations need to add their data to this file, which can be done with mods such as Content Patcher. |
| | | |
− | ==GameLocation Names== | + | ==Location names== |
| + | In-game locations like the farm or beach are represented by the [[Modding:Modder Guide/Game Fundamentals#GameLocation et al|<samp>GameLocation</samp> class]] (or a subclass), and are identified by a unique name. |
| | | |
− | <samp>[[Modding:Modder_Guide/Game_Fundamentals#GameLocation_et_al|GameLocation]]</samp> objects represent an area that the player can move around in, such as the Farm, Beach, or Saloon. They all have names as strings. Some are represented by subclasses of <samp>GameLocation</samp>. The following table lists several <samp>GameLocation</samp> objects in vanilla Stardew Valley:
| + | Here are some of the vanilla locations: |
| | | |
| {| class="wikitable sortable" | | {| class="wikitable sortable" |
| |- | | |- |
− | ! style="position: sticky; top: 0;"|Name | + | ! style="position: sticky; top: 0;"| Name |
− | ! style="position: sticky; top: 0;"|Class | + | ! style="position: sticky; top: 0;"| Class |
− | ! style="position: sticky; top: 0;"|Description | + | ! style="position: sticky; top: 0;"| Description |
| |- | | |- |
| | <samp>Farm</samp> | | | <samp>Farm</samp> |