Changes

Jump to navigation Jump to search
→‎For Content Patcher packs: + custom farm types, custom languages, new Water property value
Line 113: Line 113:     
==For Content Patcher packs==
 
==For Content Patcher packs==
===Possible breaking changes===
   
Stardew Valley 1.5.5 has no known breaking changes for content packs. All content packs should work fine once the framework mod that loads them is updated.
 
Stardew Valley 1.5.5 has no known breaking changes for content packs. All content packs should work fine once the framework mod that loads them is updated.
 +
 +
===Custom farm types===
 +
You can now add custom farm types by editing the <tt>Data/AdditionalFarms</tt> asset. Each entry consists of an object with these fields:
 +
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! description
 +
|-
 +
| <tt>ID</tt>
 +
| A unique ID value. This must be '''globally''' unique across all mods, so you should prefix your mod ID (e.g. <tt>Example.PineapplesAnywhere/PineappleFarm</tt>). You should not avoid commas for compatibility with Content Patcher packs checking the <tt><nowiki>{{FarmType}}</nowiki></tt> token. This is not shown in-game.
 +
|-
 +
| <tt>TooltipStringPath</tt>
 +
| Where to get the translatable farm name and description. This must be a key in the form <tt>{{t|asset name}}:{{t|key}}</tt>; for example, <tt>Strings/UI:Farm_Description</tt> will get it from the <tt>Farm_Description</tt> entry in the <tt>Strings/UI</tt> file. The translated text must be in the form "<tt>{{t|name}}_{{t|description}}</tt>", like "Pineapple Farm_A farm shaped like a pineapple".
 +
|-
 +
| <tt>MapName</tt>
 +
| The map asset name relative to <tt>Maps</tt> folder. For example, <tt>Farm_Pineapple</tt> would load <tt>Maps/Farm_Pineapple</tt>.
 +
|-
 +
| <tt>IconTexture</tt>
 +
| ''(optional)'' The asset name for a 22x20 pixel icon texture, shown on the 'New Game' and co-op join screens.
 +
|-
 +
| <tt>WorldMapTexture</tt>
 +
| ''(optional)'' The asset name for a 131x61 pixel texture that's drawn over the farm area in the in-game world map.
 +
|-
 +
| <tt>ModData</tt>
 +
| ''(optional)'' A string→string dictionary of mod-specific metadata for the farm, which can be accessed in C# code via <tt>Game1.GetFarmTypeModData(key)</tt>.
 +
|}
 +
 +
For example, this Content Patcher pack would create a 'pineapple' farm:
 +
{{#tag:syntaxhighlight|
 +
{
 +
    "Format": "{{Content Patcher version}}",
 +
    "Changes": [
 +
        // add farm type
 +
        {
 +
            "Action": "EditData",
 +
            "Target": "Data/AdditionalFarms",
 +
            "Entries": {
 +
                "ID": "Pathoschild.PineappleFarm/PineappleFarm",
 +
                "TooltipStringPath": "Strings/UI:Pathoschild_PineappleFarm",
 +
                "MapName": "Pathoschild_PineappleFarm",
 +
                "IconTexture": "Mods/Pathoschild.PineappleFarm/Icon",
 +
                "WorldMapTexture": "Mods/Pathoschild.PineappleFarm/WorldMap"
 +
            }
 +
        },
 +
 +
        // add farm name + description
 +
        {
 +
            "Action": "EditData",
 +
            "Target": "Strings/UI",
 +
            "Entries": {
 +
                "Pathoschild_PineappleFarm": "Pineapple Farm_A farm shaped like a pineapple!" // tip: use <nowiki>{{i18n}}</nowiki> to translate it
 +
            }
 +
        },
 +
 +
        // load map
 +
        {
 +
            "Action": "Load",
 +
            "Target": "Maps/Pathoschild_PineappleFarm",
 +
            "FromFile": "assets/map.tmx"
 +
        },
 +
 +
        // load icon
 +
        {
 +
            "Action": "Load",
 +
            "Target": "Mods/Pathoschild.PineappleFarm/Icon, Mods/Pathoschild.PineappleFarm/WorldMap",
 +
            "FromFile": "assets/<nowiki>{{TargetWithoutPath}}</nowiki>.png"
 +
        }
 +
    ]
 +
}|lang=javascript}}
 +
 +
===Custom languages===
 +
