Skip to content

Commit

Permalink
Merge pull request #57 from Sapiens-OSS/maintenance
Browse files Browse the repository at this point in the history
Bring wiki up-to-speed
  • Loading branch information
DecDuck authored May 10, 2024
2 parents 19a7130 + 045ad2a commit c84287d
Show file tree
Hide file tree
Showing 48 changed files with 855 additions and 868 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
with:
branch: wiki
folder: docs/.vitepress/dist
- name: Index 🔍
uses: darrenjennings/algolia-docsearch-action@master
with:
algolia_application_id: 'QS6BR6DKN3'
algolia_api_key: ${{ secrets.algoliaSecret }}
file: 'algolia.json'
# - name: Index 🔍
# uses: darrenjennings/algolia-docsearch-action@master
# with:
# algolia_application_id: 'QS6BR6DKN3'
# algolia_api_key: ${{ secrets.algoliaSecret }}
# file: 'algolia.json'
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Sapiens Modding Wiki

This repository contains a static site which provides modding documentation for the [Sapiens video game.](https://www.playsapiens.com/).
This repository contains a static site which provides modding documentation for the [Sapiens video game](https://www.playsapiens.com/).

🚀 [View the website.](https://wiki.sapiens.dev/) 🚀
🚀 [View the website](https://wiki.sapiens.dev/) 🚀

## Contributing

Expand Down
125 changes: 0 additions & 125 deletions docs/.vitepress/config.js

This file was deleted.

163 changes: 163 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
import { defineConfig } from 'vitepress'

export default defineConfig({
head: [
["link", { rel: "stylesheet", href: "/index.css" }],
["link", { rel: "icon", href: "/favicon.ico" }],
],
lang: "en-US",
title: "Unofficial Sapiens Modding Wiki",
description: "Modding documentation for the Sapiens video game.",
lastUpdated: true,
sitemap: {
hostname: "https://wiki.sapiens.dev"
},
themeConfig: {
search: {
provider: 'local'
},
nav: [
{ text: "Sapiens Website", link: "https://www.playsapiens.com/" },
{ text: "Sapiens Wiki", link: "https://wiki.playsapiens.com/" },
{
text: "Official Sapiens Modding Wiki",
link: "https://github.com/Majic-Jungle/sapiens-mod-creation/wiki",
},
],
socialLinks: [
{
icon: "github",
link: "https://github.com/Sapiens-OSS/sapiens-modding-wiki",
},
{ icon: "discord", link: "https://discord.gg/WnN8hj2Fyg" },
],
sidebar: [
{
text: "Guides",
items: [
{
text: "Getting Started", items: [
{
text: "Visual Studio Code",
link: "/guide/vscode-getting-started",
},
{
text: "Lua",
link: "/guide/lua-getting-started",
},
{ text: "C/C++", link: "/guide/c-getting-started" },

]
},
{ text: "Using Lua Shadows", link: "/guide/shadowing" },
],
},
{
text: "Documentation",
items: [
{
text: "Engine Fundamentals",
items: [
{ text: "Mod Types", link: "/docs/engine/mod-types" },
{ text: "Coordinates", link: "/docs/engine/coordinates" },
{
text: "Threads",
link: "/docs/engine/threads",
},
{ text: "Bridges", link: "/docs/engine/bridges" },

]
},
{
text: "Models",
items: [
{ text: "Materials", link: "/docs/models/materials" },
{ text: "Model Format", link: "/docs/models/model-format" },
],
},
{
text: "Visuals",
items: [
{ text: "Shaders", link: "/docs/visuals/shaders" },
{ text: "User Interface (UI)", link: "/docs/visuals/user-interface" },
]
},
{
text: "Scripts",
items: [
{ text: "Dev Tools", link: "/docs/scripting/cheat" },
{ text: "Game Saves", link: "/docs/scripting/game-saves" },
{ text: "Input", link: "/docs/scripting/input" },
{ text: "Timers", link: "/docs/scripting/timers" },
{ text: "World Generation", link: "/docs/scripting/worldgen" },
{ text: "Object Sets", link: "/docs/scripting/object-sets" }
],
},
{
text: "Miscellaneous",
items: [
{ text: "Abbreviations", link: "/docs/misc/abbrev" },
{ text: "Common Issues", link: "/docs/misc/common-issues" },
{ text: "Other Notes", link: "/docs/misc/notes" },
],
},
],
},
{
text: "Hammerstone",
items: [
{ text: "Introduction", link: "/hammerstone/introduction" },
{ text: "Getting Started", link: "/hammerstone/getting-started" },
{
text: "Utilities",
items: [
{ text: "Shadowing", link: "/hammerstone/utilities/shadowing" },
{ text: "Logger", link: "/hammerstone/utilities/logger" }
]
},
{
text: "Systems",
items: [
{ text: "UI Manager", link: "/hammerstone/systems/ui-manager" },
{ text: "Input Manager", link: "/hammerstone/systems/input-manager" },
{ text: "Save State", link: "/hammerstone/systems/save-state" },
]
},
{ text: "Patching", link: "/hammerstone/patching" },
{
text: "DDAPI",
collapsible: true,
items: [
{
text: "Getting Started",
link: "/hammerstone/ddapi/ddapi-getting-started",
},
{ text: "Objects", link: "/hammerstone/ddapi/ddapi-objects" },
{ text: "Remaps", link: "/hammerstone/ddapi/ddapi-remaps" },
{
text: "Troubleshooting",
link: "/hammerstone/ddapi/ddapi-troubleshooting",
},
],
},
],
},
{
text: "Tutorials",
items: [
{
text: "Craftable object in Lua",
link: "/tutorials/creating-craftable-objects",
},
],
},
],
logo: "/logo.png",
siteTitle: "Sapiens Modding Wiki",
footer: {
message: "Created with ♥ by the Sapiens Modding Community"
},
},
plugins: [],
markdown: {},
});
21 changes: 21 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import DefaultTheme from 'vitepress/theme';
import 'viewerjs/dist/viewer.min.css';
import imageViewer from 'vitepress-plugin-image-viewer';
import vImageViewer from 'vitepress-plugin-image-viewer/lib/vImageViewer.vue';
import { useRoute } from 'vitepress';

export default {
...DefaultTheme,
enhanceApp(ctx) {
DefaultTheme.enhanceApp(ctx);
// Register global components, if you don't want to use it, you don't need to add it
ctx.app.component('img', vImageViewer);
// ...
},
setup() {
// Get route
const route = useRoute();
// Using
imageViewer(route, '.vp-doc', {title: true});
}
};
File renamed without changes.
File renamed without changes.
8 changes: 3 additions & 5 deletions docs/docs/scripting/bridge.md → docs/docs/engine/bridges.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Engine Bridges

In Sapiens, many lua classes contain a method called `setBridge` that take a `bridge` parameter. This parameter directly maps to a C++ class inside of the games source code. Every bridge parameter is also unique: No two lua scripts are initialized with the same bridge object.
In Sapiens, many lua classes contain a method called `setBridge` that take a `bridge` parameter. This parameter directly maps to a C++ class inside of the game's source code. Every bridge parameter is also unique: no two Lua scripts are initialized with the same bridge object.

Because every `bridge` parameter is called `bridge`, and points to C++ code, there isn't any good way of knowing which methods or attributes are available. You should check out the lua source for the class you are using, and look for the methods and attributes you need.
Because every `bridge` parameter is called `bridge`, and points to C++ code, there isn't any good way of knowing which methods or attributes are available. You should check out the Lua source for the class you are using, and look for the methods and attributes you need.

## Example

Expand All @@ -12,6 +12,4 @@ This bridge maps to a "server" C++ class, which contains various methods, includ
- `bridge:callClientFunction`
- `bridge:callClientFunctionForAllClients`
- `bridge:getSpawnPos`
- ...


- ...
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

In Sapiens, there are three coordinate systems: The first is used during world generation (pre-render), the second is used for rendering (render), and the third is used during normal gameplay (meters).

## Prerender Scale
## Pre-render Scale

The world is a unit sphere, where sea level is `1.0` radius. The north pole is `0.0, 1.0, 00`. In pre-render, the coordinates are just 3D positions in that space.

## Render Scale

The render scale is similar to pre-render, except that it's `100,000` times larger. The significance of this scale is unknown.
The render scale is similar to pre-render, except that it's **100,000** times larger.

Alongside having it's own scale, the render coordinate systems is relative to a shifting origin point. This prevents floating point insanity, no matter where you are on such a large planet.

Expand All @@ -18,7 +18,7 @@ The meter scale is used during normal gameplay. Each side of a hex in sapiens is

## Conversions and Constants

The `mj` module contains a few methods for converting back and forth between the three coordinate systems. Here is a cleaned up version of the code:
The `mj` global module contains a few methods for converting back and forth between the three coordinate systems. Here is a simplified version of the code:

```lua

Expand Down
Loading

0 comments on commit c84287d

Please sign in to comment.