Update deps

This commit is contained in:
Ben C 2023-11-28 10:05:48 -05:00
parent e3f8ec505b
commit 8622b75b29
No known key found for this signature in database
16 changed files with 6954 additions and 4730 deletions

View File

@ -1,4 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}

View File

@ -1,11 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}

View File

@ -1,7 +1,6 @@
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import sitemap from "@astrojs/sitemap";
import { generateSchema } from "./src/schema_generator";
generateSchema("body_schema.json");

View File

@ -7,20 +7,21 @@
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
"astro": "astro",
"format": "prettier --write ."
},
"dependencies": {
"@astrojs/starlight": "^0.5.2",
"astro": "2.7.0",
"sharp": "^0.32.1"
"@astrojs/starlight": "^0.13.1",
"astro": "3.6.1",
"sharp": "^0.32.6"
},
"devDependencies": {
"@apidevtools/json-schema-ref-parser": "^10.1.0",
"eslint": "^8.45.0",
"eslint-plugin-prettier": "^5.0.0",
"fast-xml-parser": "^4.2.5",
"prettier": "^3.0.0",
"prettier-plugin-astro": "^0.11.0",
"@apidevtools/json-schema-ref-parser": "^11.1.0",
"eslint": "^8.54.0",
"eslint-plugin-prettier": "^5.0.1",
"fast-xml-parser": "^4.3.2",
"prettier": "^3.1.0",
"prettier-plugin-astro": "^0.12.2",
"xml-js": "^1.6.11"
}
}
}

11444
docs/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
import { defineCollection } from 'astro:content';
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
import { defineCollection } from "astro:content";
import { docsSchema, i18nSchema } from "@astrojs/starlight/schema";
export const collections = {
docs: defineCollection({ schema: docsSchema() }),
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
docs: defineCollection({ schema: docsSchema() }),
i18n: defineCollection({ type: "data", schema: i18nSchema() })
};

View File

