profectus-docs/guide/getting-started.html

22 lines
No EOL
16 KiB
HTML

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Getting Started | Profectus</title>
<meta name="description" content="A game engine that grows with you.">
<link rel="stylesheet" href="/assets/style.a9cb62af.css">
<link rel="modulepreload" href="/assets/app.82a3cbba.js">
<link rel="modulepreload" href="/assets/guide_getting-started.md.db5850b7.lean.js">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto+Mono">
<meta name="twitter:title" content="Getting Started | Profectus">
<meta property="og:title" content="Getting Started | Profectus">
</head>
<body>
<div id="app"><!--[--><div class="theme"><header class="nav-bar" data-v-40587210><div class="sidebar-button" data-v-40587210><svg class="icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z" class></path></svg></div><a class="nav-bar-title" href="/" aria-label="Profectus, back to home" data-v-40587210 data-v-016a8bd8><!----> Profectus</a><div class="flex-grow" data-v-40587210></div><div class="nav" data-v-40587210><nav class="nav-links" data-v-40587210 data-v-35b91e7e><!--[--><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item active" href="/guide/" data-v-49fe041d>Guide <!----></a></div></div><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item" href="/api/" data-v-49fe041d>API <!----></a></div></div><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item isExternal" href="https://forums.moddingtree.com" target="_blank" rel="noopener noreferrer" data-v-49fe041d>Forums <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-49fe041d><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item isExternal" href="https://discord.gg/F3xveHV" target="_blank" rel="noopener noreferrer" data-v-49fe041d>Discord <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-49fe041d><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item isExternal" href="https://github.com/profectus-engine/Profectus" target="_blank" rel="noopener noreferrer" data-v-49fe041d>Github <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-49fe041d><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><!--]--><!----><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item isExternal" href="https://github.com/profectus-engine/profectus-docs" target="_blank" rel="noopener noreferrer" data-v-49fe041d>GitHub <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-49fe041d><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div></nav></div><!--[--><!--]--></header><aside class="sidebar" data-v-17c48e2f><nav class="nav-links nav" data-v-17c48e2f data-v-35b91e7e><!--[--><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item active" href="/guide/" data-v-49fe041d>Guide <!----></a></div></div><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item" href="/api/" data-v-49fe041d>API <!----></a></div></div><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item isExternal" href="https://forums.moddingtree.com" target="_blank" rel="noopener noreferrer" data-v-49fe041d>Forums <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-49fe041d><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item isExternal" href="https://discord.gg/F3xveHV" target="_blank" rel="noopener noreferrer" data-v-49fe041d>Discord <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-49fe041d><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item isExternal" href="https://github.com/profectus-engine/Profectus" target="_blank" rel="noopener noreferrer" data-v-49fe041d>Github <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-49fe041d><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><!--]--><!----><div class="item" data-v-35b91e7e><div class="nav-link" data-v-35b91e7e data-v-49fe041d><a class="item isExternal" href="https://github.com/profectus-engine/profectus-docs" target="_blank" rel="noopener noreferrer" data-v-49fe041d>GitHub <svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-49fe041d><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div></nav><!--[--><!--]--><ul class="sidebar-links" data-v-17c48e2f><!--[--><li class="sidebar-link"><p class="sidebar-link-item">Guide</p><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="/guide/">Introduction</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item active" href="/guide/getting-started">Getting Started</a><ul class="sidebar-links"><li class="sidebar-link"><a class="sidebar-link-item" href="#setting-up-environment">Setting up environment</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#project-structure">Project structure</a><!----></li><li class="sidebar-link"><a class="sidebar-link-item" href="#deploying">Deploying</a><!----></li></ul></li></ul></li><li class="sidebar-link"><p class="sidebar-link-item">Creating Features</p><!----></li><!--]--></ul><!--[--><!--]--></aside><div class="sidebar-mask"></div><main class="page" data-v-8fcebc32><div class="container" data-v-8fcebc32><!--[--><!--]--><div style="position:relative;" class="content" data-v-8fcebc32><div><h1 id="getting-started" tabindex="-1">Getting Started <a class="header-anchor" href="#getting-started" aria-hidden="true">#</a></h1><h2 id="setting-up-environment" tabindex="-1">Setting up environment <a class="header-anchor" href="#setting-up-environment" aria-hidden="true">#</a></h2><h4 id="tools" tabindex="-1">Tools <a class="header-anchor" href="#tools" aria-hidden="true">#</a></h4><p>Profectus requires a node development environment in order to work on a project. If you are familiar with node, then you can skip this section.</p><p>If you are comfortable with/willing to use the command line, it is recommended to download the following:</p><ul><li><a href="https://git-scm.com/downloads" target="_blank" rel="noopener noreferrer">git</a></li><li><a href="https://nodejs.org/en/download/" target="_blank" rel="noopener noreferrer">node</a></li></ul><p>If you&#39;d like, you can also choose to use <a href="https://replit.com" target="_blank" rel="noopener noreferrer">replit</a> or <a href="https://glitch.com" target="_blank" rel="noopener noreferrer">glitch</a>, which has several pros and cons, but one of the pros is not needing to setup any tool on your own computer.</p><h4 id="creating-your-project" tabindex="-1">Creating your project <a class="header-anchor" href="#creating-your-project" aria-hidden="true">#</a></h4><p>If you are using git, you should create a new project from the <a href="https://github.com/profectus-engine/Profectus" target="_blank" rel="noopener noreferrer">Profectus repository</a> via the &quot;Use this template&quot; button. You can then copy the link for the repository to clone it locally.</p><div class="info custom-block"><p class="custom-block-title">INFO</p><p>Since the repository is a template repository, you can easily create multiple projects from one repository. However, it does make updating an existing project to a newer version of Profectus more difficult.</p></div><p>It&#39;s recommended to create a new git branch for development, so you can push your changes without it affecting the live build. This allows you to continue working with smaller commits, and only release new versions when you&#39;re actually ready to. The github workflow will automatically rebuild the page whenever you push to the <code>main</code> branch.</p><p>The next step is to install Profectus&#39; dependencies. This is as simple as running <code>npm install</code>.</p><h4 id="running-your-project" tabindex="-1">Running your project <a class="header-anchor" href="#running-your-project" aria-hidden="true">#</a></h4><p>You can now run <code>npm serve</code> to start a local server that will host your project so you can work on it. As you change files the site will automatically reload them.</p><h2 id="project-structure" tabindex="-1">Project structure <a class="header-anchor" href="#project-structure" aria-hidden="true">#</a></h2><p>At least to start, everything you&#39;ll be messing with is inside the <code>/src/data</code> directory. This contains everything specific to the project itself, from its metadata, the content itself, utility functions, a changelog, and any custom UI themes.</p><h4 id="setting-up-project-metadata" tabindex="-1">Setting up project metadata <a class="header-anchor" href="#setting-up-project-metadata" aria-hidden="true">#</a></h4><p>The first file you&#39;ll want to edit is <code>/src/data/modInfo.json</code>. This contains information on the name of the project, its creator, a discord server to link to, and some other general information about the project.</p><h4 id="creating-your-project-1" tabindex="-1">Creating your project <a class="header-anchor" href="#creating-your-project-1" aria-hidden="true">#</a></h4><p>Being actually creating your project content by editing <code>mod.tsx</code>.</p><h2 id="deploying" tabindex="-1">Deploying <a class="header-anchor" href="#deploying" aria-hidden="true">#</a></h2><p>If you&#39;re using git, deploying is as easy as pushing your changes to the <code>main</code> branch. In a couple minutes the site will be updated fully automatically. If you&#39;d like to see progress on it, or look at any errors that happened, you can do so from the actions tab on your repository.</p><p><img src="/assets/actionsbutton.f1ba9d8e.png" alt=""></p><p>Before github knows to actually host the generated site, you&#39;ll have to enable github pages in the repo settings. This just means selecting the branch to use - <code>gh-pages</code>. You will only need to perform this step once. This will automatically start another github action to deploy the website.</p><p><img src="/assets/gh-pages.a24cefcf.png" alt=""></p><p>Once the action completes, your project should be available at <code>https://&lt;YOUR_GITHUB_USERNAME&gt;.github.io/&lt;YOUR_REPO_NAME&gt;/</code>. For example, the TMT Demo project hosted at <a href="https://github.com/profectus-engine/TMT-Demo" target="_blank" rel="noopener noreferrer">https://github.com/profectus-engine/TMT-Demo</a> is available at <a href="https://profectus-engine.github.io/TMT-Demo/" target="_blank" rel="noopener noreferrer">https://profectus-engine.github.io/TMT-Demo/</a>.</p></div></div><footer class="page-footer" data-v-8fcebc32 data-v-b65b4b36><div class="edit" data-v-b65b4b36><div class="edit-link" data-v-b65b4b36 data-v-55695e90><a class="link" href="https://github.com/profectus-engine/profectus-docs/edit/main/guide/getting-started.md" target="_blank" rel="noopener noreferrer" data-v-55695e90>Edit this page on GitHub <svg class="icon outbound icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15" data-v-55695e90><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div></div><div class="updated" data-v-b65b4b36><!----></div></footer><div class="next-and-prev-link" data-v-8fcebc32 data-v-e65a9748><div class="container" data-v-e65a9748><div class="prev" data-v-e65a9748><a class="link" href="/guide/" data-v-e65a9748><svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" class="icon icon-prev" data-v-e65a9748><path d="M19,11H7.4l5.3-5.3c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0l-7,7c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.2-0.1,0.5,0,0.8c0.1,0.1,0.1,0.2,0.2,0.3l7,7c0.2,0.2,0.5,0.3,0.7,0.3s0.5-0.1,0.7-0.3c0.4-0.4,0.4-1,0-1.4L7.4,13H19c0.6,0,1-0.4,1-1S19.6,11,19,11z"></path></svg><span class="text" data-v-e65a9748>Introduction</span></a></div><div class="next" data-v-e65a9748><!----></div></div></div><!--[--><!--]--></div></main></div><!----><!--]--></div>
<script>__VP_HASH_MAP__ = JSON.parse("{\"guide_getting-started.md\":\"db5850b7\",\"guide_index.md\":\"eb7e742c\",\"index.md\":\"197c9aad\"}")</script>
<script type="module" async src="/assets/app.82a3cbba.js"></script>
</body>
</html>