update for 1.6 build 23325 (added support for migrating location names)
Line 405:
Line 405:
|-
|-
| <samp>CustomFields</samp>
| <samp>CustomFields</samp>
−
| The [[Modding:Migrate to Stardew Valley 1.6#Custom data fields|custom fields]] for this entry.
+
| ''(Optional)'' The [[Modding:Migrate to Stardew Valley 1.6#Custom data fields|custom fields]] for this entry.
+
|-
+
| <samp>FormerLocationNames</samp>
+
| ''(Optional)'' The former location names which may appear in save data. See ''[[#Can I rename a location?|Can I rename a location?]]'' in the FAQs for more info.
|}
|}
Line 423:
Line 426:
===Can I rename a location?===
===Can I rename a location?===
−
If you rename a location, any data for that location in players' existing saves will be permanently lost. Renaming locations is not recommended.
+
'''Renaming a location will permanently lose player changes made for the old name if you're not careful.'''
+
+
You can avoid that by setting the <samp>FormerLocationNames</samp> field in <samp>Data/Locations</samp>. If a location in save data has a name which (a) matches one of the <samp>FormerLocationNames</samp> and (b) doesn't match the name of a loaded location, its data will be loaded into the location which specified the <samp>FormerLocationNames</samp> field instead.
+
+
For example:
+
<syntaxhighlight lang="js">
+
"FormerLocationNames": [ "Custom_SomeOldName" ]
+
</syntaxhighlight>
+
+
Legacy names can have any format, but they must be '''globally''' unique. They can't match the <samp>Name</samp> or <samp>FormerLocationNames</samp> of any other location in <samp>Data/Locations</samp> (whether vanilla or custom).