Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MO2Conf files not written on launch of the app, issue with nxm:// links not resolved #1093

Closed
Dictorclef opened this issue Apr 27, 2024 · 22 comments · Fixed by #1096
Closed
Labels
bug Something isn't working ModOrganizer 2 Issues related to installing or using ModOrganizer 2 with SteamTinkerLaunch

Comments

@Dictorclef
Copy link

System Information

  • SteamTinkerLaunch version: v14.0.20240423-1
  • Distribution: OpenSUSE Tumbleweed
  • Installation Method: Built from source, Master branch

Issue Description

Nexus mods downloads don't work through Mod Organizer 2. When I look into the steamtinkerlaunch.log file it complains about the .conf files not being present, an issue I thought was resolved by commit #1082.

Logs

steamtinkerlaunch.log

@Dictorclef Dictorclef added the bug Something isn't working label Apr 27, 2024
@sonic2kk
Copy link
Owner

sonic2kk commented Apr 27, 2024

Regardless of platform, please never use these types of links. However, I'll try to help anyway, as you are not on SteamOS.

If you try to remove the download config file or a containing folder for these, does it resolve the issue?

I don't use MO2, and I do not use these types of links for any software regardless of platform, so this issue is probably going to just end up as "don't use these links and download mods manually".

Also, in saying that #1082 fixed it, the author of that PR said it fixed it, and it didn't cause regressions for me in testing, so it's likely that before or after that commit the issue would persist. In my opinion these links will never work correctly. Quite a few people across many software types have tried to get this to work and it simply has not, including for SteamTinkerLaunch.

cc @zerodogg , although it's very reasonable if you like me also put your hands up and don't understand why this isn't working.

@sonic2kk
Copy link
Owner

sonic2kk commented Apr 27, 2024

One other thing to test: In the log attached it doesn't look like you're launching MO2. If you run steamtinkerlaunch mo2 start and then try to download a mod, does that work?

The URL handling code, to my understanding, will launch MO2 but it isn't the same as startMO2 and there may be some logic that relies on you starting MO2 regularly to get this functionality.

If you look at the PR, these lines are added to startMO2 which is to my understanding the crux of fixing the issue: https://github.com/sonic2kk/steamtinkerlaunch/pull/1082/files#diff-77c6d4bb1bf7c1988ff5a068c856b6c24e113663f2e61cb3a2c98723c0fafc04R17567-R17572

However this is not called in dlMod2nexurl which is called when trying to download the URL: https://github.com/sonic2kk/steamtinkerlaunch/pull/1082/files#diff-77c6d4bb1bf7c1988ff5a068c856b6c24e113663f2e61cb3a2c98723c0fafc04R17629

The PR allowed instances to be able to download MO2 mods by configuring them appropriately if they are launched with steamtinkerlaunch mo2 start, as long as that instance has been launched already prior to trying to download a mod with an NXM link. Makes sense, you have to launch either the global or portable instance to set up the configuration properly before you can click on the links and get them to work.

The assumption from the author may have been the same as mine; MO2 is started with these fixes from that PR before you try to download a mod. If you have done so then we're on the same page and sadly I don't know what the issue is. If you have not. that may be the problem.

Try launching the global MO2 with steamtinkerlaunch mo2 start or the MO2 with the game instance in Game Mode, before trying to download mods. For example, if you start Fallout New Vegas in Game Mode at launch, do this and then try to download a mod with an NXM link.


