Pathoschild / SMAPI

The modding API for Stardew Valley.
https://smapi.io/
GNU Lesser General Public License v3.0
1.77k stars 260 forks source link

Mac/Linux support? #126

Closed LuciousLisa closed 7 years ago

LuciousLisa commented 8 years ago

Now that the game has become available to us non-Windows users, it would be appreciated a lot if SMAPI also offers support for these operating systems. Pretty please? :)

vizv commented 7 years ago

@Pathoschild I checked that, the problem is: on https://github.com/cjsu/SMAPI/releases/tag/0.40.1.1 it claims the release is build against 5087c3d but it is not (at least 12e4822), I'll rebase the master and build it again.

vizv commented 7 years ago

@Pathoschild The updated version 0.40.0 1.1-3 is live: https://github.com/vizv/SMAPI/releases/tag/0.40.1.1

Pathoschild commented 7 years ago

@vizv Thanks!

Pathoschild commented 7 years ago

I have a beta version of SMAPI that runs on Linux, Mac, and Windows. This will become an official release if all goes well. I just need some volunteers to try it out — the more the better!

If you have any questions or problems, feel free to come chat directly on Discord.

1. Remove unofficial versions of SMAPI

If you've never used SMAPI on Linux or Mac, you can skip this section.

The unofficial SMAPIs for Linux/Mac replace your game launcher. The beta adds a separate launcher instead so you can easily go back to playing without mods (just like the current version on Windows). You should restore the original launcher to prevent confusion later.

If you created a StardewValley.unmodded file based on the using mods guide:

  1. Delete the StardewValley file without an extension (don't delete StardewValley.exe!).
  2. Rename StardewValley.unmodded to StardewValley.

Otherwise:

  1. Delete the StardewValley file without an extension (don't delete StardewValley.exe!).
  2. Unpack the default launcher into your game directory.

2. Install the beta

  1. Unpack SMAPI 0.41-beta directly into your game folder (e.g. StardewModdingAPI.exe should be in the same folder as Stardew Valley.exe).

    These are the default game folders:

    platform path
    GOG on Linux ~/GOG Games/Stardew Valley/game
    GOG on Windows C:\Program Files (x86)\GalaxyClient\Games\Stardew Valley
    Steam on Linux ~/.local/share/Steam/steamapps/common/Stardew Valley
    Steam on Mac ~/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS
    Steam on Windows C:\Program Files (x86)\Steam\steamapps\common\StardewValley

3. Test the beta

  1. Unpack the Lookup Anything mod into the <game folder>\Mods folder. (It works on all platforms, so it's a good baseline.)
  2. Launch SMAPI to play with mods. (On Linux or Mac, run StardewModdingAPI without an extension. On Windows, run StardewModdingAPI.exe.)
  3. In the game, point the cursor at your character and press F1. Does something like this screenshot appear?
  4. Add a comment with your results (even if it worked fine!). Don't forget to mention whether you play on Linux, Mac, or Windows.

If that didn't work, come chat directly on Discord so we can figure out why. If don't want to use Discord, add a comment here with the information needed to look into it.

4. Uninstall the beta (optional)

Just delete these files in your game folder:

aaron-j-reeves commented 7 years ago

Any word on the cheatmenu mod? Seems like a really popular one thats been completely abandoned. Would be nice to see someone pick it up and get it working in linux! If theres instructions on how to get it working in linux I could even do it myself but I only see instructions for making a new mod to work with linux (as opposed to converting an existing mod)

Pathoschild commented 7 years ago

@ajrc0re you can migrate an existing mod using the crossplatform build config, but you'll need the mod's source code.

Pathoschild commented 7 years ago

I made several changes for Mac compatility and updated the downloads; thanks @mys721tx for helping test on Mac. :)

mys721tx commented 7 years ago

Here are the test results of the 0.41-beta on a Max OS X 10.12.1 box.

Test environment: Mac OS X 10.12.1, Stardew Valley 1.11 Mods tested: Trainer Mod, Lookup Everywhere

80b2b3d: Unable to launch SMAPI due to missing System.Windows.Forms (log) f44eb6d: Unable to load mods from SMAPI due to missing System.Numerics (log) 58c0262: Game runs in the background due to threading (log) 6cc8c6d: Everything works!

aaron-j-reeves commented 7 years ago

Been trying to get the new SMAPI working for the last few hours. Definitely doesnt work. Heres my error log, not really sure what the issue is but you can see everal errors that complain about "System.IO.FileNotFoundException: Could not load file or assembly or one of its dependencies."

MODDED_ProgramLog.Log_LATEST.txt

Arch Linux (Antergos) KDE Plasma lastest version of SV (1.11) Latest SMAPI 0.41 Beta

mys721tx commented 7 years ago

@ajrc0re It looks like System.Numerics is missing. Could you try System.Numerics.dll from mono?

Pathoschild commented 7 years ago

@ajrc0re: I updated the Linux release to fix that error on some distros; let me know if the new build works.

aaron-j-reeves commented 7 years ago

Worked flawlessly, thanks for your help! Great work everyone.

vizv commented 7 years ago

@Pathoschild Great job! One last problem, if you don't change the game launcher how to launch it with Steam integration (such as Steam overlay)?

Pathoschild commented 7 years ago

@vizv you can configure Steam to launch SMAPI directly on Windows; I assume you can do the same on Linux and Mac. If someone can figure out the equivalent on those platforms, I'll add it to the guide.

vizv commented 7 years ago

@Pathoschild I tried before but it doesn't seem to work, could you confirm that?

Pathoschild commented 7 years ago

@vizv yep, just confirmed with @rumangerst that it works on Linux too. I'll update the guide when the new version of SMAPI is released.

vizv commented 7 years ago

@Pathoschild I put "/path/to/StardewModdingAPI" %command% to launch option, and it not always work. When I launch steam through terminal, it works. But when I open it by clicking steam icon, it doesn't. Wondering why... Is there anyone have the similar issue? Or did I do something wrong.

vizv commented 7 years ago

@rumangerst you mean I put bash -c '"/path/to/StardewModdingAPI" %command%' in launch option? But it doesn't work. I have no idea about how steam handle value in launch option.

vizv commented 7 years ago

@rumangerst Gentoo/KDE5/fish shell

I think mono crashes after launch from desktop file, but I can't get stacktrace/log/anything.

vizv commented 7 years ago

@rumangerst I did a ps aux |grep Stardew for both starting steam via shell and desktop, and the output are exactly the same...

Pathoschild commented 7 years ago

The reason for a separate launcher is to make it easy to go back to normal gameplay (without needing to redownload core files). I think that's a good idea, but not if it makes installation difficult (e.g. the last several comments).

Before we go live with crossplatform SMAPI, I think we should consider creating simple install/uninstall scripts to automate the manual install. When a player downloads SMAPI, they'd just run the install script in the package to automatically add SMAPI.

The install scripts would...

  1. detect the game install path (or ask the user if it can't be found);
  2. rename the default StardewValley launcher to StardewValley-without-mods (if it doesn't already exist);
  3. copy the SMAPI files into the game directory.

The uninstall scripts would...

  1. detect the game install path (or ask the user if it can't be found);
  2. delete all SMAPI files (but leave the non-default mods just in case);
  3. rename the StardewValley-without-mods launcher to StardewValley.

Any thoughts?

Pathoschild commented 7 years ago

Merged into master; SMAPI will be crossplatform in the upcoming 1.0 release. I moved the installer proposal to #155.