Giter Club home page Giter Club logo

modtemplatevalheim's People

Contributors

eai04191 avatar geocine avatar measurity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

modtemplatevalheim's Issues

Disclaimer installs mods to local game?

i am developing a server mod.

I go to start my valheim only to find this project has installed bepinex into my local game.
i see readme says bepinex and moves mod to plugins folder.

but i figured that was in development environment. in the bin folder. i didn't realize this would be editing my game install.

UnpatchSelf

[Warning: HarmonyX] UnpatchAll has been called with harmonyID=null - This will remove ALL HARMONY PATCHES. If you want to only unpatch patches created by this instance (1010101110.serversteaminfo), use UnpatchSelf() instead.

should we update Mod.cs to unpatchself?

[BuildTool] New version for BepInEx needed

Couldn't use the BepInEx 5.4.5 for current game version. Had to use this version:

private const string BepInExDownloadUrl =
    "https://github.com/BepInEx/BepInEx/releases/download/v5.4.19/BepInEx_x64_5.4.19.0.zip";

And I also updated UnityDoorstop: (was not necessary)

private const string UnityDoorstopDownloadUrl =
    "https://github.com/NeighTools/UnityDoorstop/releases/download/v3.4.0.0/Doorstop_x64_3.4.0.0.zip";
```

Fix "Steam game with id 892970 is not installed"

I'm a developer who isn't good at C #. I tried to check the behavior of this template to build a mod created based on this template, but it didn't work, so I found a first aid.

Perhaps this project has been abandoned, but I'll leave a guide for anyone who wants to use it for some reason.

Currently this Build Tool does not work. The reason is that the structure of "libraryfolders.vdf" is changed.

It used to be listed with numbers as keys (source), but now it's better structured.

current libraryfolders.vdf sample:

"libraryfolders"
{
	"contentstatsid"		"8073630155507702465"
	"1"
	{
		"path"		"G:\\SteamLibrary"
		"label"		""
		"contentid"		"2269125834715082803"
		"totalsize"		"2000381014016"
		"apps"
		{
			"550"		"14905356071"
			...
		}
	}
}

So, to get this to work, we need to look up the value in the Dictionary with the string "path" instead of the number.

private static SteamGameData SearchAllInstallations(
string libraryfoldersFile, uint appId)
{
if (!File.Exists(libraryfoldersFile)) return null;
// Turn contents of file into dictionary lookup.
var steamLibraryData = JsonAsDictionary(File.ReadAllText(libraryfoldersFile));
var steamLibraryIndex = 0;
while (true)
{
steamLibraryIndex++;
if (!steamLibraryData.TryGetValue(steamLibraryIndex.ToString(), out var steamLibraryPath)) return null;
var manifestFile = Path.Combine(steamLibraryPath, $"steamapps/appmanifest_{appId}.acf");
if (!File.Exists(manifestFile)) continue;
// Validate manifest is correct.
var game = GameDataFromAppManifest(manifestFile);
if (game.Id != appId) continue;
return game;
}
}

            var steamLibraryIndex = 0;
            while (true)
            {
                steamLibraryIndex++;
---             if (!steamLibraryData.TryGetValue(steamLibraryIndex.ToString(), out var steamLibraryPath)) return null;
+++             if (!steamLibraryData.TryGetValue("path", out var steamLibraryPath)) return null;
                var manifestFile = Path.Combine(steamLibraryPath, $"steamapps/appmanifest_{appId}.acf");
                if (!File.Exists(manifestFile)) continue;

                // Validate manifest is correct.
                var game = GameDataFromAppManifest(manifestFile);
                if (game.Id != appId) continue;

                return game;
            }
        }

This works fine if there is only one path. If there are more than one, it probably won't work ... Write directly.

---             if (!steamLibraryData.TryGetValue(steamLibraryIndex.ToString(), out var steamLibraryPath)) return null;
+++             var steamLibraryPath = "G:\\\\SteamLibrary"; // oof

Unhandled Exception: System.Exception: Steam game with id 892970 is not installed

I am getting this error when trying to build

ModTemplateValheim.csproj(65,9): error : 
ModTemplateValheim.csproj(65,9): error : Unhandled Exception: System.Exception: Steam game with id 892970 is not installed.
ModTemplateValheim.csproj(65,9): error :    at BuildTool.Steam.FindGame(UInt32 steamAppId) in D:\PL\valheim-tools\ModTemplateValheim\BuildTool\Steam.cs:line 34
ModTemplateValheim.csproj(65,9): error :    at BuildTool.Program.EnsureSteamGame(UInt32 steamAppId) in D:\PL\valheim-tools\ModTemplateValheim\BuildTool\Program.cs:line 161
ModTemplateValheim.csproj(65,9): error :    at BuildTool.Program.<>c.<Main>b__9_2() in D:\PL\valheim-tools\ModTemplateValheim\BuildTool\Program.cs:line 34
ModTemplateValheim.csproj(65,9): error :    at System.Threading.Tasks.Task`1.InnerInvoke()
ModTemplateValheim.csproj(65,9): error :    at System.Threading.Tasks.Task.Execute()
ModTemplateValheim.csproj(65,9): error : --- End of stack trace from previous location where exception was thrown ---
ModTemplateValheim.csproj(65,9): error :    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
ModTemplateValheim.csproj(65,9): error :    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
ModTemplateValheim.csproj(65,9): error :    at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
ModTemplateValheim.csproj(65,9): error :    at BuildTool.Program.<Main>d__9.MoveNext() in D:\PL\valheim-tools\ModTemplateValheim\BuildTool\Program.cs:line 34
ModTemplateValheim.csproj(65,9): error : --- End of stack trace from previous location where exception was thrown ---
ModTemplateValheim.csproj(65,9): error :    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
ModTemplateValheim.csproj(65,9): error :    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
ModTemplateValheim.csproj(65,9): error :    at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
ModTemplateValheim.csproj(65,9): error :    at BuildTool.Program.<Main>(String[] args)

You can see I have Valheim installed below
error

My development enviroment

.NET SDK
 Version:   5.0.103
 Commit:    72dec52dbd

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19041
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\5.0.103\

.NET SDKs installed:
  5.0.103 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

System.Xml.XmlNode.SelectSingleNode(...) returned null.

I am getting an error in this line of code

foreach (XmlElement elem in xDoc.DocumentElement.SelectSingleNode("/Project/PropertyGroup"))
System.NullReferenceException: 'Object reference not set to an instance of an object.'
System.Xml.XmlNode.SelectSingleNode(...) returned null.

Here is the game.props file generated after fixing #2

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <GameAppId>892970</GameAppId>
        <GameName>Valheim</GameName>
        <GameFolderName>Valheim\</GameFolderName>
        <GameDir>c:\program files (x86)\steam\steamapps\common\Valheim\</GameDir>
        <GameManagedDir>c:\program files (x86)\steam\steamapps\common\Valheim\valheim_Data\Managed\</GameManagedDir>
    </PropertyGroup>
</Project>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.