Changes

Jump to navigation Jump to search
→‎Overview: expand with more multiplayer info
Line 6: Line 6:     
==Overview==
 
==Overview==
 +
===Single player===
 
At a high level, here's how to update a SMAPI mod:
 
At a high level, here's how to update a SMAPI mod:
 
# Update the [https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig mod build NuGet package] to 2.1-beta. (You may need to enable the 'include prerelease' checkbox to see the beta.)<br />''This adds support for Stardew Valley 1.3, and adds code analysis which will report common problems in Stardew Valley 1.3 as compiler warnings.''
 
# Update the [https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig mod build NuGet package] to 2.1-beta. (You may need to enable the 'include prerelease' checkbox to see the beta.)<br />''This adds support for Stardew Valley 1.3, and adds code analysis which will report common problems in Stardew Valley 1.3 as compiler warnings.''
Line 14: Line 15:  
# Test all mod features to make sure they work.
 
# Test all mod features to make sure they work.
   −
That should take care of compatibility in single-player mode. The game will automatically synchronise most world changes to other players, but you might need further changes to work in multiplayer mode. Questions to consider: will your mod cause any problems if two players both have it installed? Do you have any custom objects/buildings/etc that might get synchronised to other players, and will that synchronisation work correctly? What if they have different configuration? Maybe it should only work for the main player? You can use [[Modding:SMAPI APIs#Context|SMAPI's <tt>Context.IsSinglePlayer</tt> and <tt>Context.IsMainPlayer</tt> flags]] in your logic to avoid conflicts.
+
If you need help updating your code, feel free to ask questions [[Modding:Community#Discord|on the Stardew Valley Discord]].
 +
 
 +
===Multiplayer===
 +
The instructions for single player apply for multiplayer too. Stardew Valley 1.3 automatically synchronises most world changes to other players (see ''[[#net fields|net fields]]''), so many mods will work in multiplayer too. Some mods may need further changes, but that can only be decided case-by-case.
 +
 
 +
There are three common approaches to multiplayer compatibility:
 +
* Let anyone install the mod. If your mod makes changes to the world, make sure it'll work fine if different players have different versions or configuration, or only some of the players have it installed.
 +
* Only let the main player install the mod, which avoids complications from other players changing the same data. To do this, check SMAPI's <code>Context.IsMainPlayer</code> in your code.
 +
* Only enable in single-player mode. This eliminates all multiplayer and sync complications, though players may be disappointed. To do this, check SMAPI's <code>Context.IsMultiplayer</code> in your code.
   −
If you need help updating your code, feel free to ask questions [[Modding:Community#Discord|on the Stardew Valley Discord]].
+
Common issues:
 +
* If your mod adds custom buildings or items, the game may crash trying to sync them to other players.
    
==Major changes==
 
==Major changes==
translators
8,403

edits

Navigation menu