Difference between revisions of "Modding:Migrate to Stardew Valley 1.3"

From Stardew Valley Wiki
Jump to navigation Jump to search
(→‎XNB mods deprecated: rm unneeded bold)
(→‎Impact in 1.3: + image showing changes for TileSheets/Craftables)
Line 686: Line 686:
 
|-
 
|-
 
| <tt>TileSheets/Craftables</tt>
 
| <tt>TileSheets/Craftables</tt>
| new content + significant changes
+
| new content + significant changes<br /><small>([https://i.imgur.com/a2MRcqD.png replaced sprites in red, edited in orange])</small>
 
| '''✘ broken'''
 
| '''✘ broken'''
 
| '''✘ possibly broken'''
 
| '''✘ possibly broken'''

Revision as of 03:26, 18 March 2018

Axe.png
Article Stub

This article is a stub and is missing information. You can help Stardew Valley Wiki by expanding it!

This page is for modders. Players: see Modding:SMAPI compatibility instead.

This page explains the most common changes needed in mods for compatibility with Stardew Valley 1.3.

SMAPI mods

Mod build config package

Update to the latest Pathoschild.Stardew.ModBuildConfig 2.0.3-alpha package for compatibility with Stardew Valley 1.3.

Net types

Stardew Valley 1.3 uses a new set of C# types to synchronise data between players. For example, a crop's bool dead field is now NetBool dead. The game will intermittently get the value of all reachable net fields, and send them to the other players. A net type means a network-synchronised type (like NetBool), and a net field is a field with such a type (like Crop.dead).

Usage notes:

  • Many net fields have a standard property to access them. Use those when possible to simplify your code and avoid net field gotchas:
    Game1.player.name // NetString
    Game1.player.Name // string
    
  • You can implicitly cast net types to their standard equivalent:
    NetBool a = crop.dead;
    bool b = crop.dead;
    
    if (a == b) // true
    
  • You may need to access the value explicitly in some cases. Here's how:
    net type syntax
    NetDictionary netField.FieldDict
    most net types netField.Value
  • Do not reassign net fields. (Many are readonly to prevent that, but not all.) Instead, set the new value:
    // either of these will work
    crop.dead.Value = true;
    crop.dead.Set(true);
    
  • Net types can't handle implicit casting on null net fields. Always check for null before comparing or implicitly casting to a value type:
    NPC villager = null;
    
    // crash: 'System.NullReferenceException' in Netcode.dll
    if (villager?.name == "Abigail")
    
    // this is okay
    if (villager != null && villager.name == "Abigail")
    

Texture constructor arguments

Many constructors which previously accepted Texture2D texture arguments now take a string textureName argument instead. It's usually better to use SMAPI's content API to override textures, though you can change the cached texture after the object is constructed (requires reflection in some cases).

XNB mods and Content Patcher

XNB mods deprecated

XNB mods are no longer recommended. Consider using Content Patcher instead.

Impact in 1.3

Here are the XNB changes in Stardew Valley 1.3.

Notes:

  • I ignored changes to non-English files for simplicity.
  • New content files aren't listed, since they won't impact existing mods and to avoid spoiling some surprises.
  • XNB mods are disproportionately affected, since they replace the entire file. Content Patcher packs are typically unaffected unless they replace the entire file (in which case see the XNB mod column).
  • I don't know what changed in affected map files (if anything), only that the files are different.

Shorthand:

  • 'broken' means removing new content or potentially important changes, or potentially causing significant display bugs. This is a broad category — the game may work fine without it or crash, depending how it uses that specific content.
  • 'mostly unaffected' means mods will only be affected if they edit specific entries or fields.
  • Blank means zero expected impact.
content file changes XNB Content Patcher
Characters/Dialogue/Abigail new content ✘ broken
Characters/Dialogue/Alex new content ✘ broken
Characters/Dialogue/Abigail new content ✘ broken
Characters/Dialogue/Clint new content ✘ broken
Characters/Dialogue/Demetrius new content ✘ broken
Characters/Dialogue/Elliott new content ✘ broken
Characters/Dialogue/Emily new content ✘ broken
Characters/Dialogue/Evelyn new content ✘ broken
Characters/Dialogue/George new content ✘ broken
Characters/Dialogue/Gus new content ✘ broken
Characters/Dialogue/Haley new content ✘ broken
Characters/Dialogue/Harvey new content ✘ broken
Characters/Dialogue/Krobus small text change ✘ minor issues ✓ mostly unaffected
Characters/Dialogue/Leah new content ✘ broken
Characters/Dialogue/Lewis new content ✘ broken
Characters/Dialogue/Linus new content ✘ broken
Characters/Dialogue/`
`MarriageDialogueSebastian
small text change ✘ minor issues ✓ mostly unaffected
Characters/Dialogue/Maru new content ✘ broken
Characters/Dialogue/Pam new content ✘ broken
Characters/Dialogue/Penny new content ✘ broken
Characters/Dialogue/Pierre new content + small text change ✘ broken ✓ mostly unaffected
Characters/Dialogue/Robin new content ✘ broken
Characters/Dialogue/Sam new content ✘ broken
Characters/Dialogue/Sebastian new content ✘ broken
Characters/Dialogue/Shane new content ✘ broken
Characters/Farmer/hats new sprites at bottom ✘ broken ✘ impacts new-hat packs
Characters/Governor new sprites at bottom ✘ broken ✓ mostly unaffected
Characters/Pam new sprites at bottom ✘ broken ✓ mostly unaffected
Characters/Penny new sprites in empty slot ✘ broken ✓ mostly unaffected
Characters/schedules/Abigail new content ✘ broken
Characters/schedules/Alex new content ✘ broken
Characters/schedules/Caroline new content ✘ broken
Characters/schedules/Clint new content ✘ broken
Characters/schedules/Demetrius new content ✘ broken
Characters/schedules/Elliott new content ✘ broken
Characters/schedules/Emily new content ✘ broken
Characters/schedules/Evelyn new content ✘ broken
Characters/schedules/Clint new content ✘ broken
Characters/schedules/Haley new content ✘ broken
Characters/schedules/Harvey new content ✘ broken
Characters/schedules/Jas new content ✘ broken
Characters/schedules/Jodi new content ✘ broken
Characters/schedules/Leah new content ✘ broken
Characters/schedules/Lewis new content ✘ broken
Characters/schedules/Linus new content ✘ broken
Characters/schedules/Marnie new content ✘ broken
Characters/schedules/Maru new content ✘ broken
Characters/schedules/Penny new content ✘ broken
Characters/schedules/Robin new content ✘ broken
Characters/schedules/Sam new content ✘ broken
Characters/schedules/Sebastian new content ✘ broken
Characters/schedules/Shane new content + schedule fixes ✘ broken ✓ mostly unaffected
Characters/schedules/Vincent new content ✘ broken
Characters/schedules/Willy new content ✘ broken
Data/BigCraftablesInformation new content ✘ broken
Data/Blueprints new content + changes ✘ broken ✓ mostly unaffected
Data/CraftingRecipies new content ✘ broken
Data/Crops new content ✘ broken
Data/Events/ArchaeologyHouse minor change ✘ broken ✓ mostly unaffected
Data/Events/Beach new content + changes ✘ broken ✓ mostly unaffected
Data/Events/BusStop new content ✘ broken
Data/Events/Farm new content + changes ✘ broken ✓ mostly unaffected
Data/Events/FarmHouse changes ✘ broken ✓ mostly unaffected
Data/Events/Forest new content ✘ broken
Data/Events/HaleyHouse new content ✘ broken
Data/Events/Mountain new content + changes ✘ broken ✓ mostly unaffected
Data/Events/Saloon new content ✘ broken
Data/Events/SeedShop changes ✘ broken ✓ mostly unaffected
Data/Events/Town new content + changes ✘ broken ✓ mostly unaffected
Data/Events/WizardHouse changes ✘ broken ✓ mostly unaffected
Data/Events/Woods new content ✘ broken
Data/ExtraDialogue new content ✘ broken
Data/Festivals/fall27 changes ✘ broken ✓ mostly unaffected
Data/Festivals/spring13 changes ✘ broken ✓ mostly unaffected
Data/Festivals/spring24 changes ✘ broken ✓ mostly unaffected
Data/Festivals/summer11 new content + changes ✘ broken ✓ mostly unaffected
Data/Festivals/summer28 changes ✘ broken ✓ mostly unaffected
Data/Festivals/winter8 changes ✘ broken ✓ mostly unaffected
Data/Fish new content ✘ broken
Data/Furniture new content ✘ broken
Data/Monsters new content ✘ broken
Data/NPCGiftTastes changes ✘ broken ✓ mostly unaffected
Data/ObjectInformation new content ✘ broken
Data/Quests new content + changes ✘ broken ✓ mostly unaffected
Data/animationDescriptions changes ✘ broken ✓ mostly unaffected
Data/hats new content ✘ broken
Data/mail new content ✘ broken
LooseSprites/ControllerMaps cosmetic changes ✘ minor issues ✘ minor issues
LooseSprites/Cursors new content + changes ✘ broken ✓ mostly unaffected
LooseSprites/chatBox significantly changed ✘ broken ✘ broken
LooseSprites/letterBG new content ✘ broken
LooseSprites/map cosmetic changes ✘ minor issues
Maps/Farm unknown changes ✘ broken? ✘ broken?
Maps/FarmHouse unknown changes ✘ broken? ✘ broken?
Maps/FarmHouse1 unknown changes ✘ broken? ✘ broken?
Maps/FarmHouse1_marriage unknown changes ✘ broken? ✘ broken?
Maps/FarmHouse2 unknown changes ✘ broken? ✘ broken?
Maps/FarmHouse2_marriage unknown changes ✘ broken? ✘ broken?
Maps/Farm_Combat unknown changes ✘ broken? ✘ broken?
Maps/Farm_Fishing unknown changes ✘ broken? ✘ broken?
Maps/Farm_Foraging unknown changes ✘ broken? ✘ broken?
Maps/Farm_Mining unknown changes ✘ broken? ✘ broken?
Maps/Railroad unknown changes ✘ broken? ✘ broken?
Maps/Sewer unknown changes ✘ broken? ✘ broken?
Maps/sewerTiles new content ✘ broken ✓ mostly unaffected
Maps/Town unknown changes ✘ broken? ✘ broken?
Maps/fall_town new content ✘ broken ✓ mostly unaffected
Maps/paths new content ✘ minor issues
Maps/spring_town new content ✘ broken ✓ mostly unaffected
Maps/springobjects new content + cosmetic changes ✘ broken ✓ mostly unaffected
Maps/summer_town new content ✘ broken ✓ mostly unaffected
Maps/winter_town new content ✘ broken ✓ mostly unaffected
Portraits/MrQi new content ✘ broken
SewerTiles new content ✘ broken ✓ mostly unaffected
Strings/Characters new content ✘ broken
Strings/Events new content ✘ broken
Strings/Locations new content ✘ broken
Strings/Objects new content ✘ broken
Strings/StringsFromCSFiles new content ✘ broken
Strings/UI new content + changes ✘ broken
TileSheets/Craftables new content + significant changes
(replaced sprites in red, edited in orange)
✘ broken ✘ possibly broken
TileSheets/crops new content ✘ broken ✓ mostly unaffected
TileSheets/furniture new content ✘ broken ✓ mostly unaffected
fall_town new content ✘ broken ✓ mostly unaffected
paths new content ✘ minor issues
spring_town new content ✘ broken ✓ mostly unaffected
winter_town new content ✘ broken ✓ mostly unaffected