Trying to tweak some settings in a mod for Subnautica 1. It thankfully has a github page, and even has a fork with the change I’m looking for (or close enough): https://github.com/sgsregde-ui/PrimeSonicSubnauticaMods

I can’t get a grasp on how to compile it into the DLL I need, though. I got VS Code and can open the files and make changes, but can’t figure out how to “build” it. It says I need a task, but none of the defaults work. I have no real experience coding or compiling, so I have no idea what’s going wrong here. Any help would be appreciated.

  • Ech@lemmy.caOP
    link
    fedilink
    arrow-up
    2
    ·
    1 day ago

    For the particular mod I’m looking at, I’m messing with the NuclearUpgrades. Specifically I want to change the overheating mechanic, which the repo I linked actually already changed (probably for the same reason). I can’t even get the unmodified version to build/compile, though, so I don’t think that’s what’s holding things up.

    just that info should get you to a quick tutorial guide.

    You would think, but the guides I’ve been able to find all seem to think “then click build” is sufficient for that step, which it apparently isn’t. I’m not sure what I’m missing that is so obvious to others.

    I feel like my biggest problem is just trying to figure out how the build task should be formatted. The only templates are MSBuild, maven, and .NET Core. When I use the .NET version, which seems most applicable, I get error NETSDK1013: The TargetFramework value '' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly.. I tried to that add in, but couldn’t figure out what version might work.

    And sometimes it opens up the C# Doctor on its own and I always get MSB4181 The "RestoreTask" task returned false but did not log an error in the “Restore NuGet Packages” step. Some guides linked a set of Subnautica nuget templates, but I’m not sure if I’ve put them in the wrong place or if that’s just a dead end.

    • Wimopy@feddit.uk
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      Ok, this took some tracking.

      https://github.com/MrPurple6411/UnifiedVSSolution

      Mr Purple has a Common folder in here that is used by all the projects. You’ll want to clone this repository (possibly recursively), then work on UnifiedVSSolution/PrimeSonicSubnauticaMods/CyclopsNuclearUpgrades. That should get you past the NuGet Packages stage. I still get some errors, but hopefully you can figure it out from there.

      • Ech@lemmy.caOP
        link
        fedilink
        arrow-up
        2
        ·
        1 day ago

        Omg, thank you! I’m still getting errors, but I’m making some progress at least. Never would have found that myself.

      • Ech@lemmy.caOP
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        Ok, now I’m stuck on hundreds of namespace errors, e.g. The type or namespace name 'TechType' could not be found (are you missing a using directive or an assembly reference?). I’ve tried ItemGroup -> Reference -> Aliases, and that seems to do something, but not fixing things. Will keep poking around at it.

        • Wimopy@feddit.uk
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 day ago

          I think I’ve found a way to get things to work:

          1. Within UnifiedVSSolution, change Subnautica.selective.slnf line 5 to "PrimeSonicSubnauticaMods/CyclopsNuclearUpgrades/CyclopsNuclearUpgrades.csproj" (if you ever want to build multiple mods, you’d add them as extra lines, comma separated, here)
          2. At the bottom of VS Code: select Subnautica.selective as your solution. Also make sure Subnautica Any CPU is selected. (Or BelowZero for Below Zero of course).
          3. Change the backslashes on line 28 in CyclopsNuclearUpgrades.csproj to forward slashes (no idea why that’s the only time OS-specific folder separators come up as an issue…)
          4. Might need to do a restart or two as prompted by C# Doctor.
          5. At this point I could right-click Subnautica.selective.slnf and hit Build and the output was put in bin/Subnautica

          If you ever want to try something simpler from scratch I can recommend https://subnauticamodding.github.io/Nautilus/guides/dev-setup.html though. And I’m sure the modding discord is very helpful too.

          • Ech@lemmy.caOP
            link
            fedilink
            arrow-up
            2
            ·
            1 day ago

            That worked! Thanks so much for your patience and effort. I really appreciate it ^.^

            • Wimopy@feddit.uk
              link
              fedilink
              arrow-up
              2
              ·
              1 day ago

              Happy to help! Just happened to have time during work, and trouble-shooting VS Code (though usually for Java) feels like half my day job anyway.