Also, the author of the PR is free to weigh in here and tell me my understanding is wrong. They may have more insight into what is going on (I've written very, very little of the MO2 stuff for SteamTinkerLaunch, it was done years ago by the previous maintainer).

@sonic2kk sonic2kk added the ModOrganizer 2 Issues related to installing or using ModOrganizer 2 with SteamTinkerLaunch label Apr 27, 2024
@Dictorclef
Copy link
Author

steamtinkerlaunch.log
Here's the log after launching through steamtinkerlaunch mo2 start. It still doesn't download, but now it tells me that the global.conf file has incomplete data, so at the very least now it's created the global.conf .

@Dictorclef
Copy link
Author

global.txt
Here's the global.conf file (renamed to .txt so I can upload it on github). I think it's unable to set the STEAM_COMPAT_CLIENT_INSTALL_PATH?

@sonic2kk
Copy link
Owner

That missing path sounds valid as I don't think this information is available outside of running from Steam. But I don't know if it's needed when running with Wine directly (I thought we ran MO2 with Wine directly specifically to avoid this kind of thing).

Did you try removing any of those existing config files and then running both global MO2 and the instance you want to run with, and seeing if that fixes the problem?

When I'm on my PC again I'll compare your config with the one on my system and see what is different, if anything.

@zerodogg
Copy link
Contributor

Ok, so, the pull request probably only fixed game-specific installs of MO2, and not a global MO2. I'll try to reproduce the issue on my end with a global MO2.

@sonic2kk
Copy link
Owner

That makes sense, since the game-specific installs should be using Proton (I think) and would have access to STEAM_COMPAT_CLIENT_INSTALL_PATH which may not be available. This comes from the Steam Client if I recall correctly.

@zerodogg
Copy link
Contributor

Right, so, the global and game-specific MO2s have different code paths for their config files, and thus the original fix doesn't apply for the global one.

Give this a try, either by trying the fix-nxm-urlscheme-global branch of my fork at https://github.com/zerodogg/steamtinkerlaunch/ - or by just applying the patch below to your local version.

Either way you will need to start MO2 again normally once for steamtinkerlaunch to rewrite the global config file. Then try the links again.

Patch:

diff --git a/steamtinkerlaunch b/steamtinkerlaunch
index 38f64c6..042fd89 100755
--- a/steamtinkerlaunch
+++ b/steamtinkerlaunch
@@ -19760,6 +19760,9 @@ function updateMO2GlobConf {
        {
                echo "GMO2EXE=\"$MO2EXE\""
                echo "RUNPROTON=\"$MO2RUNPROT\""
+               echo "MO2PFX=\"$MO2PFX\""
+               echo "MO2WINE=\"$MO2WINE\""
+               echo "MO2INST=\"$MO2INST\""
                echo "STEAM_COMPAT_CLIENT_INSTALL_PATH=\"$STEAM_COMPAT_CLIENT_INSTALL_PATH\""
                echo "STEAM_COMPAT_DATA_PATH=\"$MO2CODA\""
        } > "$MYGLOBDLDAT"

@zerodogg
Copy link
Contributor

Ok, so that patch isn't quite complete, it also has another code path for launching too. Give me another moment.

@zerodogg
Copy link
Contributor

Second time's the charm. Same branch, or the patch below. A global MO2 launches properly with the install URL for me with this one. There are some other issues with the handling that is a bit odd though (ie. it will use the local GM2 variant even if the previous launch was a global one, if the local one exists - which is why my initial patch was incomplete, it "worked" for me since it wasn't using the global one) - but that's not relevant for this particular issue, but needs fixing eventually.

git diffdiff --git a/steamtinkerlaunch b/steamtinkerlaunch
index 38f64c6..f5a8acc 100755
--- a/steamtinkerlaunch
+++ b/steamtinkerlaunch
@@ -17626,6 +17626,15 @@ function dlMod2nexurl {
                                else
                                        writelog "ERROR" "${FUNCNAME[0]} - Could not find a valid $MO instance for '${MONGURL}' - giving up"
                                fi
+                       elif [ -d "${GMO2EXE%/*}" ] && [ -n "$MO2PFX" ] && [ -n "$MO2WINE" ]; then
+                               MYINST="$(grep -m1 "\"${MONGURL}\"" "$MO2GAMES" | cut -d ';' -f1)"
+                               MYINST="${MYINST//\"/}"
+                               if [ -n "$MYINST" ]; then
+                                       writelog "INFO" "${FUNCNAME[0]} - Starting global MO2 in prefix '$MO2PFX' using '$MO2WINE' on $MYINST"
+                                       WINEDEBUG="-all" WINEPREFIX="$MO2PFX" "$MO2WINE" "$GMO2EXE" -i "$MYINST" "$1" 2>&1 | tee /tmp/RUNMO2DL.log
+                               else
+                                       writelog "ERROR" "${FUNCNAME[0]} - Could not find a valid global MO2 instance"
+                               fi
                        else
                                writelog "ERROR" "${FUNCNAME[0]} - Attempted to download Url '$1' for game '$MONGURL', but seems like global '$MYGLOBDLDAT' has incomplete data - giving up" "E"
                        fi
@@ -19760,6 +19769,9 @@ function updateMO2GlobConf {
        {
                echo "GMO2EXE=\"$MO2EXE\""
                echo "RUNPROTON=\"$MO2RUNPROT\""
+               echo "MO2PFX=\"$MO2PFX\""
+               echo "MO2WINE=\"$MO2WINE\""
+               echo "MO2INST=\"$MO2INST\""
                echo "STEAM_COMPAT_CLIENT_INSTALL_PATH=\"$STEAM_COMPAT_CLIENT_INSTALL_PATH\""
                echo "STEAM_COMPAT_DATA_PATH=\"$MO2CODA\""
        } > "$MYGLOBDLDAT"

@Dictorclef
Copy link
Author

Dictorclef commented Apr 27, 2024

The Mod organizer button in the menu that appears when launching a game with the steamtinkerlaunch compatibility tool is to launch the global mod organizer instance, is that right? I was under the impression that it launched the game-specific instance, that might explain my confusion.

@Dictorclef
Copy link
Author

Nevertheless, your commit will be helping other people. Thanks!

@zerodogg
Copy link
Contributor

No, that button should be launching the game-specific one. Sorry, I was confused by you attempting to use the global one in your second comment.

Those patches will do nothing for you, then (but will fix stuff for others later, so, uh yay?).

Could you just launch MO2 in the normal way you start it (through Steam), then just close it, and upload the steamtinkerlaunch.log that it generates? That file should have some information about it writing the newvegas-specific instance settings. If your steamtinkerlaunch is up-to-date (as it seems to be), then it can't start MO2 without writing those files, so I'm guessing something goes wrong while writing them. Also, check if /home/gabrielle/.config/steamtinkerlaunch/mo2/dldata/newvegas.conf exists, and if it does then include that as well.

(it's 00:17 here, so I'll have to dig into this tomorrow morning)

@Dictorclef
Copy link
Author

No, that button should be launching the game-specific one. Sorry, I was confused by you attempting to use the global one in your second comment.

Those patches will do nothing for you, then (but will fix stuff for others later, so, uh yay?).

Could you just launch MO2 in the normal way you start it (through Steam), then just close it, and upload the steamtinkerlaunch.log that it generates? That file should have some information about it writing the newvegas-specific instance settings. If your steamtinkerlaunch is up-to-date (as it seems to be), then it can't start MO2 without writing those files, so I'm guessing something goes wrong while writing them. Also, check if /home/gabrielle/.config/steamtinkerlaunch/mo2/dldata/newvegas.conf exists, and if it does then include that as well.

(it's 00:17 here, so I'll have to dig into this tomorrow morning)

I'm able to download using nxm:// links if I launch MO2 by setting the MO2 option in the game menu to "gui", thus launching MO2 once I close the Steamtinkerlaunch window. Launching MO2 through the menu button seems to behave differently and won't download mods using nxm:// links.
steamtinkerlaunch.log
here's the log file as requested

@sonic2kk
Copy link
Owner

The button on the main menu should be the global MO2, or "standalone." Launching MO2 with Game Mode (setting gui in the menu for MO2 Mode) will use the game-specific one. That's my understanding at the moment.

@zerodogg Nevertheless, you're a legend for being able to help with this :-)

@sonic2kk sonic2kk reopened this Apr 27, 2024
@sonic2kk
Copy link
Owner

Reopening pending further discussion :-)

@Dictorclef
Copy link
Author

The button on the main menu should be the global MO2, or "standalone." Launching MO2 with Game Mode (setting gui in the menu for MO2 Mode) will use the game-specific one. That's my understanding at the moment.

@zerodogg Nevertheless, you're a legend for being able to help with this :-)

Could you add an indication or a hint in the UI that the button launches it in global mode and that one should use the gui option to set it up in game mode? because right now it's not very obvious that one has to go in the game menu to setup mod organizer for their chosen game.

@sonic2kk
Copy link
Owner

sonic2kk commented Apr 28, 2024

Could you add an indication or a hint in the UI that the button launches it in global mode and that one should use the gui option to set it up in game mode? because right now it's not very obvious that one has to go in the game menu to setup mod organizer for their chosen game.

This is already documented on the wiki. Also, "global" is the internal term for it, and comes from ModOrganizer 2 being installed to its own prefix. This mode is used to configure MO2 and is referred to on the wiki as "Standalone Mode", and Game Mode ("GUI") is used for actually launching games, as that's the one installed to the game prefix.

To use Standalone Mode, you can launch ModOrganizer 2 via the Command Line with steamtinkerlaunch mo2 start. You can also use the "ModOrganizer 2" Extra Button on the Main Menu, or use the Tray Icon.

If you think a note on the UI is any more beneficial I guess it could be added, although I'm concerned about how verbose it could end up being. Some people in the past have used it to launch games for example instead of using GUI mode, and adding a note that it's standalone mode won't help people that haven't read the wiki as it won't mean anything to them.

The purpose of launching in standalone mode is that it's your "master" ModOrganizer 2, and the others, while still installed to the per-game prefix, are meant to inherit their configuration from the Standalone installation. To my knowledge that's why it was implemented the way it was (I don't use MO2, when I mod games I do it manually).

I'm not against adding a UI note I'm just concerned it may not end up being that useful.

@zerodogg
Copy link
Contributor

So, like I thought, it wasn't writing the correct file with info about the game install, thus causing the nxm:// link launching to fail since it got confused by being told to use a game-specific instance, but then the game-specific config file not being there.

This commit should fix that by falling back to using the game AID (which your logfile confirms is properly set) to detect the game name: zerodogg@7b6c66f

@sonic2kk
Copy link
Owner

sonic2kk commented May 2, 2024

@Dictorclef Did you have a chance to test if the changes work? If so, I can merge the PR :-)

@sonic2kk sonic2kk reopened this May 3, 2024
@sonic2kk
Copy link
Owner

sonic2kk commented May 3, 2024

@Dictorclef #1096 was merged into master (to avoid further conflicts, particularly with #1100). Feel free to test if this resolves the issue. If so, this issue can be closed.

@zerodogg Thank you once again for your hard work on this area 🎉

@Dictorclef
Copy link
Author

@Dictorclef #1096 was merged into master (to avoid further conflicts, particularly with #1100). Feel free to test if this resolves the issue. If so, this issue can be closed.

@zerodogg Thank you once again for your hard work on this area 🎉

Sorry for the delay and thanks! It seems to be writing the conf file well even in global mode, so I'd say the issue is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ModOrganizer 2 Issues related to installing or using ModOrganizer 2 with SteamTinkerLaunch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants