diff --git a/NewHorizons/Builder/Atmosphere/VolumesBuilder.cs b/NewHorizons/Builder/Atmosphere/VolumesBuilder.cs index 01445351..ac924555 100644 --- a/NewHorizons/Builder/Atmosphere/VolumesBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/VolumesBuilder.cs @@ -31,6 +31,7 @@ namespace NewHorizons.Builder.Atmosphere PlanetoidRuleset PR = rulesetGO.AddComponent(); PR._altitudeFloor = innerRadius; PR._altitudeCeiling = sphereOfInfluence; + PR._shuttleLandingRadius = sphereOfInfluence; PR._useMinimap = config.Base.showMinimap; PR._useAltimeter = config.Base.showMinimap; diff --git a/NewHorizons/Builder/General/GroupsBuilder.cs b/NewHorizons/Builder/General/GroupsBuilder.cs new file mode 100644 index 00000000..e37e7eab --- /dev/null +++ b/NewHorizons/Builder/General/GroupsBuilder.cs @@ -0,0 +1,29 @@ +using UnityEngine; +using Logger = NewHorizons.Utility.Logger; + +namespace NewHorizons.Builder.General; + +public static class GroupsBuilder +{ + /// + /// puts groups on an object, activated by sector. + /// run this before the gameobject is active. + /// + public static void Make(GameObject go, Sector sector) + { + if (!sector) + { + Logger.LogWarning($"tried to put groups on {go.name} when sector is null"); + return; + } + if (go.activeInHierarchy) + { + Logger.LogWarning($"tried to put groups on an active gameobject {go.name}"); + return; + } + + go.GetAddComponent()._sector = sector; + go.GetAddComponent()._sector = sector; + go.GetAddComponent()._sector = sector; + } +} \ No newline at end of file diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index ae7a63f7..25e22eb2 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -1,3 +1,4 @@ +using NewHorizons.Builder.General; using NewHorizons.External.Configs; using NewHorizons.External.Modules; using NewHorizons.Handlers; @@ -100,6 +101,7 @@ namespace NewHorizons.Builder.Props prop.transform.localScale = detail.scale != 0 ? Vector3.one * detail.scale : prefab.transform.localScale; + if (!detail.keepLoaded) GroupsBuilder.Make(prop, sector); prop.SetActive(true); if (prop == null) return null; diff --git a/NewHorizons/Builder/Props/ScatterBuilder.cs b/NewHorizons/Builder/Props/ScatterBuilder.cs index 26af9d33..3ce71605 100644 --- a/NewHorizons/Builder/Props/ScatterBuilder.cs +++ b/NewHorizons/Builder/Props/ScatterBuilder.cs @@ -96,6 +96,7 @@ namespace NewHorizons.Builder.Props { position = point.normalized * height, scale = propInfo.scale, + keepLoaded = propInfo.keepLoaded, alignToNormal = true }; var prop = DetailBuilder.Make(go, sector, prefab, detailInfo); diff --git a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs index b377bf51..12e55581 100644 --- a/NewHorizons/Builder/ShipLog/MapModeBuilder.cs +++ b/NewHorizons/Builder/ShipLog/MapModeBuilder.cs @@ -219,7 +219,7 @@ namespace NewHorizons.Builder.ShipLog foreach (NewHorizonsBody body in bodies) { - if (body.Config.ShipLog?.mapMode?.manualNavigationPosition == null) continue; + if (body.Config.ShipLog?.mapMode?.manualNavigationPosition == null && body.Config.ShipLog?.mapMode?.details == null) continue; // Sometimes they got other names idk var name = body.Config.name.Replace(" ", ""); @@ -283,6 +283,7 @@ namespace NewHorizons.Builder.ShipLog { gameObject.transform.localScale = Vector3.one * body.Config.ShipLog.mapMode.scale; } + MakeDetails(body, gameObject.transform, greyScaleMaterial); } } } diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 932b1bc0..b02f762d 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -139,6 +139,11 @@ namespace NewHorizons.External.Modules /// The highest height that these objects will be placed at (only relevant if there's a heightmap) /// public float? maxHeight; + + /// + /// Should this detail stay loaded even if you're outside the sector (good for very large props) + /// + public bool keepLoaded; } [JsonObject] diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 1c26dcaa..7ab5dba5 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -608,10 +608,22 @@ namespace NewHorizons } var folder = mod.ModHelper.Manifest.ModFolderPath; + var systemsFolder = Path.Combine(folder, "systems"); + var planetsFolder = Path.Combine(folder, "planets"); + // Load systems first so that when we load bodies later we can check for missing ones - if (Directory.Exists(folder + @"systems\")) + if (Directory.Exists(systemsFolder)) { - foreach (var file in Directory.GetFiles(folder + @"systems\", "*.json?", SearchOption.AllDirectories)) + var systemFiles = Directory.GetFiles(systemsFolder, "*.json", SearchOption.AllDirectories) + .Concat(Directory.GetFiles(systemsFolder, "*.jsonc", SearchOption.AllDirectories)) + .ToArray(); + + if(systemFiles.Length == 0) + { + Logger.LogVerbose($"Found no JSON files in systems folder: {systemsFolder}"); + } + + foreach (var file in systemFiles) { var name = Path.GetFileNameWithoutExtension(file); @@ -644,9 +656,18 @@ namespace NewHorizons } } } - if (Directory.Exists(folder + "planets")) + if (Directory.Exists(planetsFolder)) { - foreach (var file in Directory.GetFiles(folder + @"planets\", "*.json?", SearchOption.AllDirectories)) + var planetFiles = Directory.GetFiles(planetsFolder, "*.json", SearchOption.AllDirectories) + .Concat(Directory.GetFiles(planetsFolder, "*.jsonc", SearchOption.AllDirectories)) + .ToArray(); + + if(planetFiles.Length == 0) + { + Logger.LogVerbose($"Found no JSON files in planets folder: {planetsFolder}"); + } + + foreach (var file in planetFiles) { var relativeDirectory = file.Replace(folder, ""); var body = LoadConfig(mod, relativeDirectory); diff --git a/NewHorizons/Patches/CharacterDialogueTreePatches.cs b/NewHorizons/Patches/CharacterDialogueTreePatches.cs new file mode 100644 index 00000000..6493eba1 --- /dev/null +++ b/NewHorizons/Patches/CharacterDialogueTreePatches.cs @@ -0,0 +1,21 @@ +using HarmonyLib; + +namespace NewHorizons.Patches; + +[HarmonyPatch] +internal class CharacterDialogueTreePatches +{ + [HarmonyPrefix] + [HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.Awake))] + private static void CharacterDialogueTree_Awake(CharacterDialogueTree __instance) + { + GlobalMessenger.AddListener("AttachPlayerToPoint", (_) => __instance.EndConversation()); + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(CharacterDialogueTree), nameof(CharacterDialogueTree.OnDestroy))] + private static void CharacterDialogueTree_OnDestroy(CharacterDialogueTree __instance) + { + GlobalMessenger.RemoveListener("AttachPlayerToPoint", (_) => __instance.EndConversation()); + } +} diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 18185e87..9a5b05f9 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1391,6 +1391,10 @@ ], "description": "The highest height that these objects will be placed at (only relevant if there's a heightmap)", "format": "float" + }, + "keepLoaded": { + "type": "boolean", + "description": "Should this detail stay loaded even if you're outside the sector (good for very large props)" } } }, diff --git a/docs/content/pages/editor.md b/docs/content/pages/editor.md new file mode 100644 index 00000000..fd314789 --- /dev/null +++ b/docs/content/pages/editor.md @@ -0,0 +1,65 @@ +--- +Title: Config Editor +Sort_Priority: 50 +--- + +# Config Editor + +Are you tired of manually editing JSON? Do you want richer validation than a JSON schema? Well then the config editor may be for you! + +This page outlines how to install and use the config editor. + +## Installation + +To get started, head over to the [releases page for the editor](https://github.com/Outer-Wilds-New-Horizons/nh-config-editor/releases/latest) and install the file for your OS: + +- Windows: The .msi file (not the .msi.zip and .msi.zip.sig file) +- MacOS: The .AppImage file (not the .AppImage.tar.gz or the .AppImage.tar.gz.sig file) + +Follow the installer instructions to complete setup + +## Creating a New Project + +Creating a new project is as simple as clicking the button. +Fill out the form with thr info for your mod and a new project will be made at the specified path. + +## Editing Files + +To edit a file, navigate to it in the left panel and click on it. + +### JSON files + +JSON files (planets, systems, etc) have a graphical interface for editing, **this will clear comments!** + +If you don't want comments to be cleared, use the text editor + +#### Using the Text Editor + +Already familiar with JSON and prefer text-based editing? Simply open up settings (File -> Settings) and turn on the "Always use Text Editor" option. + +### Image and Audio Files + +You can view images and play audio files with this editor. + +### XML Files + +Right now, XML support is limited. You'll get syntax highlighting but no error checking or autofill. + + +## Running the Game + +You can start the game from the editor by selecting Project -> Run Project this will open a new window where you can run the game + +### Log Port + +If you're using the mod manager and would like logs to appear there, you need to get the log port from the console, it's always the first entry in the logs. Keep in mind this port changes whenever you restart the manager. + +![Get the log port]({{ "images/editor/log_port.webp"|static }}) + + +## Building + +The editor also provides a system for building your mod to a zip file, which can then be uploaded to GitHub in a release. To do this, press Project -> Build (Release) + + + diff --git a/docs/content/pages/home.md b/docs/content/pages/home.md index 06196020..6fc7c70e 100644 --- a/docs/content/pages/home.md +++ b/docs/content/pages/home.md @@ -8,118 +8,11 @@ Sort_Priority: 100 # Outer Wilds New Horizons -This is the official documentation for [New Horizons](https://github.com/xen-42/outer-wilds-new-horizons), a framework for creating custom planets in the game [Outer Wilds](https://www.mobiusdigitalgames.com/outer-wilds.html) by Mobius Digital. Planets are created using simple JSON and XML files and are loaded at runtime. An [API]({{ "API"|route }}) is also provided for more advanced use-cases. +This is the official documentation for [New Horizons](https://github.com/xen-42/outer-wilds-new-horizons), a framework for creating custom planets in the game [Outer Wilds](https://www.mobiusdigitalgames.com/outer-wilds.html) by Mobius Digital. Planets are created using simple JSON and XML files and are loaded at runtime. An [API]({{ "API"|route }}) is also provided for more advanced use-cases. ## Getting Started -Before starting, go into your in-game mod settings for New Horizons and switch Debug mode on. This allows you to: - -- Use the [Prop Placer tool]({{ "detailing"|route }}#using-the-prop-placer). This convienence tool allows you to place details in game and save your work to your config files. -- Print the position of what you are looking at to the logs by pressing "P". This is useful for determining locations to place props the Prop Placer is unable to, such as signal scope points or dialogue triggers. -- Use the "Reload Configs" button in the pause menu. This will restart the current solar system and update all the planets. Much faster than quitting and relaunching the game. - -!!! alert-danger "Get VSCode" - Please get [VSCode](https://code.visualstudio.com/){ target="_blank" } or some other advanced text editor, as it will help highlight common errors. - -Planets are created using a JSON file format structure, and placed in a folder called planets (or in any subdirectory of it) in the location where New Horizons is installed (by default this folder doesn't exist, you have to create it within the xen.NewHorizons directory). You can learn how the configs work by picking apart the [Real Solar System](https://github.com/xen-42/outer-wilds-real-solar-system){ target="_blank" } mod or the [New Horizons Examples](https://github.com/xen-42/ow-new-horizons-examples){ target="_blank" } mod. - -To locate this directory, click the "⋮" symbol next to "New Horizons" in the Outer Wilds Mod Manager and then click " -show in explorer" in the pop-up. - -![Click the three dots in the mod manager]({{ "images/home/mod_manager_dots.webp"|static }}) - -![Create a new folder named "planets"]({{ "images/home/create_planets.webp"|static }}) - -Planets can also be placed in a folder called planets within a separate mod, if you plan on releasing your planets on the mod database. The [Config Template](https://github.com/xen-42/ow-new-horizons-config-template){ target="_blank" } is available if you want to release your own planet mod using configs. - -Now that you have created your planets folder, this is where you will put your planet config files. A config file will -look something like this: - -```json -{ - "name": "Wetrock", - "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json", - "starSystem": "SolarSystem", - "Base": { - "groundSize": 100, - "surfaceSize": 101, - "surfaceGravity": 12, - "hasMapMarker": true - }, - "Orbit": { - "semiMajorAxis": 1300, - "inclination": 0, - "primaryBody": "TIMBER_HEARTH", - "isMoon": true, - "isTidallyLocked": true, - "longitudeOfAscendingNode": 0, - "eccentricity": 0, - "argumentOfPeriapsis": 0 - }, - "Atmosphere": { - "size": 150, - "fogTint": { - "r": 200, - "g": 255, - "b": 255, - "a": 255 - }, - "fogSize": 150, - "fogDensity": 0.2, - "hasRain": true - }, - "Props": { - "scatter": [ - { - "path": "DreamWorld_Body/Sector_DreamWorld/Sector_DreamZone_1/Props_DreamZone_1/OtherComponentsGroup/Trees_Z1/DreamHouseIsland/Tree_DW_M_Var", - "count": 12 - } - ] - } -} -``` - -The first field you should have in any config file is the `name`. This should be unique in the solar system. If it -isn't, the mod will instead try to modify the planet that already has that name. - -After `name` is `starSystem`. You can use this to place the planet in a different system accessible using a black-hole or via the ship's warp drive (accessible from the ship log computer). To ensure compatibility with other mods this name should be unique. After setting a value for this, the changes in the config will only affect that body in that star system. By default, it is "SolarSystem", which is the scene from the stock game. - -Including the "$schema" line is optional, but will allow your text editor to highlight errors and auto-suggest words in your config. I recommend using VSCode as a text editor, but anything that supports Json files will work. Something as basic as notepad will work but will not highlight any of your errors. - -The config file is then split into modules, each one with its own fields that define how that part of the planet will be generated. In the example above I've used the `Base`, `Orbit`, `Atmosphere`, and `Props` modules. A config file must have a `Base` and `Orbit` module, the rest are optional. - -Each `{` must match up with a closing `}` to denote its section. If you don't know how JSONs work then check Wikipedia. - -Modules look like this: - -```json -{ - "Star": { - "size": 3000, - "tint": { - "r": 201, - "g": 87, - "b": 55, - "a": 255 - } - } -} -``` - -In this example the `Star` module has a `size` field and a `tint` field. Since the colour is a complex object it needs -another set of `{` and `}` around it, and then it has its own fields inside it : `r`, `g`, `b`, and `a`. Don't forget to put -commas after each field. - -Most fields are either true/false, a decimal number, and integer number, or a string (word with quotation marks around -it). - -To see all the different things you can put into a config file check out the [Celestial Body schema]({{ 'Celestial Body Schema'|route}}). - -Check out the rest of the site for how to format [star system]({{ 'Star System Schema'|route}}), [dialogue]({{ 'Dialogue Schema'|route}}), [ship log]({{ 'Shiplog Schema'|route}}), and [translation]({{ 'Translation Schema'|route}}) files! - -## Publishing Your Mod - -Once your mod is complete, you can use the [planet creation template](https://github.com/xen-42/ow-new-horizons-config-template#readme){ target="_blank" } GitHub template. +For a guide on getting started with New Horizons, go to the [Getting Started]({{ "Getting Started"|route }}) page. ## Helpful Resources diff --git a/docs/content/pages/tutorials/api.md b/docs/content/pages/tutorials/api.md index 5c7a8996..2afd6ffe 100644 --- a/docs/content/pages/tutorials/api.md +++ b/docs/content/pages/tutorials/api.md @@ -1,6 +1,6 @@ --- Title: API -Sort_Priority: 40 +Sort_Priority: 20 --- ## How to use the API diff --git a/docs/content/pages/tutorials/creating_addon.md b/docs/content/pages/tutorials/creating_addon.md new file mode 100644 index 00000000..fc88919f --- /dev/null +++ b/docs/content/pages/tutorials/creating_addon.md @@ -0,0 +1,83 @@ +--- +Title: Creating An Addon +Sort_Priority: 85 +--- + +# Creating An Addon + +Up until now, you've been using the sandbox feature of New Horizons (simply placing your files in the `xen.NewHorizons` folder). +While this is the easiest way to get started, you won't be able to publish your work like this. In this tutorial we will: + +- Create a new GitHub repository from a template +- Use GitHub Desktop to clone this repository to our computer +- Edit the files in this repository to make our addon + +## Making a GitHub Repository + +To get started, we need a place to store our code. GitHub is one of the most popular websites to store source code, and it's also what the mod database uses to let people access our mod. +First you're going to want to [create a GitHub account](https://github.com/signup){ target="_blank" }, and then head to [this repository](https://github.com/xen-42/ow-new-horizons-config-template){ target="_blank" }. +Now, click the green "Use This Template" button. + +- 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 it later +- You can set the visibility to what you want; But when you go to publish your mod, it will need to be public + +## Cloning the Repository + +Now that we've created our GitHub repository (or "repo"), we need to clone (or download) it onto our computer. +To do this we recommend using the [GitHub Desktop App](https://desktop.github.com/){ target="_blank" }, as it's much easier to use than having to fight with the command line. + +Once we open GitHub desktop we're going to log in, select File -> Options -> Accounts and sign in to your newly created GitHub account. +Now we're ready to clone the repo, select File -> Clone Repository. Your repository should appear in the list. +Before you click "Clone", we need to select where to store the repo, open up the mod manager and go to "Settings", then copy the value located in the "OWML path" field and paste it in the "Local path" field on GitHub desktop. +This *will* show an error, and this is going to sound extremely stupid, but just click the "Choose..." button, and press "Select Folder" and it will be fixed. + +Our repository is now cloned to our computer! + +## Editing Files + +Now that our repo is cloned, we're going to need to edit the files in it. +To get started editing the files, simply click "Open in Visual Studio Code" in GitHub Desktop. + +### Files Explanation + +- .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. +- README.md: This file is displayed on the mod website when you go to a specific mod's page, you can delete the current contents. + - This file is a [markdown](https://www.markdowntutorial.com/){ target="_blank" } file, if you're not comfortable writing an entire README right now, just write a small description of your mod. + +### Committing The Changes + +Now that we have our files set up, switch back to GitHub desktop, you'll notice that the files you've changed have appeared in a list on the left. +What GitHub Desktop does is keep track of changes you make to your files over time. +Then, once you're ready, you commit these changes to your repo by filling out the "Summary" field with a small description of your changes, and then pressing the blue button that says "commit to main". + +Think of committing like taking a snapshot of your project at this moment in time. If you ever mess up your project, you can always revert to another commit to get back to a working version. It is highly recommended to commit often, there is no downside to committing too much. + +### Pushing The Changes + +OK, so we've committed our new changes, but these commits still only exist on our computer, to get these changes onto GitHub we can click the "Push Origin" button on the top right. + +## Testing The Addon + +Now that we have our manifest filled out, go take a look at the "Mods" tab in the manager and scroll to the bottom of the "Enabled Mods" list. + +You should see your mod there with the downloads counter set as a dash and the version set to "0.0.0". + +### Checking In-Game + +Now when you click "Start Game" and load into the solar system, you should be able to notice that the quantum moon is gone entirely, this means that your addon and its configs were successfully loaded. + +## Going Forward + +Now instead of using the New Horizons mod folder, you can use your own mod's folder instead. + +**Next Up: [Planet Generation]({{ "Planet Generation"|route }})** diff --git a/docs/content/pages/tutorials/details.md b/docs/content/pages/tutorials/details.md index c8483065..1c4c0cae 100644 --- a/docs/content/pages/tutorials/details.md +++ b/docs/content/pages/tutorials/details.md @@ -1,6 +1,6 @@ --- Title: Detailing -Sort_Priority: 85 +Sort_Priority: 80 --- # Details/Scatterer @@ -20,7 +20,7 @@ The Prop Placer is a convenience tool that lets you manually place details from 1. Pause the game. You will see an extra menu option titled "Toggle Prop Placer Menu". Click it 2. The prop placer menu should now be open. At the bottom of the menu, you will see a list of mods. Click yours. 1. This menu scrolls. If you do not see your mod, it may be further down the list. -3. The Prop Placer is now active! Unpause the game and you can now place Nomai vases using "G" +3. The Prop Placer is now active! Unpause the game, and you can now place Nomai vases using "G" ### How to Save @@ -39,7 +39,7 @@ What's that? You want to place something other than just vases? Well I can't say ### How to Select Props 1. Pause the game again. The prop placer menu should still be visible. -2. At the top of the menu, you'll see a text box contianing the path for the vase. Replace this with the path for the prop you want to place. For example: `DreamWorld_Body/Sector_DreamWorld/Sector_DreamZone_1/Props_DreamZone_1/OtherComponentsGroup/Trees_Z1/DreamHouseIsland/Tree_DW_M_Var` +2. At the top of the menu, you'll see a text box containing the path for the vase. Replace this with the path for the prop you want to place. For example: `DreamWorld_Body/Sector_DreamWorld/Sector_DreamZone_1/Props_DreamZone_1/OtherComponentsGroup/Trees_Z1/DreamHouseIsland/Tree_DW_M_Var` 3. Tip: use the Unity Explorer mod to find the path for the object you want to place. You only have to do this once. 4. Unpause the game and press "G". Say hello to your new tree! 5. Pause the game again. You will now see the prop you just placed on the list of recently placed props just below the "path" text box. diff --git a/docs/content/pages/tutorials/dialogue.md b/docs/content/pages/tutorials/dialogue.md index 88647927..bd44c160 100644 --- a/docs/content/pages/tutorials/dialogue.md +++ b/docs/content/pages/tutorials/dialogue.md @@ -1,36 +1,38 @@ --- Title: Dialogue Description: Guide to making dialogue in New Horizons -Sort_Priority: 50 +Sort_Priority: 30 --- # Dialogue This page goes over how to use dialogue in New Horizons. -# Understanding Dialogue +You may want to view [Understanding XML]({{ "Understanding XML"|route }}) if you haven't already. -## Dialogue Tree +## Understanding Dialogue + +### Dialogue Tree A dialogue tree is an entire conversation, it's made up of dialogue nodes. -## Dialogue Node +### Dialogue Node A node is a set of pages shown to the player followed by options the player can choose from to change the flow of the conversation. -## Condition +### Condition A condition is a yes/no value stored **for this loop and this loop only**. It can be used to show new dialogue options, stop someone from talking to you (looking at you Slate), and more. -## Persistent Condition +### Persistent Condition -A persistent condition is similar to a condition, except it *persists* through loops, and is saved on the player's save file. +A persistent condition is similar to a condition, except it *persists* through loops, and is saved on the players save file. -## Remote Trigger +### Remote Trigger A remote trigger is used to have an NPC talk to you from a distance; ex: Slate stopping you for the umpteenth time to tell you information you already knew. -# Example XML +## Example XML Here's an example dialogue XML: @@ -113,7 +115,7 @@ Here's an example dialogue XML: ``` -# Using the XML +## Using the XML To use the dialogue XML you have created, you simply need to reference it in the `dialogue` prop @@ -130,11 +132,11 @@ To use the dialogue XML you have created, you simply need to reference it in the } ``` -# Dialogue Config +## Dialogue Config To view the options for the dialogue prop, check [the schema]({{ "Celestial Body Schema"|route }}#Props_dialogue) -# Controlling Conditions +## Controlling Conditions You can set condition in dialogue with the `` and `` tags @@ -147,18 +149,18 @@ You can set condition in dialogue with the `` and ` ``` -# Dialogue Options +## Dialogue Options There are many control structures for dialogue options to hide/reveal them if conditions are met. Take a look at [the DialogueOption schema]({{ "Dialogue Schema"|route }}#DialogueTree-DialogueNode-DialogueOptionsList-DialogueOption-DialogueTarget) for more info. -# Controlling Flow +## Controlling Flow In addition to ``, there are other ways to control the flow of the conversation. -## DialogueTarget +### DialogueTarget Defining `` in the `` tag instead of a `` will make the conversation go directly to that target after the character is done talking. -## DialogueTargetShipLogCondition +### DialogueTargetShipLogCondition -Used in tandum with `DialogueTarget`, makes it so you must have a [ship log fact]({{ "Ship Log"|route }}#explore-facts) to go to the next node. +Used in tandem with `DialogueTarget`, makes it so you must have a [ship log fact]({{ "Ship Log"|route }}#explore-facts) to go to the next node. diff --git a/docs/content/pages/tutorials/extending.md b/docs/content/pages/tutorials/extending.md index 0e9b30bc..754140d9 100644 --- a/docs/content/pages/tutorials/extending.md +++ b/docs/content/pages/tutorials/extending.md @@ -23,7 +23,7 @@ Addon developers will add a key to the `extras` object in the root of the config } ``` -Your mod will then use the API's `QueryBody` method to obtain the `myCoolExtensionData` object. +Your mod will then use the APIs `QueryBody` method to obtain the `myCoolExtensionData` object. **It's up to the addon dev to list your mod as a dependency!** @@ -66,7 +66,7 @@ Extending systems is the exact same as extending planets, except you use the `Qu ## Accessing Other Values -You can also use the `QueryBody` method to get values of the config outside of your extension object +You can also use the `QueryBody` method to get values of the config outside your extension object ```csharp var primaryBody = api.QueryBody(typeof(string), "Wetrock", "$.Orbit.primaryBody"); diff --git a/docs/content/pages/tutorials/getting_started.md b/docs/content/pages/tutorials/getting_started.md new file mode 100644 index 00000000..1b2da307 --- /dev/null +++ b/docs/content/pages/tutorials/getting_started.md @@ -0,0 +1,259 @@ +--- +Title: Getting Started +Sort_Priority: 100 +--- + +# Getting Started + +Congrats on taking the first step to becoming an addon developer! +This tutorial will outline how to begin learning to use new horizons. + +## Recommended Tools + +It's strongly recommended you get [VSCode](https://code.visualstudio.com/){ target="_blank" } to edit your files, as it can provide syntax and error highlighting. + +## Using The Sandbox + +Making an entirely separate addon can get a little complicated, so New Horizons provides a way to play around without the need to set up a full addon. +To get started, navigate to your mod manager and click the ⋮ symbol, then select "Show In Explorer". + +![Select "Show in explorer"]({{ "images/getting_started/mod_manager_show_in_explorer.webp"|static }}) + +Now, create a new folder named "planets". As the name suggests, New Horizons will search the files in this folder for planets to generate. + +## Making Your First Planet + +To get started, create a new file in this folder called `wetrock.json`, we'll explain what that .json at the end means soon. +Open this file in VSCode (you can do so by right-clicking the file and clicking "Open with Code") +Once in VSCode, paste this code into the file: + +```json +{ + "name": "Wetrock", + "$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/body_schema.json", + "starSystem": "SolarSystem", + "Base": { + "groundSize": 100, + "surfaceSize": 101, + "surfaceGravity": 12, + "hasMapMarker": true + }, + "Orbit": { + "semiMajorAxis": 1300, + "primaryBody": "TIMBER_HEARTH", + "isMoon": true, + "isTidallyLocked": true + }, + "Atmosphere": { + "size": 150, + "fogTint": { + "r": 200, + "g": 255, + "b": 255, + "a": 255 + }, + "fogSize": 150, + "fogDensity": 0.2, + "hasRain": true + } +} +``` + +This language is **J**ava**S**cript **O**bject **N**otation, or JSON. +It's a common way to convey data in many programs. + +## Understanding JSON + +All JSON files start out with an `object`, or a set of key value mappings, for example if we represent a person as JSON it might look like: + +```json +{ + "name": "Jim" +} +``` + +Those braces (`{}`) denote an object, and by doing `"name": "Jim"` we're saying that the name of this person is Jim; +`"name"` is the key, and `"Jim"` is the value. + +Objects can have multiple keys as well, as long as you separate them by commas: + +```json +{ + "name": "Jim", + "age": 23 +} +``` + +But wait! why is `Jim` in quotation marks while `23` isn't? that's because of something called data types. +Each value has a datatype, in this case `"Jim"` is a `string`, because it represents a *string* of characters. +Age is a `number`, it represents a numerical value. If we put 23 in quotation marks, its data type switches from a number to a string. +And if we remove the quotation marks from `"Jim"` we get a syntax error (a red underline). Datatypes are a common source of errors, which is why we recommend using an editor like VSCode. + +### JSON Data Types + +Here's a list of data types you'll use when making your addons: + +#### String + +A set of characters surrounded in quotation marks + +```json +"Im a string!" +``` + +If you need to use quotation marks within your string, place a backslash (`\`) before them + +```json +"\"Im a string!\" - Mr. String Stringerton" +``` + +#### Number + +A numerical value, can be negative and have decimals, **not** surrounded in quotation marks + +```json +-25.3 +``` + +#### Boolean + +A `true` or `false` value, think of it like an on or off switch, also not surrounded in quotation marks + +```json +true +``` + +```json +false +``` + +#### Array + +A set of values, values can be of any data type. Items are seperated by commas. + +```json +[23, 45, 56] +``` + +```json +["Bob", "Suzy", "Mark"] +``` + +And they can be empty like so: + +```json +[] +``` + +#### Object + +A set of key value pairs, where each key is a string and each value can be of any data type (even other objects!) + +```json +{ + "name": "Jim", + "age": 23, + "isMarried": false, + "clothes": { + "shirtColor": "red", + "pantsColor": "blue" + }, + "friends": ["Bob", "Wade"], + "enemies": [] +} +``` + +## Back to Wetrock + +Now that we understand JSON better, let's look at that config file again: + +```json +{ + "name": "Wetrock", + "$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/body_schema.json", + "starSystem": "SolarSystem", + "Base": { + "groundSize": 100, + "surfaceSize": 101, + "surfaceGravity": 12, + "hasMapMarker": true + }, + "Orbit": { + "semiMajorAxis": 1300, + "primaryBody": "TIMBER_HEARTH", + "isMoon": true, + "isTidallyLocked": true + }, + "Atmosphere": { + "size": 150, + "fogTint": { + "r": 200, + "g": 255, + "b": 255, + "a": 255 + }, + "fogSize": 150, + "fogDensity": 0.2, + "hasRain": true + } +} +``` + +Here we can see we have a planet object, which name is "Wetrock", and is in the "SolarSystem" (Base-game) star system. +It has an object called Base, which has a groundSize of 100, and a surfaceSize of 101, and the list continues on. + +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 + +### 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 + +## Testing The Planet + +With the new planet created (*and saved!*), launch the game through the mod manager and click resume expedition. If all went well you should be able to open your map and see wetrock orbiting Timber Hearth. + +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 + +## Experiment! + +With that, try tweaking some value like groundSize and semiMajorAxis, get a feel for how editing JSON works. + +## Reloading Configs + +It can get annoying when you have to keep closing and opening the game over and over again to test changes, that's why New Horizons has a "Reload Configs" feature. +To enable it, head to your Mods menu and select New Horizons and check the box that says Debug, this will cause a "Reload Configs" option to appear in your pause menu which will reload changes from your filesystem. +You may also notice blue and yellow logs start appearing in your console, this is New Horizons providing additional info on what it's currently doing, it can be helpful when you're trying to track down an issue. + +## Modules + +Base, Atmosphere, and Orbit are all modules, which define the different aspects of your planet, modules are represented by JSON objects + +**Next Up: [Reading Schemas]({{ "Reading Schemas"|route }})** diff --git a/docs/content/pages/tutorials/planet_gen.md b/docs/content/pages/tutorials/planet_gen.md new file mode 100644 index 00000000..0dc589f0 --- /dev/null +++ b/docs/content/pages/tutorials/planet_gen.md @@ -0,0 +1,137 @@ +--- +Title: Planet Generation +Sort_Priority: 85 +--- + +# Planet Generation + +This guide covers some aspects of generating your planet, a lot of stuff is already explained in [the celestial body schema]({{ "Celestial Body Schema"|route }}). + +## Orbits + +First thing you should specify about your planet is its orbit. `primaryBody` will specify what planet this body will orbit. If you're in a new solar system and want this planet to be the center, set `centerOfSolarSystem` to `true` (keep in mind `centerOfSolarSystem` is in the `Base` module, not `Orbit`). Next up you'll need to specify the [orbital parameters](https://en.wikipedia.org/wiki/Orbital_elements). + +## Heightmaps + +Heightmaps are a way to generate unique terrain on your planet. First you specify a maximum and minimum height, and then specify a [heightMap]({{ "Celestial Body Schema"|route }}#HeightMap_heightMap) image. The more white a section of that image is, the closer to `maxHeight` that part of the terrain will be. Finally, you specify a `textureMap` which is an image that gets applied to the terrain. + +Here's an example heightmap of earth from the Real Solar System addon. + +![Earth's Heightmap]({{ "images/planet_gen/earth_heightmap.webp"|static }}) + +```json +{ + "name": "My Cool Planet", + "HeightMap": { + "minHeight": 5, + "maxHeight": 100, + "heightMap": "planets/assets/my_cool_heightmap.png", + "textureMap": "planets/assets/my_cool_texturemap.png" + } +} +``` + +There are also tools to help generate these images for you such as [Textures For Planets](https://www.texturesforplanets.com/){ target="_blank" }. + +## Variable Size Modules + +The following modules support variable sizing, meaning they can change scale over the course of the loop. + +- Water +- Lava +- Star +- Sand +- Funnel +- Ring + +To do this, simply specify a `curve` property on the module + +```json +{ + "name": "My Cool Planet", + "Water": { + "curve": [ + { + "time": 0, + "value": 100 + }, + { + "time": 22, + "value": 0 + } + ] + } +} +``` + +This makes the water on this planet shrink over the course of 22 minutes. + +## Quantum Planets + +In order to create a quantum planet, first create a normal planet. Then, create a second planet config with the same `name` as the first and `isQuantumState` set to `true`. +This makes the second planet a quantum state of the first, anything you specify here will only apply when the planet is in this state. + +```json +{ + "name": "MyPlanet", + "Orbit": { + "semiMajorAxis": 5000, + "primaryBody": "Sun" + } +} +``` + +```json +{ + "name": "MyPlanet", + "isQuantumState": true, + "Orbit": { + "semiMajorAxis": 1300, + "primaryBody": "TIMBER_HEARTH" + } +} +``` + +## Barycenters (Focal Points) + +To create a binary system of planets (like ash twin and ember twin), first create a config with `FocalPoint` set + +```json +{ + "name": "My Focal Point", + "Orbit": { + "semiMajorAxis": 22000, + "primaryBody": "Sun" + }, + "FocalPoint": { + "primary": "Planet A", + "secondary": "Planet B" + } +} +``` + +Now in each config set the `primaryBody` to the focal point + +```json +{ + "name": "Planet A", + "Orbit": { + "primaryBody": "My Focal Point", + "semiMajorAxis": 0, + "isTidallyLocked": true, + "isMoon": true + } +} +``` + +```json +{ + "name": "Planet B", + "Orbit": { + "primaryBody": "My Focal Point", + "semiMajorAxis": 440, + "isTidallyLocked": true, + "isMoon": true + } +} +``` diff --git a/docs/content/pages/tutorials/publishing.md b/docs/content/pages/tutorials/publishing.md new file mode 100644 index 00000000..661ab3b8 --- /dev/null +++ b/docs/content/pages/tutorials/publishing.md @@ -0,0 +1,56 @@ +--- +Title: Publishing Addons +Sort_Priority: 1 +--- + +# Publishing Your Addon + +This page goes over how to publish a release for your mod and submit your mod to the [outer wilds mod database](https://github.com/ow-mods/ow-mod-db) for review. + +This guide assumes you've created your addon by following [the addon creation guide]({{ "Creating An Addon"|route }}). + +## Housekeeping + +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. + + +## Releasing + +First things first we're going to create a release on GitHub. To do this, first make sure all your changes are committed and pushed in GitHub desktop. + +Then, edit your `manifest.json` and set the version number to `0.1.0` (or any version number that's higher than `0.0.0`). + +Finally, push your changes to GitHub, head to the "Actions" tab of your repository, and you should see an action running. + +Once the action finishes head back to the "Code" tab, you should see a Version 0.1.0 (or whatever version you put) in the column on the right. + +Double-check the release, it should have a zip file in the assets with your mod's unique name. + +## Submitting + +The hard part is over now, all that's left is to submit your mod to the database. + +[Head to the mod database and make a new "Add/Update Existing Mod" issue](https://github.com/ow-mods/ow-mod-db/issues/new?assignees=&labels=add-mod&template=add-mod.yml&title=%5BYour+mod+name+here%5D) + +Fill this out with your mod's info and make sure to put `xen.NewHorizons` in the parent mod field. + +Once you're done filling out the form, an admin will review your mod, make sure it works, and approve it into the database. + +Congrats! You just published your addon! + +## Updating + +If you want to update your mod, you can simply bump the version number in `manifest.json` again. + +To edit the release notes displayed in discord, enter them in the "Description" field before you commit in GitHub desktop. The most recent commits description is used for the release notes. + +**You don't need to create a new issue on the database to update your mod, it will be updated automatically after a few minutes** + + + + diff --git a/docs/content/pages/tutorials/reading_schemas.md b/docs/content/pages/tutorials/reading_schemas.md new file mode 100644 index 00000000..db162888 --- /dev/null +++ b/docs/content/pages/tutorials/reading_schemas.md @@ -0,0 +1,84 @@ +--- +Title: Reading Schemas +Sort_Priority: 90 +--- + +# Reading Schema Pages + +Reading and understanding the schema pages are key to knowing how to create planets. While these tutorials may be helpful, they won't cover everything, and new features may be added before the tutorial on them can be written. + +## Celestial Body Schema + +The [celestial body schema]({{ "Celestial Body Schema"|route }}) is the schema for making planets, there are other schemas which will be explained later but for now let's focus on this one. + +![The Celestial Body Schema Page]({{ "images/reading_schemas/body_schema_1.webp"|static }}) + +As you can see the type of this is `object`, which we talked about in the previous section. +We can also observe a blue badge that says "No Additional Properties", this signifies that you can't add keys to the object that aren't in the schema, for example: + +```json +{ + "name": "Wetrock", + "coolKey": "Look at my cool key!" +} +``` + +Will result in a warning in VSCode. Now, this will *not* prevent the planet from being loaded, however you should still avoid doing it. + +## Simple Properties + +![The name property on the celestial body schema]({{ "images/reading_schemas/body_schema_2.webp"|static }}) + +Next up let's look at `name`, this field is required, meaning you *have* to have it for a planet to load. +When we click on name we first see a breadcrumb, this is essentially a guide of where you are in the schema, right now we're in the name property of the root (topmost) object. +We can also see it's description, its type is `string`, and that it requires at least one character (so you can't just put `""`). + +Badges can also show stuff such as the default value, the minimum and maximum values, and more. + +## Object Properties + +![The Base object on the celestial body schema]({{ "images/reading_schemas/body_schema_3.webp"|static }}) + +Next let's look at an `object` within our root `object`, let's use `Base` as the example. + +Here we can see it's similar to our root object, in that it doesn't allow additional properties. +We can also see all of its properties listed out. + +## Array Properties + +Now let's take a look over at [removeChildren]({{ "Celestial Body Schema"|route }}#removeChildren) to see how arrays work (if you're wondering how you can get the page to scroll to a specific property, simply click on the property and copy the URL in your URL bar) + +![The curve property on a star in the celestial body schema]({{ "images/reading_schemas/body_schema_4.webp"|static }}) + +Here we can see that the type is an `array`, and each item in this array must be a `string` + +## Enum Properties + +Enum properties simply mean that they must be of one of the values shown, for example [Ring fluid type]({{ "Celestial Body Schema"|route }}#Ring_fluidType) has to be one of these values. + +![The enum values of fluidType]({{ "images/reading_schemas/body_schema_5.webp"|static }}) + +## Some Vocabulary + +- GameObject: Essentially just any object in, well, the game. You can view these object in a tree-like structure with the [Unity Explorer](https://outerwildsmods.com/mods/unityexplorer) mod. Every GameObject has a path, which is sort of like a file path in that it's a list of parent GameObjects seperated by forward slashes followed by the GameObject's name. +- Component: By themselves, a GameObject doesn't actually *do* anything, components provide stuff like collision, rendering, and logistics to GameObjects +- Config: Just another name for a JSON file "planet config" simply means a json file that describes a planet +- Module: A specific section of the config (e.g. Base, Atmosphere, etc), these usually start with capital letters + +## Note About File Paths + +Whenever a description refers to the "relative path" of a file, it means relative to the mod's directory, this means you **must** include the `planets` folder in the path: + +```json +"planets/assets/images/MyCoolImage.png" +``` + +## Other Schemas + +There are other schemas available, some are for JSON, and some are for XML. + +## Moving Forward + +Now that you know how to read the schema pages, you can understand the rest of this site. A lot of the other tutorials here will often tell you to take a look at schemas to explain what certain properties do. + +**Next Up: [Creating An Addon]({{ "Creating An Addon"|route }})** diff --git a/docs/content/pages/tutorials/ship_log.md b/docs/content/pages/tutorials/ship_log.md index 11e7a25d..62deeac7 100644 --- a/docs/content/pages/tutorials/ship_log.md +++ b/docs/content/pages/tutorials/ship_log.md @@ -1,13 +1,15 @@ --- Title: Ship Log Description: A guide to editing the ship log in New Horizons -Sort_Priority: 70 +Sort_Priority: 40 --- # Intro Welcome! this page outlines how to create a custom ship log. +If you haven't already, you may want to take a look at [Understanding XML]({{ "Understanding XML"|route }}) to get a better idea of how XML works. + # Understanding Ship Logs First thing's first, I'll define some terminology regarding ship logs in the game, and how ship logs are structured. diff --git a/docs/content/pages/tutorials/star_system.md b/docs/content/pages/tutorials/star_system.md index 3fbb5cf5..aa3218de 100644 --- a/docs/content/pages/tutorials/star_system.md +++ b/docs/content/pages/tutorials/star_system.md @@ -1,7 +1,7 @@ --- -Title: Star System +Title: Star Systems Description: A guide to editing a custom star system in New Horizons -Sort_Priority: 90 +Sort_Priority: 65 --- # Intro diff --git a/docs/content/pages/tutorials/translation.md b/docs/content/pages/tutorials/translation.md index bfec8d09..095a9f01 100644 --- a/docs/content/pages/tutorials/translation.md +++ b/docs/content/pages/tutorials/translation.md @@ -3,7 +3,7 @@ Title: Translations Sort_Priority: 60 --- -## Translations +# Translations There are 12 supported languages in Outer Wilds: english, spanish_la, german, french, italian, polish, portuguese_br, japanese, russian, chinese_simple, korean, and turkish. diff --git a/docs/content/pages/tutorials/update_existing.md b/docs/content/pages/tutorials/update_existing.md index 7e67ea0a..76d127db 100644 --- a/docs/content/pages/tutorials/update_existing.md +++ b/docs/content/pages/tutorials/update_existing.md @@ -1,13 +1,13 @@ --- Title: Update Planets -Sort_Priority: 80 +Sort_Priority: 85 --- -## Update Existing Planets +# Update Existing Planets Similar to above, make a config where "Name" is the name of the planet. The name should be able to just match their in-game english names, however if you encounter any issues with that here are the in-code names for planets that are guaranteed to work: `SUN`, `CAVE_TWIN` (Ember Twin), `TOWER_TWIN` (Ash Twin), `TIMBER_HEARTH`, `BRITTLE_HOLLOW`, `GIANTS_DEEP`, `DARK_BRAMBLE`, `COMET` (Interloper), `WHITE_HOLE`, `WHITE_HOLE_TARGET` (Whitehole station I believe), `QUANTUM_MOON`, `ORBITAL_PROBE_CANNON`, `TIMBER_MOON` (Attlerock), `VOLCANIC_MOON` (Hollow's Lantern), `DREAMWORLD`, `MapSatellite`, `RINGWORLD` (the Stranger). -Only some of the above modules are supported (currently) for existing planets. Things you cannot modify for existing planets include: heightmaps, procedural generation, gravity, or their orbits. You also can't make them into stars or binary focal points (but why would you want to, just delete them and replace them entirely). However this still means there are many things you can do: completely change their atmospheres, give them rings, asteroid belts, comet tails, lava, water, prop details, or signals. +Only some of the above modules are supported (currently) for existing planets. Things you cannot modify for existing planets include: heightmaps, procedural generation, gravity, or their orbits. You also can't make them into stars or binary focal points (but why would you want to, just delete them and replace them entirely). However, this still means there are many things you can do: completely change their atmospheres, give them rings, asteroid belts, comet tails, lava, water, prop details, or signals. You can also delete parts of an existing planet. Here's part of an example config which would delete the rising sand from Ember Twin: ```json @@ -31,4 +31,4 @@ You do this (but with the appropriate name) as its own config. } ``` -Remember that if you destroy Timber Hearth you better put a `Spawn` module on another planet. If you want to entirely replace the solar system you can destroy everything, including the sun. Also, deleting a planet destroys anything orbiting it, so if you want to replace the solar system you can just destroy the sun. If you're making a brand new star system, you don't have to worry about deleting any existing planets; they won't be there. \ No newline at end of file +Remember that if you destroy Timber Hearth you better put a `Spawn` module on another planet. If you want to entirely replace the solar system you can destroy everything, including the sun. Also, deleting a planet destroys anything orbiting it, so if you want to replace the solar system you can just destroy the sun. If you're making a brand new star system, you don't have to worry about deleting any existing planets; they won't be there. diff --git a/docs/content/pages/tutorials/xml.md b/docs/content/pages/tutorials/xml.md new file mode 100644 index 00000000..5c4db19e --- /dev/null +++ b/docs/content/pages/tutorials/xml.md @@ -0,0 +1,63 @@ +--- +Title: Understanding XML +Sort_Priority: 50 +--- + +# Understanding XML + +XML is the other language New Horizons uses for content. +XML files are usually passed straight to the game's code instead of going through New Horizons. + +## Syntax + +XML is composed of tags, a tag can represent a section or attribute + +```xml + + Jim + 32 + + +``` + +Notice how each tag is closed by an identical tag with a slash at the front (i.e. `` is closed by ``). + +If the tag has no content you can use the self-closing tag shorthand (i.e. `` doesn't need a closing tag because of the `/` at the end). + +This XML could be written in JSON as: + +```json +{ + "name": "Jim", + "age": 32, + "isMarried": true +} +``` + +XML is a lot more descriptive, you can actually tell that the object is supposed to be a person by the name of the tag. + +## Structure + +All XML files must have **one** top-level tag, this varies depending on what you're using it for (like how ship logs use a `` tag). + +## Schemas + +XML files can also have schemas, you specify them by adding attributes to the top-level tag: + +```xml + + +``` + +In order to get schema validation and autofill you'll need the [Redhat XML VSCode extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-xml){ target="_blank" }. + +## Uses + +XML is used for the following: + +- [Ship log Entries]({{ "Ship Log"|route }}) +- [Dialogue]({{ "Dialogue"|route }}) +- [Translatable Text](#) + + + diff --git a/docs/content/static/images/editor/log_port.webp b/docs/content/static/images/editor/log_port.webp new file mode 100644 index 00000000..0382c847 Binary files /dev/null and b/docs/content/static/images/editor/log_port.webp differ diff --git a/docs/content/static/images/getting_started/mod_manager_show_in_explorer.webp b/docs/content/static/images/getting_started/mod_manager_show_in_explorer.webp new file mode 100644 index 00000000..a54601f7 Binary files /dev/null and b/docs/content/static/images/getting_started/mod_manager_show_in_explorer.webp differ diff --git a/docs/content/static/images/home/create_planets.webp b/docs/content/static/images/home/create_planets.webp deleted file mode 100644 index 7629e85d..00000000 Binary files a/docs/content/static/images/home/create_planets.webp and /dev/null differ diff --git a/docs/content/static/images/home/mod_manager_dots.webp b/docs/content/static/images/home/mod_manager_dots.webp deleted file mode 100644 index 8320b2ea..00000000 Binary files a/docs/content/static/images/home/mod_manager_dots.webp and /dev/null differ diff --git a/docs/content/static/images/planet_gen/earth_heightmap.webp b/docs/content/static/images/planet_gen/earth_heightmap.webp new file mode 100644 index 00000000..3f822c92 Binary files /dev/null and b/docs/content/static/images/planet_gen/earth_heightmap.webp differ diff --git a/docs/content/static/images/reading_schemas/body_schema_1.webp b/docs/content/static/images/reading_schemas/body_schema_1.webp new file mode 100644 index 00000000..066440da Binary files /dev/null and b/docs/content/static/images/reading_schemas/body_schema_1.webp differ diff --git a/docs/content/static/images/reading_schemas/body_schema_2.webp b/docs/content/static/images/reading_schemas/body_schema_2.webp new file mode 100644 index 00000000..eb101a75 Binary files /dev/null and b/docs/content/static/images/reading_schemas/body_schema_2.webp differ diff --git a/docs/content/static/images/reading_schemas/body_schema_3.webp b/docs/content/static/images/reading_schemas/body_schema_3.webp new file mode 100644 index 00000000..3ca75b14 Binary files /dev/null and b/docs/content/static/images/reading_schemas/body_schema_3.webp differ diff --git a/docs/content/static/images/reading_schemas/body_schema_4.webp b/docs/content/static/images/reading_schemas/body_schema_4.webp new file mode 100644 index 00000000..5e218ec0 Binary files /dev/null and b/docs/content/static/images/reading_schemas/body_schema_4.webp differ diff --git a/docs/content/static/images/reading_schemas/body_schema_5.webp b/docs/content/static/images/reading_schemas/body_schema_5.webp new file mode 100644 index 00000000..9c88e15c Binary files /dev/null and b/docs/content/static/images/reading_schemas/body_schema_5.webp differ