You can now add custom languages by editing the <tt>Data/AdditionalLanguages</tt> asset. Each entry consists of an object with these fields:
 +
 +
{| class="wikitable"
 +
|-
 +
! field
 +
! description
 +
|-
 +
| <tt>ID</tt>
 +
| A unique ID value. This is not shown in-game.
 +
|-
 +
| <tt>LanguageCode</tt>
 +
| The language code for this localization. This should ideally be a [[wikipedia:List of ISO 639-1 codes|ISO 639-1 code]]. You should not avoid commas for compatibility with Content Patcher packs checking the <tt><nowiki>{{Language}}</nowiki></tt> token.
 +
|-
 +
| <tt>ButtonTexture</tt>
 +
| The asset name for a 174x78 pixel texture containing the button of the language for language selection menu. The top half of the sprite is the default state, while the bottom half is the hover state.
 +
|-
 +
| <tt>UseLatinFont</tt>
 +
| Whether the language uses the same Latin character font as English. If set to <tt>false</tt>, you must set the next field.
 +
|-
 +
| <tt>FontFile</tt>
 +
| ''(optional)'' The asset name for the font file to use (if <tt>UseLatinFont</tt> is <tt>false</tt>).
 +
|-
 +
| <tt>FontPixelZoom</tt>
 +
| ''(optional)'' A factor by while to multiply the font size.
 +
|-
 +
| <tt>FontApplyYOffset</tt>
 +
| ''(optional)'' A vertical pixel offset applied to the font to better align in-game, if needed.
 +
|-
 +
| <tt>SmallFontLineSpacing</tt>
 +
| ''(optional)'' The line spacing value used by <tt>smallFont</tt>. Defaults to 26.
 +
|-
 +
| <tt>TimeFormat</tt>
 +
| A string which describes the in-game time format, with tokens replaced by in-game values. For example, <code>[HOURS_12]:[MINUTES] [AM_PM]</code> would show <code>12:00 PM</code> at noon.
 +
 +
The valid tokens are:
 +
* <code>[HOURS_12]</code>: hours in 12-hour format, where midnight and noon are both "12".
 +
* <code>[HOURS_12_0]</code>: hours in 12-hour format, where midnight and noon are both "0".
 +
* <code>[HOURS_24]</code>: hours in 24-hour format, where midnight is "0" and noon is "12".
 +
* <code>[HOURS_24_00]</code>: hours in 24-hour format with zero-padding, where midnight is "00" and noon is "12".
 +
* <code>[MINUTES]</code>: minutes with zero-padding.
 +
* <code>[AM_PM]</code>: the localized text for "am" or "pm" (taken from <code>Strings\\StringsFromCSFiles:DayTimeMoneyBox.cs.10370</code> and <code>DayTimeMoneyBox.cs.10371</code> respectively). The game shows "pm" between noon and 11:59pm inclusively; it shows "am" otherwise.
 +
|-
 +
| <tt>ClockTimeFormat</tt>
 +
| A string which describes the in-game time format. Equivalent to <tt>TimeFormat</tt>, but used for the in-game clock.
 +
|-
 +
| <tt>ClockDateFormat</tt>
 +
| A string which describes the in-game date format as shown in the in-game clock, with tokens replaced by in-game values. For example, <code>[DAY_OF_WEEK]. [DAY_OF_MONTH]</code> would show <code>Mon. 1</code>.
 +
 +
The valid tokens are:
 +
* <code>[DAY_OF_WEEK]</code>: the abbreviated day of week as returned by <code>Game1.shortDayDisplayNameFromDayOfSeason</code> (like <tt>Mon</tt> for Monday).
 +
* <code>[DAY_OF_MONTH]</code>: the numerical day of the month.
 +
|}
 +
 +
For example, this Content Patcher pack would add Esperanto to the game:
 +
{{#tag:syntaxhighlight|
 +
{
 +
    "Format": "{{Content Patcher version}}",
 +
    "Changes": [
 +
        // define language
 +
        {
 +
            "Action": "EditData",
 +
            "Target": "Data/AdditionalLanguages",
 +
            "Entries": {
 +
                "ID": "Pathoschild.Esperanto",
 +
                "LanguageCode": "eo",
 +
                "ButtonTexture": "Mods/Pathoschild.Esperanto/Button",
 +
                "UseLatinFont": true,
 +
                "TimeFormat": "[HOURS_24_00]:[MINUTES]",
 +
                "ClockTimeFormat": "[HOURS_24_00]:[MINUTES]",
 +
                "ClockDateFormat": "[DAY_OF_WEEK] [DAY_OF_MONTH]"
 +
            }
 +
        },
 +
 +
        // load button texture
 +
        {
 +
            "Action": "Load",
 +
            "Target": "Mods/Pathoschild.Esperanto/Button",
 +
            "FromFile": "assets/button.png"
 +
        }
 +
    ]
 +
}|lang=javascript}}
 +
 +
Once the language is defined, you can add translations to the game by patching game assets like usual, and use the language code you specified above. For example:
 +
<syntaxhighlight lang="javascript">
 +
{
 +
    "Action": "EditData",
 +
    "Target": "Strings/StringsFromCSFiles",
 +
    "Entries": {
 +
        "Game1.cs.3043": "Lundo",
 +
        "Game1.cs.3044": "Mardo",
 +
        ...
 +
    },
 +
    "When": {
 +
        "Language": "eo"
 +
    }
 +
}
 +
</syntaxhighlight>
    
===Custom festival location names===
 
===Custom festival location names===
Line 137: Line 305:  
|}
 
|}
   −
===New map properties===
+
===Map property changes===
 
Stardew Valley 1.5.5 adds several map properties:
 
Stardew Valley 1.5.5 adds several map properties:
   Line 206: Line 374:  
| <tt>TouchAction Warp {{t|area}} {{t|x}} {{t|y}} {{o|string prerequisite}}</tt>
 
| <tt>TouchAction Warp {{t|area}} {{t|x}} {{t|y}} {{o|string prerequisite}}</tt>
 
| Adds a player-only warp on the tile to the specified location name and position. This is exactly equivalent to <tt>TouchAction MagicWarp</tt>, but without the magic sound/visual effect.
 
| Adds a player-only warp on the tile to the specified location name and position. This is exactly equivalent to <tt>TouchAction MagicWarp</tt>, but without the magic sound/visual effect.
 +
|}
 +
 +
It also changes one tile property:
 +
{| class="wikitable"
 +
|-
 +
! layer
 +
! property
 +
! effect
 +
|-
 +
| <tt>Back</tt>
 +
| <tt>Water</tt>
 +
| Setting the value to <tt>I</tt> (uppercase i) will make the tile behave like normal water, but won't render the water animation overlay for it.
 
|}
 
|}
  
translators
8,444

edits

Navigation menu