@ -5,9 +5,9 @@ description: A guide to adding details to planets in New Horizons
For physical objects there are currently two ways of setting them up: specify an asset bundle and path to load a custom asset you created, or specify the path to the item you want to copy from the game in the scene hierarchy. Use the [Unity Explorer](https://outerwildsmods.com/mods/unityexplorer) mod to find an object you want to copy onto your new body. Some objects work better than others for this. Good luck. Some pointers:
- Use "Object Explorer" to search
- Generally you can find planets by writing their name with no spaces/punctuation followed by "\_Body".
- There's also [this community-maintained list of props](https://docs.google.com/spreadsheets/d/1VJaglB1kRL0VqaXhvXepIeymo93zqhWex-j7_QDm6NE/edit?usp=sharing) which you can use to find interesting props and check to see if they have collision.
- Use "Object Explorer" to search
- Generally you can find planets by writing their name with no spaces/punctuation followed by "\_Body".
- There's also [this community-maintained list of props](https://docs.google.com/spreadsheets/d/1VJaglB1kRL0VqaXhvXepIeymo93zqhWex-j7_QDm6NE/edit?usp=sharing) which you can use to find interesting props and check to see if they have collision.
## Using the Prop Placer

View File

@ -10,10 +10,10 @@ This guide assumes you've created your addon by following [the addon creation gu
Before you release anything, you'll want to make sure:
- Your mod has a descriptive `README.md`. (This will be shown on the website)
- Your repo has the description field (click the cog in the right column on the "Code" tab) set. (this will be shown in the manager)
- There's no `config.json` in your addon. (Not super important, but good practice)
- Your manifest has a valid name, author, and unique name.
- Your mod has a descriptive `README.md`. (This will be shown on the website)
- Your repo has the description field (click the cog in the right column on the "Code" tab) set. (this will be shown in the manager)
- There's no `config.json` in your addon. (Not super important, but good practice)
- Your manifest has a valid name, author, and unique name.
## Releasing

View File

@ -3,17 +3,17 @@ title: New Horizons
description: Create custom planets for Outer Wilds with New Horizons
template: splash
hero:
tagline: Create custom planets for Outer Wilds with New Horizons
image:
file: /src/assets/splash_hero_image.webp
alt: The New Horizons Logo
actions:
- text: Get Started
link: /start-here/getting-started
icon: right-arrow
variant: primary
- text: Schema Reference
link: /schemas/body_schema
tagline: Create custom planets for Outer Wilds with New Horizons
image:
file: /src/assets/splash_hero_image.webp
alt: The New Horizons Logo
actions:
- text: Get Started
link: /start-here/getting-started
icon: right-arrow
variant: primary
- text: Schema Reference
link: /schemas/body_schema
---
import { Card, CardGrid } from "@astrojs/starlight/components";
@ -25,22 +25,20 @@ by Mobius Digital.
## Features
<CardGrid stagger>
<Card title="Create Planets Through JSON" icon="document">
Use declarative JSON to create custom planets without having to write a line
of code.
</Card>
<Card title="Custom Star Systems" icon="star">
Create solar systems seperate from the base game's with its own planets,
vessel coordinates, and ship log.
</Card>
<Card title="API" icon="forward-slash">
Interface with various life cycle events and functions during star system
creation with New Horizon's API.
</Card>
<Card title="Extendable Configs" icon="puzzle">
Use the `extras` key in JSON files to allow extendable functionality with
other mods.
</Card>
<Card title="Create Planets Through JSON" icon="document">
Use declarative JSON to create custom planets without having to write a line of code.
</Card>
<Card title="Custom Star Systems" icon="star">
Create solar systems seperate from the base game's with its own planets, vessel coordinates,
and ship log.
</Card>
<Card title="API" icon="forward-slash">
Interface with various life cycle events and functions during star system creation with New
Horizon's API.
</Card>
<Card title="Extendable Configs" icon="puzzle">
Use the `extras` key in JSON files to allow extendable functionality with other mods.
</Card>
</CardGrid>
## Disclaimer

View File

@ -8,6 +8,7 @@ description: API reference for New Horizons
Put this in a C# file somewhere in your mod:
<!-- Auto update this would be cool -->
```cs
public interface INewHorizons
{

View File

@ -67,34 +67,34 @@ It has an object called Base, which has a groundSize of 100, and a surfaceSize o
Alright so now that we understand how the file is structures, let's look into what each value actually does:
- `name` simply sets the name of the planet
- `$schema` we'll get to in a second
- `starSystem` specifies what star system this planet is located in, in this case we're using the base game star system, so we put "SolarSystem"
- Then it has an object called `Base`
- Base has a `groundSize` of 100, this generates a perfect sphere that is 100 units in radius as the ground of our planet
- It also has a `surfaceSize` of 101, surface size is used in many calculations, it's generally good to set it to a bit bigger than ground size.
- `surfaceGravity` describes the strength of gravity on this planet, in this case it's 12 which is the same as Timber Hearth
- `hasMapMarker` tells new horizons that we want this planet to have a marker on the map screen
- Next it has another object called `Orbit`
- `semiMajorAxis` specifies the radius of the orbit (how far away the body is from its parent)
- `primaryBody` is set to `TIMBER_HEARTH``, this makes our planet orbit timber hearth
- `isMoon` simply tells the game how close you have to be to the planet in map mode before its name appears
- `isTidallyLocked` makes sure that one side of our planet is always facing timber hearth (the primary body)
- Finally, we have `Atmosphere`
- Its `size` is 150, this simply sets how far away from the planet our atmosphere stretches
- Its `fogTint` is set to a color which is an object with r, g, b, and a properties (properties is another word for keys)
- `fogSize` determines how far away the fog stretches from the planet
- `fogDensity` is simply how dense the fog is
- `hasRain` makes rainfall on the planet
- `name` simply sets the name of the planet
- `$schema` we'll get to in a second
- `starSystem` specifies what star system this planet is located in, in this case we're using the base game star system, so we put "SolarSystem"
- Then it has an object called `Base`
- Base has a `groundSize` of 100, this generates a perfect sphere that is 100 units in radius as the ground of our planet
- It also has a `surfaceSize` of 101, surface size is used in many calculations, it's generally good to set it to a bit bigger than ground size.
- `surfaceGravity` describes the strength of gravity on this planet, in this case it's 12 which is the same as Timber Hearth
- `hasMapMarker` tells new horizons that we want this planet to have a marker on the map screen
- Next it has another object called `Orbit`
- `semiMajorAxis` specifies the radius of the orbit (how far away the body is from its parent)
- `primaryBody` is set to `TIMBER_HEARTH``, this makes our planet orbit timber hearth
- `isMoon` simply tells the game how close you have to be to the planet in map mode before its name appears
- `isTidallyLocked` makes sure that one side of our planet is always facing timber hearth (the primary body)
- Finally, we have `Atmosphere`
- Its `size` is 150, this simply sets how far away from the planet our atmosphere stretches
- Its `fogTint` is set to a color which is an object with r, g, b, and a properties (properties is another word for keys)
- `fogSize` determines how far away the fog stretches from the planet
- `fogDensity` is simply how dense the fog is
- `hasRain` makes rainfall on the planet
#### What's a Schema?
That `$schema` property is a bit special, it instructs VSCode to use a pre-made schema to provide a better editing experience.
With the schema you get:
- Automatic descriptions for properties when hovering over keys
- Automatic error detection for incorrect data types or values
- Autocomplete, also called IntelliSense
- Automatic descriptions for properties when hovering over keys
- Automatic error detection for incorrect data types or values
- Autocomplete, also called IntelliSense
The schema we're using here is the [Celestial Body Schema](/schemas/body_schema), but there are many others available in the Schemas section of the left sidebar.
@ -104,8 +104,8 @@ With the new planet created (_and saved!_), launch the game through the mod mana
If you run into issues please make sure:
- You placed the JSON file in a folder called `planets` in the New Horizons mod folder
- There are no red or yellow squiggly lines in your file
- You placed the JSON file in a folder called `planets` in the New Horizons mod folder
- There are no red or yellow squiggly lines in your file
## Creating An Addon
@ -113,9 +113,9 @@ If you run into issues please make sure:
To get started, you'll need to fork the [the New Horizons addon template](https://github.com/xen-42/ow-new-horizons-config-template)
- Set the Name to your username followed by a dot (`.`), followed by your mod's name in PascalCase (no spaces, new words have capital letters). So for example if my username was "Test" and my mod's name was "Really Cool Addon", I would name the repo `Test.ReallyCoolAddon`.
- The description is what will appear in the mod manager under the mod's name, you can always edit this later
- You can set the visibility to what you want; But when you go to publish your mod, it will need to be public
- Set the Name to your username followed by a dot (`.`), followed by your mod's name in PascalCase (no spaces, new words have capital letters). So for example if my username was "Test" and my mod's name was "Really Cool Addon", I would name the repo `Test.ReallyCoolAddon`.
- The description is what will appear in the mod manager under the mod's name, you can always edit this later
- You can set the visibility to what you want; But when you go to publish your mod, it will need to be public
### Open The Project
@ -123,16 +123,16 @@ Now clone the repository to your local computer and open it in your favorite edi
### Project Layout
- .github: This folder contains special files for use on GitHub, they aren't useful right now but will be when we go to publish the mod
- planets: This folder contains a single example config file that destroys the Quantum Moon, we'll keep it for now so we can test our addon later.
- .gitattributes: This is another file that will be useful when publishing
- default-config.json: This file is used in C#-based mods to allow a custom options menu, New Horizons doesn't support a custom options menu, but we still need the file here in order for the addon to work.
- manifest.json: This is the first file we're going to edit, we need to fill it out with information about our mod
- First you're going to set `author` to your author name, this should be the same name that you used when creating the GitHub repo.
- Next, set `name` to the name you want to appear in the mod manager and website.
- Now set `uniqueName` to the name of your GitHub Repo.
- You can leave `version`, `owmlVersion`, and `dependencies` alone
- NewHorizonsConfig.dll: This is the heart of your addon, make sure to never move or rename it.
- .github: This folder contains special files for use on GitHub, they aren't useful right now but will be when we go to publish the mod
- planets: This folder contains a single example config file that destroys the Quantum Moon, we'll keep it for now so we can test our addon later.
- .gitattributes: This is another file that will be useful when publishing
- default-config.json: This file is used in C#-based mods to allow a custom options menu, New Horizons doesn't support a custom options menu, but we still need the file here in order for the addon to work.
- manifest.json: This is the first file we're going to edit, we need to fill it out with information about our mod
- First you're going to set `author` to your author name, this should be the same name that you used when creating the GitHub repo.
- Next, set `name` to the name you want to appear in the mod manager and website.
- Now set `uniqueName` to the name of your GitHub Repo.
- You can leave `version`, `owmlVersion`, and `dependencies` alone
- NewHorizonsConfig.dll: This is the heart of your addon, make sure to never move or rename it.
### Testing The Addon

View File

@ -13,7 +13,7 @@ You may also notice blue and yellow logs start appearing in your console, this i
There are two templates for New Horizons addons.
The [New Horizons Addon Template](https://github.com/xen-42/ow-new-horizons-config-template) is used for addons that **don't use custom code**,
this is ideal for simple projects and people just starting out.
this is ideal for simple projects and people just starting out.
The [Outer Wilds Mod Template](https://github.com/ow-mods/ow-mod-template) is used for mods that use custom code,
**you must enable "Use New Horizons" in order for it to work with New Horizons**.
@ -31,17 +31,17 @@ rectangular-to-polar coordinate transformation, useful for fixing abnormalities
These mods are useful when developing your addon
- [Unity Explorer](https://outerwildsmods.com/mods/unityexplorer) - Used to find the paths of game objects for copying and can be used to manually position props, ship log entries, and more.
- [Collider Visualizer](https://outerwildsmods.com/mods/collidervisualizer) - Useful when creating dialogue triggers or reveal volumes.
- [Save Editor](https://outerwildsmods.com/mods/saveeditor) - Useful when creating a custom [ship log](/ship-log), can be used to reveal all custom facts so you can see them in the ship's computer.
- [Time Saver](https://outerwildsmods.com/mods/timesaver/) - Lets you skip some repeated cutscenes and get into the game faster.
- [Unity Explorer](https://outerwildsmods.com/mods/unityexplorer) - Used to find the paths of game objects for copying and can be used to manually position props, ship log entries, and more.
- [Collider Visualizer](https://outerwildsmods.com/mods/collidervisualizer) - Useful when creating dialogue triggers or reveal volumes.
- [Save Editor](https://outerwildsmods.com/mods/saveeditor) - Useful when creating a custom [ship log](/ship-log), can be used to reveal all custom facts so you can see them in the ship's computer.
- [Time Saver](https://outerwildsmods.com/mods/timesaver/) - Lets you skip some repeated cutscenes and get into the game faster.
## Helpful Tools
These tools/references are highly recommended
- [VSCode](https://code.visualstudio.com/)
- [VSCode XML Addon](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml)
- [XML Basics Tutorial](https://www.w3schools.com/xml/xml_whatis.asp)
- [JSON Basics Tutorial](https://www.tutorialspoint.com/json/index.htm)
- [The Examples Mod](https://github.com/xen-42/ow-new-horizons-examples)
- [VSCode](https://code.visualstudio.com/)
- [VSCode XML Addon](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml)
- [XML Basics Tutorial](https://www.w3schools.com/xml/xml_whatis.asp)
- [JSON Basics Tutorial](https://www.tutorialspoint.com/json/index.htm)
- [The Examples Mod](https://github.com/xen-42/ow-new-horizons-examples)

2
docs/src/env.d.ts vendored
View File

@ -1,2 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client-image" />
/// <reference types="astro/client" />

View File

@ -1,19 +1,17 @@
import { Schema, SchemaTools } from "./schema_utils";
import * as fs from "node:fs";
const addFrontmatter = (content: string, frontmatter: Record<string, boolean | string>) => {
const entries = Object.entries(frontmatter).map(([key, value]) => `${key}: ${value}`)
const entries = Object.entries(frontmatter).map(([key, value]) => `${key}: ${value}`);
if (entries.length === 0) {
return content
return content;
}
return `---\n${entries.join('\n')}\n---\n\n${content}`
}
return `---\n${entries.join("\n")}\n---\n\n${content}`;
};
export const generateSchema = (fileName: string) => {
const schema = SchemaTools.readSchema(fileName);
const dir = `src/content/docs/schemas/${schema.slug}`;
@ -28,8 +26,7 @@ export const generateSchema = (fileName: string) => {
editUrl: false
};
const content = `import Schema from "/src/components/Schemas/Schema.astro";\n\n<Schema fileName="${schema.fileName}" />\n`
fs.writeFileSync(`${dir}/index.mdx`, addFrontmatter(content, frontMatter))
const content = `import Schema from "/src/components/Schemas/Schema.astro";\n\n<Schema fileName="${schema.fileName}" />\n`;
fs.writeFileSync(`${dir}/index.mdx`, addFrontmatter(content, frontMatter));
};

View File

@ -167,7 +167,7 @@ export const SchemaTools = {
type: "JSON",
val: { title: key, ...val }
}
} as Schema)
}) as Schema
);
case "XML":
let node = schema.internalSchema.val;
@ -190,7 +190,7 @@ export const SchemaTools = {
type: "XML",
val: d
}
} as Schema)
}) as Schema
);
} else {
return [];

View File

@ -1,3 +1,3 @@
{
"extends": "astro/tsconfigs/strict"
}
"extends": "astro/tsconfigs/strict"
}