Modding:Migrate to Stardew Valley 1.4

From Stardew Valley Wiki
Revision as of 19:51, 28 July 2019 by Pathoschild (talk | contribs) (update for latest 1.4 changes)
Jump to navigation Jump to search

Index

This page describes the upcoming Stardew Valley 1.4, and may change before release.
Some text is redacted because it spoils content that hasn't been publicly announced yet.

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

This page explains how to update your mods for compatibility with Stardew Valley 1.4, which will release in 2019. See also Modding:Migrate to SMAPI 3.0.

SMAPI

Possible breaking changes

Notable changes which may break SMAPI mods:

  • Various method signatures have changed, notably Item.canStackWith. In most cases just recompiling will fix those. (Don't forget to update the manifest.json version!)
  • Some notable field/method changes:
    class field/method changes
    Farm shippingBin This field no longer exists. Use farm.getShippingBin(Game1.player) instead, which will return the global or personal shipping bin depending on the host settings.
    Farm shipItem(Item item) Removed; add directly to farm.getShippingBin(Game1.player) instead.
    Farmer money Replaced by Money, which handles shared/individual wallets for you.
    Game1 itemsToShip Removed; see farm.getShippingBin(Game1.player) or Game1.player.displayedShippedItems instead.
    Game1 getCharacterFromName(string name, bool mustBeVillager) The default for mustBeVillager changed from false to true, and added an overload to get a specific NPC type like Game1.getCharacterFromName<Pet>("petName", mustBeVillager: false).
    Game1 dailyLuck Use Game1.player.DailyLuck or Game1.player.team.sharedDailyLuck as appropriate instead.
    Item getStack No longer exists; use Item.Stack instead.
    Item addToStack Now takes an Item reference instead of stack count, but otherwise equivalent (i.e. it returns the remaining stack count but doesn't change the item passed in).
    Pet wasPetToday Replaced by lastPetDay, which is the Game1.Date.TotalDays value when it was last pet by each player. To check if any player pet them today:
    private bool WasPetToday(Pet pet)
    {
        NetLongDictionary<int, NetInt> lastPettedDays = ModEntry.ReflectionHelper.GetField<NetLongDictionary<int, NetInt>>(pet, "lastPetDay").GetValue();
        return lastPettedDays.Values.Any(day => day == Game1.Date.TotalDays);
    }
    

    To check if the current player pet them today:

    private bool WasPetTodayByCurrentPlayer(Pet pet)
    {
        NetLongDictionary<int, NetInt> lastPettedDays = ModEntry.ReflectionHelper.GetField<NetLongDictionary<int, NetInt>>(pet, "lastPetDay").GetValue();
        return lastPettedDays.TryGetValue(Game1.player.UniqueMultiplayerID, out int lastDay) && lastDay == Game1.Date.TotalDays;
    }
    
    ShopMenu itemPriceAndStock Changed from Dictionary<Item, int[]> to Dictionary<ISalable, int[]>, but otherwise equivalent. (Item implements ISalable.)

Other notable changes

These are changes which might be of interest to modders, but shouldn't break any mods.

  • See Modding wishlist#Done in Stardew Valley 1.4.
  • Added ██████████.
  • Added ██████████.
  • Added a GameLocation method to patch the location's map from another map file, and a method to force reload the map.
  • Added utility methods like Utility.CalculateMinutesUntilMorning, CalculateMinutesUntilMorning, ExpandRectangle, and GetOppositeFacingDirection.
  • Added audio context to methods like Game1.changeMusicTrack. If the context changes, any audio playing for the current context will end automatically.
  • Added light context (similar to previous).
  • Added two new stats to Game1.stats: exMemoriesWiped and childrenTurnedToDoves.
  • Added debug commands: addQuartz, addhour, addminute, allMailRead, animationPreviewTool/apt, broadcastMail, buff + clearBuffs, changeWallet + mergeWallets + separateWallets, clear, ██████████, collectquest, ██████████, createDebris, ██████████, ██████████, ██████████, ██████████, ██████████, festival, frameByFrame / fbf, growWildTrees, inputSim / inputsim / is, kick, ██████████ / ██████████, ██████████, ██████████, junimogoodbye, ██████████, ██████████, pauseTime, ██████████ / ██████████, sleep / newDay / nd, ██████████ + ██████████, ██████████, ██████████ / ██████████, testWordWrap, trashCan, warpToCharacter / wtc, and warpToPlayer / warptoplayer / wtp. Removed emote and fillWithPlacedObject.
  • Added option for invisible NPCs gone from the game temporarily (NPC.IsInvisible and NPC.daysUntilNotInvisible).
  • Added option for temporarily invisible/passable placed items (Object.isTemporarilyInvisible).
  • Added farmer.isUnclaimedFarmhand to distinguish a farmhand that hasn't been customised by a player yet.
  • Added kent option for the $d dialogue command.
  • Added %endearment and %endearmentlower dialogue tokens which returns a random choice from Pookie, Love, Hot Stuff, Cuddlebug, Hunky (male) or Peach (female), Cutie, Ducky, Handsome (male) or Darling (female), Sweetie, Dear, Honey, Hun, Sweetheart, or the player name.
  • Projectiles can now have a max travel distance.

Content Patcher

Possible breaking changes

Notable changes which may break Content Patcher packs (and XNB mods):

  • The DivorceBook and MayorFridge tile actions now only work in Lewis' house.

Other notable changes

These are changes which might be of interest to modders, but shouldn't break any mods.

  • The display name field is now used in English for the Data/BigCraftablesInformation and Data/ObjectInformation assets.
  • Added various tilesheets for new content.
  • Added ██████████.
  • Added an animation preview tool. This lets you preview player animations for your current character, optionally changing the hair/shirt/pants/gender. You can access it by entering debug animationPreviewTool or debug apt in the SMAPI console.
  • Added ██████████.
  • Added schedule commands: MAIL, no_schedule.
  • Event command changes:
    • Added commands: bgColor, ██████████, makeInvisible, ██████████, ██████████, money, ██████████ ██████████, ██████████. Added new event reward ██████████.
    • itemAboveHead now also accepts ██████████ and ██████████ arguments argument.
    • ██████████.

Update impact

Here's a summary of the XNB files which changed in Stardew Valley 1.4.

Notes:

  • This ignores text changes in non-English files for simplicity.
  • New content files aren't listed, since they won't impact existing mods.
  • 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
Buildings/Log Cabin ██████████ ✘ broken ✘ likely broken
Buildings/Plank Cabin ██████████ ✘ broken ✘ likely broken
Buildings/Stone Cabin ██████████ ✘ broken ✘ likely broken
Characters/Abigail ██████████ ✘ broken ✓ mostly unaffected
Characters/Caroline ██████████ ✘ broken ✓ mostly unaffected
Characters/Dwarf ██████████ ✘ broken ✓ mostly unaffected
Characters/Elliott ██████████ ✘ broken ✓ mostly unaffected
Characters/Evelyn ██████████ ✘ broken
Characters/George ██████████ ✘ broken ✓ mostly unaffected
Characters/Gus ██████████ ✘ broken ✓ mostly unaffected
Characters/Harvey ██████████ ✘ broken ✓ mostly unaffected
Characters/Kent ██████████ ✘ broken ✓ mostly unaffected
Characters/Krobus ██████████ ✘ broken ✓ mostly unaffected
Characters/Leah ██████████ ✘ broken
Characters/Lewis ██████████ ✘ broken
Characters/Marnie ██████████ ✘ broken
Characters/Maru ██████████ ✘ broken ✓ mostly unaffected
Characters/Pam ██████████ ✘ broken ✓ mostly unaffected
Characters/Penny ██████████ ✘ will remove changes ✓ mostly unaffected
Characters/Sam ██████████ ✘ broken ✓ mostly unaffected
Characters/Sandy ██████████ ✘ broken
Characters/Sebastian ██████████ ✘ broken ✓ mostly unaffected
Characters/Shane ██████████ ✘ will remove changes ✓ mostly unaffected
Characters/Wizard ██████████ ✘ will remove changes ✓ mostly unaffected
Characters/Dialogue/Abigail ██████████ ✘ broken ✓ mostly unaffected
Characters/Dialogue/Alex ██████████ ✘ broken
Characters/Dialogue/Elliott ██████████ ✘ broken ✓ mostly unaffected
Characters/Dialogue/Emily ██████████ ✘ broken
Characters/Dialogue/Haley ██████████ ✘ broken
Characters/Dialogue/Harvey ██████████ ✘ broken
Characters/Dialogue/Jodi ██████████ ✘ broken ✓ mostly unaffected
Characters/Dialogue/Krobus ██████████ ✘ broken
Characters/Dialogue/Krobus ██████████ ✘ broken
Characters/Dialogue/Leah ██████████ ✘ broken ✓ mostly unaffected
Characters/Dialogue/Linus ██████████ ✘ will remove changes ✓ mostly unaffected
Characters/Dialogue/MarriageDialogue ██████████ ✘ broken ✓ mostly unaffected
Characters/Dialogue/MarriageDialogueAlex ██████████ ✘ will remove changes ✓ mostly unaffected
Characters/Dialogue/MarriageDialoguePenny ██████████ ✘ will remove changes ✓ mostly unaffected
Characters/Dialogue/MarriageDialogueSam ██████████ ✘ will remove changes ✓ mostly unaffected
Characters/Dialogue/Maru ██████████ ✘ broken
Characters/Dialogue/Penny ██████████ ✘ broken
Characters/Dialogue/Pierre ██████████ ✘ will remove changes ✓ mostly unaffected
Characters/Dialogue/Sam ██████████ ✘ broken ✓ mostly unaffected
Characters/Dialogue/Sebastian ██████████ ✘ broken ✓ mostly unaffected
Characters/Dialogue/Shane ██████████ ✘ broken ✓ mostly unaffected
Characters/Farmer/farmer_base ██████████ ✘ broken ✘ broken
Characters/Farmer/farmer_girl_base ██████████ ✘ broken ✘ broken
Characters/Farmer/hairstyles ██████████ ✘ broken
Characters/Farmer/hats ██████████ ✘ broken ✓ mostly unaffected
Characters/Farmer/shirts ██████████ ✘ broken ✓ mostly unaffected
Characters/Farmer/shoeColors ██████████ ✘ broken
Characters/schedules/Alex ██████████ ✘ broken
Characters/schedules/Alex ██████████ ✘ broken ✓ mostly unaffected
Characters/schedules/Caroline ██████████ ✘ will remove changes ✓ mostly unaffected
Characters/schedules/Demetris ██████████ ✘ will remove changes ✓ mostly unaffected
Characters/schedules/Gus ██████████ ✘ broken
Characters/schedules/Jas ██████████ ✘ broken
Characters/schedules/Kent ██████████ ✘ broken ✓ mostly unaffected
Characters/schedules/Shane ██████████ ✘ broken ✘ likely broken
Characters/schedules/Vincent ██████████ ✘ broken
Characters/schedules/beforePathfinding/*
Characters/schedules/newSchedules/*
Characters/schedules/spring/*
deleted
Data/BigCraftablesInformation ██████████ ✘ broken ✘ broken
Data/Blueprints ██████████ ✘ broken ✓ mostly unaffected
Data/Boots ██████████ ✘ broken
Data/Bundles ██████████ ✘ broken
Data/CookingRecipes ██████████ ✘ will remove changes ✓ mostly unaffected
Data/CraftingRecipes ██████████ ✘ broken ✓ mostly unaffected
Data/EngagementDialogue ██████████ ✘ broken
Data/eventConditions deleted
Data/ExtraDialogue ██████████ ✘ broken
Data/Furniture ██████████ ✘ broken ✓ mostly unaffected
Data/hats ██████████ ✘ broken
Data/Locations ██████████ ✘ will remove changes ✓ mostly unaffected
Data/mail ██████████ ✘ broken ✘ likely broken
Data/MineRooms deleted
Data/monsters ██████████ ✘ broken
Data/NPCDispositions ██████████ ✘ broken ✓ mostly unaffected
Data/ObjectInformation ██████████ ✘ broken ✓ mostly unaffected
Data/Quests ██████████ ✘ broken
Data/SecretNotes ██████████ ✘ broken
Data/weapons ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/BathHouse_Pool ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/Beach ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/BusStop ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/Farm ██████████ ✘ broken
Data/Events/FarmHouse ██████████ ✘ broken ✓ mostly unaffected
Data/Events/Forest ██████████ ✘ broken
Data/Events/HaleyHouse ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/Hospital ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/LeahHouse ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/Mountain ██████████ ✘ broken ✓ mostly unaffected
Data/Events/Railroad ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/Saloon ██████████ ✘ broken ✓ mostly unaffected
Data/Events/SamHouse ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/ScienceHouse ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/SebastianRoom ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/SeedShop ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Events/Town ██████████ ✘ broken ✓ mostly unaffected
Data/Events/Beach ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Festivals/fall16 ██████████ ✘ will remove changes ✓ mostly unaffected
Data/Festivals/spring24 ██████████ ✘ broken ✓ mostly unaffected
Data/TV/CookingChannel ██████████ ✘ will remove changes ✓ mostly unaffected
Data/TV/TipChannel ██████████ ✘ will remove changes ✓ mostly unaffected
LooseSprites/Cursors ██████████ ✘ broken ✘ may remove changes
LooseSprites/daybg ██████████ ✘ will remove changes ✘ will remove changes
LooseSprites/JunimoNote ██████████ ✘ broken ✓ mostly unaffected
LooseSprites/map ██████████ ✘ broken ✓ mostly unaffected
LooseSprites/nightbg ██████████ ✘ will remove changes ✘ will remove changes
LooseSprites/SeaMonster ██████████ ✘ broken ✘ broken
LooseSprites/temporary_sprites_1 ██████████ ✘ broken ✓ mostly unaffected
Maps/{season}_town
{season}_town
██████████ ✘ broken
Maps/ArchaeologyHouse unknown changes ? ?
Maps/Backwoods unknown changes ? ?
Maps/Cabin
Maps/Cabin1_marriage
Maps/Cabin2_marriage
unknown changes ? ?
Maps/Club unknown changes ? ?
Maps/CommunityCenter_Joja unknown changes ? ?
Maps/CommunityCenter_Refurbished unknown changes ? ?
Maps/CommunityCenter_Ruins unknown changes ? ?
Maps/Deserts unknown changes ? ?
Maps/ElliottHouseTiles
ElliottHouseTiles
██████████ ✘ broken ✘ may remove cosmetic changes
Maps/Farm unknown changes ? ?
Maps/Farm_Combat unknown changes ? ?
Maps/Farm_Fishing unknown changes ? ?
Maps/Farm_Foraging unknown changes ? ?
Maps/Farm_Mining unknown changes ? ?
Maps/FarmHouse
Maps/FarmHouse1_marriage
Maps/FarmHouse2_marriage
unknown changes ? ?
Maps/farmhouse_tiles
farmhouse_tiles
██████████ ✘ broken ✓ mostly unaffected
Maps/Festivals ██████████ ✘ broken ✓ mostly unaffected
Maps/Forest unknown changes ? ?
Maps/Forest-FlowerFestival unknown changes ? ?
Maps/Forest-IceFestival unknown changes ? ?
Maps/HaleyHouse unknown changes ? ?
Maps/ManorHouse unknown changes ? ?
Maps/Hospital unknown changes ? ?
Maps/MenuTiles ██████████ ✘ broken ✓ mostly unaffected
Maps/MenuTilesUncolored ██████████ ✘ will remove changes ✓ mostly unaffected
Maps/Mountain unknown changes ? ?
Maps/nightSceneMaru ██████████ ✘ will remove changes ✓ mostly unaffected
Maps/Railroad unknown changes ? ?
Maps/Saloon unknown changes ? ?
Maps/SeedShop ██████████ ✘ broken ?
Maps/SewerTiles
SewerTiles
██████████ ✘ broken ✓ mostly unaffected
Maps/Shed unknown changes ? ?
Maps/spouseRooms ██████████ ? ?
Maps/springobjects ██████████ ✘ broken ✓ mostly unaffected
Maps/spring_outdoorsTileSheet
spring_outdoorsTileSheet
fall_outdoorsTileSheet
██████████ ✘ will remove changes ✓ mostly unaffected
Maps/Town unknown changes ? ?
Maps/Town-EggFestival unknown changes ? ?
Maps/Town-Fair unknown changes ? ?
Maps/Town-Halloween unknown changes ? ?
Maps/townInterior
townInterior
██████████ ✘ broken ✓ mostly unaffected
Maps/Mines/19 unknown changes ? ?
Maps/Mines/26 unknown changes ? ?
Maps/Mines/28 unknown changes ? ?
Minigames/MineCart ██████████ ✘ broken ✘ broken
Portraits/Elliott ██████████ ✘ will remove changes ✓ mostly unaffected
Portraits/Haley ██████████ ✘ will remove changes ✘ will probably remove changes
Portraits/Krobus ██████████ ✘ broken ✓ mostly unaffected
Portraits/Maru ██████████ ✘ will remove changes ✓ mostly unaffected
Portraits/Penny ██████████ ✘ broken ✓ mostly unaffected
Portraits/Sam ██████████ ✘ broken ✘ will remove changes
Strings/Buildings ██████████ ✘ broken
Strings/Characters ██████████ ✘ broken
Strings/credits ██████████ ✘ broken ✘ broken
Strings/Events ██████████ ✘ broken
Strings/Locations ██████████ ✘ broken
Strings/Notes ██████████ ✘ will remove changes ✓ mostly unaffected
Strings/StringsFromCSFiles ██████████ ✘ broken ✓ mostly unaffected
Strings/StringsFromMaps ██████████ ✘ broken ✓ mostly unaffected
Strings/UI ██████████ ✘ broken
Strings/schedules/Alex ██████████ ✘ broken
Strings/schedules/George ██████████ ✘ broken
Strings/schedules/Gus ██████████ ✘ broken
Strings/schedules/Alex ██████████ ✘ broken
Strings/schedules/Shane ██████████ ✘ broken
Strings/schedules/spring/Penny deleted
TerrainFeatures/Flooring ██████████ ✓ mostly unaffected ✓ mostly unaffected
TerrainFeatures/mushroom_tree ██████████ ✘ will remove changes ✘ may remove changes
TerrainFeatures/Quartz ██████████ ✘ broken ✘ broken
TileSheets/bushes ██████████ ✘ broken ✓ mostly unaffected
TileSheets/Craftables ██████████ ✘ broken ✓ mostly unaffected
TileSheets/Critters ██████████ ✘ broken ✓ mostly unaffected
TileSheets/projectiles ██████████ ✘ will remove changes ✓ mostly unaffected
TileSheets/furniture ██████████ ✘ broken ✘ may remove changes
TileSheets/tools ██████████ ✘ broken ✓ mostly unaffected
TileSheets/weapons ██████████ ✘ broken? ✓ mostly unaffected