Merge branch 'master' into dev

This commit is contained in:
Nick 2022-04-22 17:00:19 -04:00
commit 8b4b41a38a
4 changed files with 57 additions and 22 deletions

View File

@ -28,7 +28,7 @@ namespace NewHorizons.Builder.Props
conversationTrigger.SetActive(false);
var remoteDialogueTrigger = conversationTrigger.AddComponent<RemoteDialogueTrigger>();
var boxCollider = conversationTrigger.AddComponent<BoxCollider>();
var sphereCollider = conversationTrigger.AddComponent<SphereCollider>();
conversationTrigger.AddComponent<OWCollider>();
remoteDialogueTrigger._listDialogues = new RemoteDialogueTrigger.RemoteDialogueCondition[]
@ -45,7 +45,7 @@ namespace NewHorizons.Builder.Props
remoteDialogueTrigger._activatedDialogues = new bool[1];
remoteDialogueTrigger._deactivateTriggerPostConversation = true;
boxCollider.size = Vector3.one * info.radius / 2f;
sphereCollider.radius = info.radius;
conversationTrigger.transform.parent = sector?.transform ?? go.transform;
conversationTrigger.transform.localPosition = info.remoteTriggerPosition;

View File

@ -603,6 +603,10 @@
"remoteTriggerPosition": {
"$ref": "#/$defs/vector3",
"description": "Allows you to trigger dialogue from a distance when you walk into an area."
},
"blockAfterPersistentCondition": {
"type": "string",
"description": "Prevents the dialogue from being created after a specific persistent condition is set. Useful for remote dialogue triggers that you want to have happen only once."
}
}
}

View File

@ -45,3 +45,39 @@ public class CreateAssetBundles
5. In the top left click the "Assets" drop-down and select "Build AssetBundles". This should create your asset bundle in a folder in the root directory called "StreamingAssets".
6. Copy the asset bundle and asset bundle .manifest files from StreamingAssets into your mod's "planets" folder. If you did everything properly they should work in game. To double-check everything is included, open the .manifest file in a text editor to see the files included and their paths.
## Importing a planet's surface from Unity
Making a planet's entire surface from a Unity prefab is the exact same thing as adding one single big detail at position (0, 0, 0).
## Examples
To add a Mars rover to the red planet in [RSS](https://github.com/xen-42/outer-wilds-real-solar-system), its model was put in an asset bundle as explained above, and then the following was put into the `Props` module:
```json
"Details" :
[
{ "assetBundle" : "planets/assetbundle/rss", "path" : "Assets/RSS/Prefabs/Rover.prefab", "position" : {"x": 146.5099, "y": -10.83688, "z": -36.02736}, "alignToNormal" : true }
]
```
To scatter 12 trees from the Dream World around Wetrock in [NH Examples](https://github.com/xen-42/ow-new-horizons-examples) , the following was put into the `Props` module:
```json
"Scatter" :
[
{"path" : "DreamWorld_Body/Sector_DreamWorld/Sector_DreamZone_1/Props_DreamZone_1/OtherComponentsGroup/Trees_Z1/DreamHouseIsland/Tree_DW_M_Var", "count" : 12}
]
```
You can swap these around too. The following would scatter 12 Mars rovers across the planet and place a single tree at a given position:
```json
"Details" :
[
{"path" : "DreamWorld_Body/Sector_DreamWorld/Sector_DreamZone_1/Props_DreamZone_1/OtherComponentsGroup/Trees_Z1/DreamHouseIsland/Tree_DW_M_Var", "position" : {"x": 146.5099, "y": -10.83688, "z": -36.02736}, "alignToNormal" : true }
],
"Scatter" :
[
{ "assetBundle" : "planets/assetbundle/rss", "path" : "Assets/RSS/Prefabs/Rover.prefab", "count" : 12}
]
```

View File

@ -10,16 +10,14 @@ This is the official documentation for [New Horizons](https://github.com/xen-42/
## Getting Started
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. 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.
Before starting, go into your in-game mod settings for New Horizons and switch Debug mode on. This allows you to:
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).
- Print the position of what you are looking at to the logs by pressing "P". This is useful for determining locations to place details.
- 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.
You may want to get [VSCode](https://code.visualstudio.com/){ target="_blank" } if you are unfamiliar with the JSON language, as it will help highlight common errors.
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.
@ -28,6 +26,8 @@ show in explorer" in the pop-up.
![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. If you don't know how GitHub works, you can use the [Addon Creation Tool](https://outerwildsmods.com/custom-worlds/create/) although you will still need a GitHub account.
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:
@ -78,18 +78,11 @@ look something like this:
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 (
see the [Singularity]({{ 'body'|route }}#Singularity) module). 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.
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.
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.
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.
@ -116,7 +109,9 @@ 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).
Check out the rest of the site for how to format planet, star system, dialogue, ship log, and translation files!
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
@ -125,7 +120,7 @@ Alternatively, you can use the [planet creation template](https://github.com/xen
## Helpful Resources
The texturemap/heightmap feature was inspired by the KSP mod Kopernicus. A lot of the same techniques that apply to
The texturemap/heightmap feature was inspired by the Kerbal Space Program mod Kopernicus. A lot of the same techniques that apply to
planet creation there apply to New Horizons. If you need help with planetary texturing, check out [The KSP texturing guide](https://forum.kerbalspaceprogram.com/index.php?/topic/165285-planetary-texturing-guide-repository/){ target="_blank" }.
[Photopea](https://www.photopea.com/){ target="_blank" } is a free browser-based photo editor which has useful features like