owml/docs/.m_cache/out_cache/guides/getting_started.html
2022-09-21 11:08:35 -04:00

4 lines
16 KiB
HTML

<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Getting Started - Outer Wilds Mod Loader</title><meta name="keywords" content><meta name="description" content="The mod loader and mod framework for outer wilds"><link rel="canonical" href="guides/getting_started.html"><meta property="og:type" content="website"><meta property="og:title" content="Getting Started - Outer Wilds Mod Loader"><meta property="og:description" content="The mod loader and mod framework for outer wilds"><meta property="og:url" content="guides/getting_started.html"><meta property="og:image" content="/"><meta property="og:image:alt" content="Logo"><meta name="twitter:title" content="Getting Started - Outer Wilds Mod Loader"><meta name="twitter:description" content="The mod loader and mod framework for outer wilds"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="/"><link rel="apple-touch-icon" sizes="57x57" href="/images/fav/apple-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/images/fav/apple-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/images/fav/apple-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/images/fav/apple-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="/images/fav/apple-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/images/fav/apple-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/images/fav/apple-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/images/fav/apple-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="/images/fav/apple-icon-180x180.png"><link rel="icon" type="image/png" sizes="192x192" href="/images/fav/android-icon-192x192.png"><link rel="icon" type="image/png" sizes="32x3 2" href="/images/fav/favicon-32x32.png"><link rel="icon" type="image/png" sizes="96x96" href="/images/fav/favicon-96x96.png"><link rel="icon" type="image/png" sizes="16x16" href="/images/fav/favicon-16x16.png"><link rel="manifest" href="/manifest.webmanifest"><meta name="msapplication-config" content="/browserconfig.xml"><meta name="msapplication-TileColor" content="#333333"><meta name="msapplication-TileImage" content="/images/fav/ms-icon-144x144.png"><meta name="theme-color" content="#333333"><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" crossorigin="anonymous" rel="stylesheet"><link rel="preload" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.1/font/bootstrap-icons.css"></noscript><script defer crossorigin="anonymous" src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script><script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script><link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.4.0/styles/default.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'"><noscript><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.4.0/styles/default.min.css"></noscript><script onload="$(document).ready(() => {hljs.highlightAll();});" defer src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script><script defer src="/base.min.js"></script></head><body class="vh-100 d-flex flex-column" style="overflow-x: hidden;" id="top" data-bs-spy="scroll" data-bs-target="#TableOfContents" data-bs-offset="65"><header><nav class="navbar navbar-expand-xl navbar-light bg-light sticky-top mb-3"><div class="container-fluid"><a class="navbar-brand" href="/index.html" aria-label="Home"> Outer Wilds Mod Loader</a><button class="navbar-toggler align-text-middle" type="button" data-bs-toggle="collapse" data-bs-target="#navbarMain" aria-controls="navbarMain" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="navbarMain"><ul class="navbar-nav me-auto mb-2 mb-lg-0"><li class="nav-item me-1"><a id="home-nav" href="/index.html" class="nav-link"> Home </a></li><li class="nav-item dropdown"><a class="nav-link dropdown-toggle active" aria-current="page" href="#" data-bs-toggle="dropdown" aria-expanded="false" id="Guides-group" role="button"> Guides </a><ul class="dropdown-menu" aria-labelledby="Guides-group"><li><a class="dropdown-item" href="/guides/getting_started.html"> Getting Started </a></li></ul></li></ul><hr class="d-xl-none"><ul class="navbar-nav ms-md-auto mb-2 mb-lg-0"><li class="nav-item me-2"><a class="nav-link p-2 fs-5" aria-label="Discord" target="_blank" rel="noopener" href="#"><i class="bi-discord"></i><small class="d-xl-none ms-2">Discord</small></a></li><li class="nav-item me-2"><a class="nav-link p-2 fs-5" aria-label="GitHub" target="_blank" rel="noopener" href="#"><i class="bi-github"></i><small class="d-xl-none ms-2">GitHub</small></a></li></ul></div></div></nav></header><div class="container-lg flex-grow-1"><main class="main"><div class="row g-6"><div class="col-lg-3"><nav id="TableOfContents" class="navbar navbar-light sticky-top flex-column align-items-stretch p-3" style="max-height: 100vh !important;overflow-x: hidden;overflow-y: auto;z-index: 999 !important;"><nav class="nav nav-pills flex-column"><strong class="nav-text pb-2">On This Page</strong><a id="getting-started-toc" class="nav-link toc-link px-1 mb-1" href="#getting-started" style="margin-left: 0.7rem;">Getting Started</a><nav class="nav nav-pills flex-column"><a id="choosing-an-ide-toc" class="nav-link toc-link px-1 mb-1" href="#choosing-an-ide" style="margin-left: 1.4rem;">Choosing an IDE</a><a id="installing-visual-studio-toc" class="nav-link toc-link px-1 mb-1" href="#installing-visual-studio" style="margin-left: 1.4rem;">Installing Visual Studio</a><a id="installing-the-template-toc" class="nav-link toc-link px-1 mb-1" href="#installing-the-template" style="margin-left: 1.4rem;">Installing the Template</a><a id="using-the-template-toc" class="nav-link toc-link px-1 mb-1" href="#using-the-template" style="margin-left: 1.4rem;">Using the Template</a><a id="general-mod-layout-toc" class="nav-link toc-link px-1 mb-1" href="#general-mod-layout" style="margin-left: 1.4rem;">General Mod Layout</a><nav class="nav nav-pills flex-column"><a id="manifestjson-toc" class="nav-link toc-link px-1 mb-1" href="#manifestjson" style="margin-left: 2.0999999999999996rem;">manifest.json</a><a id="yourprojectnamecs-toc" class="nav-link toc-link px-1 mb-1" href="#yourprojectnamecs" style="margin-left: 2.0999999999999996rem;">{YourProjectName}.cs</a><a id="default-configjson-toc" class="nav-link toc-link px-1 mb-1" href="#default-configjson" style="margin-left: 2.0999999999999996rem;">default-config.json</a><a id="yourprojectnamecsproj-toc" class="nav-link toc-link px-1 mb-1" href="#yourprojectnamecsproj" style="margin-left: 2.0999999999999996rem;">{YourProjectName}.csproj</a></nav><a id="viewing-the-c-file-toc" class="nav-link toc-link px-1 mb-1" href="#viewing-the-c-file" style="margin-left: 1.4rem;">Viewing The C# File</a><a id="building-the-mod-toc" class="nav-link toc-link px-1 mb-1" href="#building-the-mod" style="margin-left: 1.4rem;">Building The Mod</a><nav class="nav nav-pills flex-column"><a id="fixing-csprojuser-toc" class="nav-link toc-link px-1 mb-1" href="#fixing-csprojuser" style="margin-left: 2.0999999999999996rem;">Fixing .csproj.user</a></nav><a id="running-the-mod-toc" class="nav-link toc-link px-1 mb-1" href="#running-the-mod" style="margin-left: 1.4rem;">Running The Mod</a><a id="next-steps-toc" class="nav-link toc-link px-1 mb-1" href="#next-steps" style="margin-left: 1.4rem;">Next Steps</a></nav></nav></nav></div><hr class="d-lg-none mt-3"><div id="page-contents" class="col-lg-9"><h1 class="border-2 border-bottom border-dark pb-1 mb-1" id="getting-started">Getting Started</h1><p>This page will outline how to get a working mod that will simply log a message to the console when the game starts.</p><h2 class="border-1 border-bottom border-dark pb-1 mb-1" id="choosing-an-ide">Choosing an IDE</h2><p>An IDE will help`provide the ability to create, edit, and build your mod.</p><p>The recommended IDE for modding is <a href>Visual Studio</a>, however, stuff like Rider and VSCode can also work. This tutorial will assume you're using Visual Studio.</p><h2 class="border-1 border-bottom border-dark pb-1 mb-1" id="installing-visual-studio">Installing Visual Studio</h2><p>Head to the <a href>Visual Studio downloads page</a> and select community 2022, after downloading and launching the installer, follow instructions until you reach this screen:</p><p><img alt="TODO: Installer Image" class="img-fluid rounded mx-auto d-flex" src></p><p>We want the "Desktop development with .NET" module, this will provide us with the tools we need to build the mod.</p><p>After installing Visual Studio, launch it once an then close it, this will ensure certain files are generated.</p><h2 class="border-1 border-bottom border-dark pb-1 mb-1" id="installing-the-template">Installing the Template</h2><p>We provide a template to make creating mods easier, this template will handle renaming files and changing the manifest.</p><p>Open up the windows search box and search for "Developer Command Line for Visual Studio 2022", it should look like this:</p><p><img alt="TODO: DEV CMD" class="img-fluid rounded mx-auto d-flex" src></p><p>To install the template, run the following command:</p><pre class="position-relative"><button class="menagerie-copy-button btn btn-sm btn-outline-primary position-absolute" style="top: 5px; right: 5px;" aria-label="Copy"><i class="bi bi-clipboard2"></i></button><code class="language-sh">dotnet new --install Bwc9876.OuterWildsModTemplate
</code></pre><p>This will give an output similar to this:</p><pre class="position-relative"><button class="menagerie-copy-button btn btn-sm btn-outline-primary position-absolute" style="top: 5px; right: 5px;" aria-label="Copy"><i class="bi bi-clipboard2"></i></button><code>TODO: OUTPUT
</code></pre><p>Once installed, you can close the developer command prompt and re-open Visual Studio.</p><h2 class="border-1 border-bottom border-dark pb-1 mb-1" id="using-the-template">Using the Template</h2><p>Now that we have the template installed, open Visual Studio and select "New Project" from the welcome screen. Then search "Outer Wilds" and the template should appear in the list.</p><p>Set the project name to the name of your mod, <strong>please note this should NOT have spaces or special characters in it</strong>. The standard casing for projects is PascalCase, which involves capitalizing the start of every word and removing spaces.</p><p>On the next sreen, set author name to the name you want to appear in the manager and on the website, <strong>this should also not contain spaces</strong></p><p>Finally, click "Create Project"</p><h2 class="border-1 border-bottom border-dark pb-1 mb-1" id="general-mod-layout">General Mod Layout</h2><p>The general layout of an Outer Wilds mod is as follows:</p><h3 id="manifestjson">manifest.json</h3><p>This file contains metadata about your mod, such as its name, author, and version.</p><h3 id="yourprojectnamecs">{YourProjectName}.cs</h3><p>This file should have been renamed to your project name, it acts as the entry point for the mod.</p><h3 id="default-configjson">default-config.json</h3><p>This file is used by OWML to generate the settings menu for your mod, we'll go over it in <a href="#">another guide</a></p><h3 id="yourprojectnamecsproj">{YourProjectName}.csproj</h3><p>This file tell Visual Studio about your project, it determines stuff like dependencies and versions, you shouldn't need to touch this.</p><h2 class="border-1 border-bottom border-dark pb-1 mb-1" id="viewing-the-c-file">Viewing The C# File</h2><p>Double-click {YourProjectName}.cs, it should open up in the main editor pane.</p><p>This file should contain a class that has the same name as your project and some methods within that class.</p><p>We'll focus on <code>Start()</code>. In this method we do two things: </p><ol><li>We output a message to the console alerting the user that the mod has loaded</li><li>We subscribe to the scene loaded event in order to output a message to the log when the SolarSystem scene is loaded.</li></ol><p>You may have noticed we use the ModHelper field to achieve console output, ModHelper is a collecton of utilities your mod can use to do a variety of things. It will be covered more in a seperate guide.</p><h2 class="border-1 border-bottom border-dark pb-1 mb-1" id="building-the-mod">Building The Mod</h2><p>Now that we know what the mod <em>should</em> do, let's make sure it actually does it. Building your mod should be as simple as pressing "Solution -&gt; Build Solution" in the menu bar, if you get an error involving Visual Studio not being able to find a path, please see the section below, otherwise skip to "Running The Game"</p><h3 id="fixing-csprojuser">Fixing .csproj.user</h3><p>Your mod contains a special file called {YourProjectName}.csproj.user, this file tells Visual Studio where to build the mod to, if you've installed the manager in a non-standard loction, this file will be incorrect. To fix this, open the manager and select settings, then copy the path in the "OWML Path" field. Copy and paste this value between the <code>&lt;OutputPath&gt;</code> and <code>&lt;/OutputPath&gt;</code>, and add <code>\Mods</code> to the end of the path. Then open up your manifest file and copy the <code>uniqueName</code> field (don't include the quotes). Paste this value preceded by a <code>\</code> a the end of the path.</p><p>For example, if my mod's uniqueName is <code>Bwc9876.CoolMod</code>, my file would look like:</p><pre class="position-relative"><button class="menagerie-copy-button btn btn-sm btn-outline-primary position-absolute" style="top: 5px; right: 5px;" aria-label="Copy"><i class="bi bi-clipboard2"></i></button><code class="language-xml">&lt;OutputPath&gt;C:\MyCoolFolder\DifferentManagerInstallFolderBcImAHacker\Mods\Bwc9876.CoolMod&lt;/OutputPath&gt;
</code></pre><h2 class="border-1 border-bottom border-dark pb-1 mb-1" id="running-the-mod">Running The Mod</h2><p>Now the mod should have appeared in your mod manager at the very bottom, notice how the download count is a dash.</p><p>You mod should now be ready to run!</p><p>Click start game and wait for the title screen to load in. Now search your manager logs (there's a search box) for a message along the lines of "My mod {YourProjectName} is loaded!". This means your mod was loaded successfully! You can also try loading into the main game and checking the logs for another message from your mod.</p><h2 class="border-1 border-bottom border-dark pb-1 mb-1" id="next-steps">Next Steps</h2><p>You've successfully created and built your first Outer Wilds mod, moving forward may require a bit of knowledge in unity and will depend on what exactly you're trying to do. These guides will provide information on how to use various aspects of OWML, but it won't cover everything. If you ever need help, or even just want to chat about modding, feel free to <a href>join our Discord</a>. There's almost always someone available to help.</p></div></div></main></div><footer class="container-fluid w-100 mt-5 pt-4 pb-3 bg-light"><div class="row gy-3 text-center"><div class="col-md"><p class="p-0 m-0">Last Generated: 21/09/2022</p></div><div class="col-md"><a class="link-dark" href="#top">Back To Top</a></div><div class="col-md"><a class="link-dark" target="_blank" rel="noopener" href="https://github.com/Bwc9876/menagerie">Made With Menagerie</a></div></div></footer></body></html>