This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Changes

Jump to: navigation, search

Modding:Modder Guide/Get Started

20 bytes added, 15:29, 30 September 2020
m
Crossplatform support: standardize code
<source lang="c#">
// ✘ Don't do this! It will crash on Linux/Mac.
string path = this.Helper.DirectoryPath + "\assets\asset.xnb";
// ✓ This is OK
string path = Path.Combine(this.Helper.DirectoryPath, "assets", "asset.xnb");
</source></li>
<li>Use <tt>this.Helper.DirectoryPath</tt>, don't try to determine the mod path yourself.
<source lang="c#">
// ✓ This is OK
string modFolder = this.Helper.DirectoryPath;
</source></li>
</ol>
Protected, translators
5,421
edits

Navigation menu