mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Update README.md
This commit is contained in:
parent
ece268c1d8
commit
292f77d7b2
73
README.md
73
README.md
@ -10,6 +10,7 @@ Support for mods to create custom planets / moons is also coming soon!
|
||||
|
||||
- [Creating a planet file](#creating-a-planet-file-)
|
||||
- [Submit bugs / Chat about life](#submit-bugs--chat-about-life-)
|
||||
- [Using Marshmallow from other mods](#using-marshmallow-from-other-mods-)
|
||||
|
||||
<!-- /TOC -->
|
||||
|
||||
@ -17,27 +18,39 @@ Support for mods to create custom planets / moons is also coming soon!
|
||||
This list will update as more options are added. Structure JSON file like so :
|
||||
```
|
||||
{
|
||||
"settings": {
|
||||
"name" : "Test Planet",
|
||||
"position" : [0, 0, 20000],
|
||||
"position" : {
|
||||
"x" : 0,
|
||||
"y" : 0,
|
||||
"z" : 5000
|
||||
},
|
||||
"orbitAngle" : 0,
|
||||
"primaryBody" : "SUN",
|
||||
"hasFog" : true,
|
||||
"fogTint" : [0, 75, 15, 128],
|
||||
"fogTint" : {
|
||||
"r" : 255,
|
||||
"g" : 100,
|
||||
"b" : 0,
|
||||
"a" : 128
|
||||
},
|
||||
"fogDensity" : 0.5
|
||||
}
|
||||
}
|
||||
```
|
||||
Everything in "Required" is always needed, and so is every tabbed line in an option.
|
||||
### Required :
|
||||
- name - The name of the planet.
|
||||
- position - The Vector3 positon of the planet in world space. Write as \[x, y, z].
|
||||
- position - The Vector3 positon of the planet in world space.
|
||||
- orbitAngle - The angle of the orbit.
|
||||
- primaryBody - The AstroObject ID of the body this planet orbits.
|
||||
|
||||
### Optional :
|
||||
- hasGround - Set to "true" if you want to have a sphere as a ground.
|
||||
- groundSize - The size of the ground sphere.
|
||||
- hasClouds - Set to "true" if you want Giant's Deep-type clouds.
|
||||
- topCloudSize - The size of the outer sphere of the clouds.
|
||||
- bottomCloudSize - The size of the bumpy clouds underneath the top. *(Check that the bottom clouds are not poking through the top!)*
|
||||
- cloudTint - The color of the clouds. Write as \[r, g, b, a] in byte form. (0-255)
|
||||
- topCloudTint - The color of the top clouds.
|
||||
- bottomCloudTint - The color of the bottom clouds.
|
||||
- hasWater - Set to "true" if you want water.
|
||||
- waterSize - Size of the water sphere.
|
||||
- hasRain - Set to "true" if you want it to be raining.
|
||||
@ -45,9 +58,55 @@ Everything in "Required" is always needed, and so is every tabbed line in an opt
|
||||
- surfaceAcceleration - Strength of gravity.
|
||||
- hasMapMarker - Set to "true" if you want the planet name on the map.
|
||||
- hasFog - Set to "true" if you want fog.
|
||||
- fogTint - The color of the fog. Write as \[r, g, b, a] in byte form. (0-255)
|
||||
- fogTint - The color of the fog.
|
||||
- fogDensity - The thickness of the fog. \[0-1]
|
||||
|
||||
## Using Marshmallow from other mods :
|
||||
Marshmallow uses the fancy API system provided by OWML to allow other mods to communicate with it. As this system is currently still being worked on (by me :P), the way the Marshmallow API is used is slightly more annoying than when the system will be finished.
|
||||
|
||||
To use the API, first define this interface in your mod.
|
||||
```
|
||||
public interface IMarshmallow
|
||||
{
|
||||
void Create(Dictionary<string, object> config);
|
||||
}
|
||||
```
|
||||
Then, you need to find the Marshmallow API. This can be done using the interaction helpers of OWML.
|
||||
```
|
||||
var marshmallowApi = ModHelper.Interaction.GetApi<IMarshmallow>("misternebula.Marshmallow");
|
||||
```
|
||||
**Make sure that Marshmallow is defined as a dependency! This will prevent any load-order issues from occuring.**
|
||||
Next, we need to generate the dictionary of config options. To save time, you can copy this definition and just change the values.
|
||||
```
|
||||
var configDict = new Dictionary<string, object>
|
||||
{
|
||||
{ "name", "Test Planet" },
|
||||
{ "position", new Vector3(0, 0, 3000) },
|
||||
{ "orbitAngle", 0 },
|
||||
{ "primaryBody", "SUN" },
|
||||
{ "hasSpawnPoint", true },
|
||||
{ "hasGround", true },
|
||||
{ "groundSize", 400f },
|
||||
{ "hasClouds", true },
|
||||
{ "topCloudSize", 650f },
|
||||
{ "bottomCloudSize", 600f },
|
||||
{ "topCloudTint", new Color32(255, 0, 0, 128) },
|
||||
{ "bottomCloudTint", new Color32(255, 0, 0, 128) },
|
||||
{ "hasWater", true },
|
||||
{ "waterSize", 401f },
|
||||
{ "hasRain", true },
|
||||
{ "hasGravity", true },
|
||||
{ "surfaceAcceleration", 12f },
|
||||
{ "hasMapMarker", true },
|
||||
{ "hasFog", true },
|
||||
{ "fogTint", new Color32(255, 0, 0, 128 },
|
||||
{ "fogDensity", 0.5f },
|
||||
};
|
||||
```
|
||||
Then, you just call the `Create` method in the API!
|
||||
```
|
||||
marshmallowApi.Create(configDict);
|
||||
```
|
||||
## Submit bugs / Chat about life :
|
||||
Did you know we have a nice [Outer Wilds discord](https://discord.gg/Sftcc9Z)? Drop by to submit bugs, ask questions, and chat about whatever.
|
||||
Join us modding folk in the `#modding` channel!
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user