Changes

Jump to navigation Jump to search
m
Replace deprecated <source> tags with <syntaxhighlight> tags; add new template Template:Modder compatibility header
Line 1: Line 1:  
←[[Modding:Index|Index]]
 
←[[Modding:Index|Index]]
   −
'''This page is for modders. Players: see [[Modding:Mod compatibility]] instead.'''
+
{{Modder compatibility header}}
 
   
This page explains how to update your mods for compatibility with {{version|1.5|Stardew Valley 1.5}}, and documents some of the changes and new functionality.
 
This page explains how to update your mods for compatibility with {{version|1.5|Stardew Valley 1.5}}, and documents some of the changes and new functionality.
   Line 23: Line 22:  
'''Note:''' to avoid mod conflicts, prefixing data fields with your mod ID is strongly recommended:
 
'''Note:''' to avoid mod conflicts, prefixing data fields with your mod ID is strongly recommended:
   −
<source lang="C#">
+
<syntaxhighlight lang="C#">
 
item.modData[$"{this.ModManifest.UniqueID}/item-age"] = "30";
 
item.modData[$"{this.ModManifest.UniqueID}/item-age"] = "30";
</source>
+
</syntaxhighlight>
    
===UI scale changes===
 
===UI scale changes===
Line 48: Line 47:     
:* This introduces two UI-adjusted pixel [[Modding:Modder Guide/Game Fundamentals#Positions|coordinate systems]], one for absolute positions (relative to the top-left corner of the map) and one for screen positions (relative to the top-left corner of the screen). You should be careful not to mix them to avoid tricky calculations; for example, do all your work in one coordinate system and then convert them once.
 
:* This introduces two UI-adjusted pixel [[Modding:Modder Guide/Game Fundamentals#Positions|coordinate systems]], one for absolute positions (relative to the top-left corner of the map) and one for screen positions (relative to the top-left corner of the screen). You should be careful not to mix them to avoid tricky calculations; for example, do all your work in one coordinate system and then convert them once.
:* The game now has two distinct draw modes depending on the context: ''UI mode'' and ''non-UI mode''. You can check <tt>Game1.uiMode</tt> to know which mode is active. This affects which of the coordinate systems should be used to draw to the screen.<p>When drawing UI, you can indicate to the game that you want to use UI scaling. This has minimal performance impact if the game is already in UI mode, but you should avoid doing it unnecessarily if you know the code will always run in non-UI mode.</p><source lang="c#">Game1.game1.InUIMode(() =>
+
:* The game now has two distinct draw modes depending on the context: ''UI mode'' and ''non-UI mode''. You can check <tt>Game1.uiMode</tt> to know which mode is active. This affects which of the coordinate systems should be used to draw to the screen.<p>When drawing UI, you can indicate to the game that you want to use UI scaling. This has minimal performance impact if the game is already in UI mode, but you should avoid doing it unnecessarily if you know the code will always run in non-UI mode.</p><syntaxhighlight lang="c#">Game1.game1.InUIMode(() =>
 
{
 
{
 
   // your UI draw code here
 
   // your UI draw code here
 
});
 
});
</source>
+
</syntaxhighlight>
    
; How do I update affected code?
 
; How do I update affected code?
Line 232: Line 231:  
===Festival changes===
 
===Festival changes===
 
* Festivals can now have different versions per year. This works by adding a new <tt>set-up_y&lt;year&gt;</tt> field in the festival data (modulo with the current year), and/or <tt>&lt;npc>_y&lt;year&gt;</tt> dialogue keys for each NPC (like <tt>Abigail_y2</tt>).
 
* Festivals can now have different versions per year. This works by adding a new <tt>set-up_y&lt;year&gt;</tt> field in the festival data (modulo with the current year), and/or <tt>&lt;npc>_y&lt;year&gt;</tt> dialogue keys for each NPC (like <tt>Abigail_y2</tt>).
* Custom NPCs can now be added to festivals by editing the festival data file (instead of patching them into the character sheet which is conflict-prone). The key is "Set-Up_additionalCharacters" (with that exact capitalization), and the value format is "NpcName X Y Direction" (where direction can be up/down/left/right or an integer code) delimited by "/".<p>For example, this safely adds a custom NPC to the Stardew Valley Fair using Content Patcher:</p><source lang="js">{
+
* Custom NPCs can now be added to festivals by editing the festival data file (instead of patching them into the character sheet which is conflict-prone). The key is "Set-Up_additionalCharacters" (with that exact capitalization), and the value format is "NpcName X Y Direction" (where direction can be up/down/left/right or an integer code) delimited by "/".<p>For example, this safely adds a custom NPC to the Stardew Valley Fair using Content Patcher:</p><syntaxhighlight lang="js">{
 
   "Action": "EditData",
 
   "Action": "EditData",
 
   "Target": "Data/Festivals/fall16",
 
   "Target": "Data/Festivals/fall16",
Line 243: Line 242:  
       }
 
       }
 
   ]
 
   ]
}</source>
+
}</syntaxhighlight>
 
* Shops can now sell furniture via the <tt>shop</tt> field in the festival data file. The format is identical to the existing field, but with a <tt>F</tt> item type code.
 
* Shops can now sell furniture via the <tt>shop</tt> field in the festival data file. The format is identical to the existing field, but with a <tt>F</tt> item type code.
  
114

edits

Navigation menu