#Easy to reach Player Log after crash

5 messages · Page 1 of 1 (latest)

hushed willow
#

To make life of the (mod) devs easier here on Discord it would be a nice feature to copy the Player log to a dedicated folder and open this after a crash.

If the Game can't open it immediately, it could raise a flag and open the folder at the next start (with a question whether the player wants or needs this).

hushed willow
#

If you want to reach the Player Log by the Unity Mod Kit in an easy way, do the following:

  • open the script Packages\com.channel3.foundrymodkit\Scripts\ModKitEditorWindow.cs
  • go to the line where it says if (GUILayout.Button("Launch Workshop Uploader"))
  • between the closing bracket below (}) and GUILayout.Space(10); enter the following code:
if (GUILayout.Button("Open Player Log..."))
{
    string playerLog = Path.Combine(
        Environment.GetFolderPath(
            Environment.SpecialFolder.UserProfile),
        "AppData", "LocalLow",
        "Channel 3 Entertainment\\Foundry\\Player.Log"
        );
    System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(playerLog));
}

If it looks like in the screenshot, save it and enjoy your new shortcut Foundry_BotLove1

hushed willow
#

If you use the Harmony Log class, you can directly access the created log with this code snippet (just append it to the code where you added the Player Log button):

if (GUILayout.Button("Open Harmony Log..."))
{
    string harmonyLog = Path.Combine(
        Environment.GetFolderPath(
            Environment.SpecialFolder.Desktop),
        "harmony.log.txt"
        );
    System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(harmonyLog));
}
hushed willow
#

Full files with some other neat additions:

  • Every mod now has a separate Quickstart button in the Mod Kit GUI
  • Global Quickstart button (remembers the last mod you built, even when closing the Unity Editor)