Merge branch 'dev' into stellar-remnants

This commit is contained in:
Nick 2022-08-25 21:43:46 -04:00 committed by GitHub
commit 52af5965ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 1233 additions and 1200 deletions

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2020 Ricardo Lopes Copyright (c) 2022 New Horizons Team
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -6,16 +6,16 @@ namespace NewHorizons.Builder.Atmosphere
{ {
public static void Make(GameObject planetGO, Sector sector, PlanetConfig config) public static void Make(GameObject planetGO, Sector sector, PlanetConfig config)
{ {
GameObject airGO = new GameObject("Air"); var airGO = new GameObject("Air");
airGO.SetActive(false); airGO.SetActive(false);
airGO.layer = 17; airGO.layer = 17;
airGO.transform.parent = sector?.transform ? sector.transform : planetGO.transform; airGO.transform.parent = sector?.transform ? sector.transform : planetGO.transform;
SphereCollider sc = airGO.AddComponent<SphereCollider>(); var sc = airGO.AddComponent<SphereCollider>();
sc.isTrigger = true; sc.isTrigger = true;
sc.radius = config.Atmosphere.size; sc.radius = config.Atmosphere.size;
SimpleFluidVolume sfv = airGO.AddComponent<SimpleFluidVolume>(); var sfv = airGO.AddComponent<SimpleFluidVolume>();
sfv._layer = 5; sfv._layer = 5;
sfv._priority = 1; sfv._priority = 1;
sfv._density = 1.2f; sfv._density = 1.2f;
@ -23,7 +23,11 @@ namespace NewHorizons.Builder.Atmosphere
sfv._allowShipAutoroll = true; sfv._allowShipAutoroll = true;
sfv._disableOnStart = false; sfv._disableOnStart = false;
ShockLayerRuleset shockLayerRuleset = planetGO.GetComponentInChildren<PlanetoidRuleset>().gameObject.AddComponent<ShockLayerRuleset>(); // Try to parent it to the same as other rulesets to match vanilla but if its null put it on the root object
var ruleSetGO = planetGO.GetComponentInChildren<PlanetoidRuleset>()?.gameObject;
if (ruleSetGO == null) ruleSetGO = planetGO;
var shockLayerRuleset = ruleSetGO.AddComponent<ShockLayerRuleset>();
shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric; shockLayerRuleset._type = ShockLayerRuleset.ShockType.Atmospheric;
shockLayerRuleset._radialCenter = airGO.transform; shockLayerRuleset._radialCenter = airGO.transform;
shockLayerRuleset._minShockSpeed = config.Atmosphere.minShockSpeed; shockLayerRuleset._minShockSpeed = config.Atmosphere.minShockSpeed;
@ -55,7 +59,7 @@ namespace NewHorizons.Builder.Atmosphere
vref._layer = 0; vref._layer = 0;
vref._priority = 0; vref._priority = 0;
AudioSource AS = airGO.AddComponent<AudioSource>(); var AS = airGO.AddComponent<AudioSource>();
AS.mute = false; AS.mute = false;
AS.bypassEffects = false; AS.bypassEffects = false;
AS.bypassListenerEffects = false; AS.bypassListenerEffects = false;

View File

@ -25,6 +25,8 @@ namespace NewHorizons.Builder.Props
public static List<SignalName> QMSignals { get; private set; } public static List<SignalName> QMSignals { get; private set; }
public static List<SignalName> CloakedSignals { get; private set; } public static List<SignalName> CloakedSignals { get; private set; }
public static bool Initialized;
public static void Init() public static void Init()
{ {
Logger.LogVerbose($"Initializing SignalBuilder"); Logger.LogVerbose($"Initializing SignalBuilder");
@ -77,6 +79,8 @@ namespace NewHorizons.Builder.Props
QMSignals = new List<SignalName>() { SignalName.Quantum_QM }; QMSignals = new List<SignalName>() { SignalName.Quantum_QM };
CloakedSignals = new List<SignalName>(); CloakedSignals = new List<SignalName>();
Initialized = true;
} }
public static SignalFrequency AddFrequency(string str) public static SignalFrequency AddFrequency(string str)

View File

@ -15,7 +15,7 @@ namespace NewHorizons.External.Configs
public class StarSystemConfig public class StarSystemConfig
{ {
/// <summary> /// <summary>
/// Whether this system can be warped to via the warp drive /// Whether this system can be warped to via the warp drive. If you set factRequiredForWarp, this will be true.
/// </summary> /// </summary>
[DefaultValue(true)] public bool canEnterViaWarpDrive = true; [DefaultValue(true)] public bool canEnterViaWarpDrive = true;
@ -30,8 +30,8 @@ namespace NewHorizons.External.Configs
[DefaultValue(true)] public bool enableTimeLoop = true; [DefaultValue(true)] public bool enableTimeLoop = true;
/// <summary> /// <summary>
/// Set to the FactID that must be revealed before it can be warped to. Don't set `CanEnterViaWarpDrive` to `false` if /// The FactID that must be revealed before it can be warped to. Don't set `canEnterViaWarpDrive` to `false` if
/// you're using this, that would make no sense. /// you're using this, because it will be overwritten.
/// </summary> /// </summary>
public string factRequiredForWarp; public string factRequiredForWarp;
@ -189,6 +189,11 @@ namespace NewHorizons.External.Configs
/// Euler angles by which the warp exit will be oriented. /// Euler angles by which the warp exit will be oriented.
/// </summary> /// </summary>
public MVector3 warpExitRotation; public MVector3 warpExitRotation;
/// <summary>
/// A ship log fact which will make a prompt appear showing the coordinates when you're in the Vessel.
/// </summary>
public string promptFact;
} }
/// <summary> /// <summary>

View File

@ -284,27 +284,6 @@ namespace NewHorizons.Handlers
UpdateBodyOrbit(body, go); UpdateBodyOrbit(body, go);
} }
if (body.Config.removeChildren != null)
{
var goPath = go.transform.GetPath();
var transforms = go.GetComponentsInChildren<Transform>(true);
foreach (var childPath in body.Config.removeChildren)
{
// Multiple children can have the same path so we delete all that match
var path = $"{goPath}/{childPath}";
var flag = true;
foreach (var childObj in transforms.Where(x => x.GetPath() == path))
{
flag = false;
// idk why we wait here but we do
Delay.FireInNUpdates(() => childObj.gameObject.SetActive(false), 2);
}
if (flag) Logger.LogWarning($"Couldn't find \"{childPath}\".");
}
}
// Do stuff that's shared between generating new planets and updating old ones // Do stuff that's shared between generating new planets and updating old ones
go = SharedGenerateBody(body, go, sector, rb); go = SharedGenerateBody(body, go, sector, rb);
@ -587,6 +566,7 @@ namespace NewHorizons.Handlers
{ {
var surfaceSize = body.Config.Base.surfaceSize; var surfaceSize = body.Config.Base.surfaceSize;
if (body.Config.Atmosphere.size != 0)
AirBuilder.Make(go, sector, body.Config); AirBuilder.Make(go, sector, body.Config);
if (!string.IsNullOrEmpty(body.Config.Atmosphere?.clouds?.texturePath)) if (!string.IsNullOrEmpty(body.Config.Atmosphere?.clouds?.texturePath))
@ -627,6 +607,9 @@ namespace NewHorizons.Handlers
SupernovaEffectBuilder.Make(go, sector, body.Config, body.Mod, procGen, ambientLight, fog, atmosphere, null, fog?._fogImpostor); SupernovaEffectBuilder.Make(go, sector, body.Config, body.Mod, procGen, ambientLight, fog, atmosphere, null, fog?._fogImpostor);
} }
// We allow removing children afterwards so you can also take bits off of the modules you used
if (body.Config.removeChildren != null) RemoveChildren(go, body);
return go; return go;
} }
@ -773,5 +756,26 @@ namespace NewHorizons.Handlers
Main.FurthestOrbit = go.transform.position.magnitude + 30000f; Main.FurthestOrbit = go.transform.position.magnitude + 30000f;
} }
} }
private static void RemoveChildren(GameObject go, NewHorizonsBody body)
{
var goPath = go.transform.GetPath();
var transforms = go.GetComponentsInChildren<Transform>(true);
foreach (var childPath in body.Config.removeChildren)
{
// Multiple children can have the same path so we delete all that match
var path = $"{goPath}/{childPath}";
var flag = true;
foreach (var childObj in transforms.Where(x => x.GetPath() == path))
{
flag = false;
// idk why we wait here but we do
Delay.FireInNUpdates(() => childObj.gameObject.SetActive(false), 2);
}
if (flag) Logger.LogWarning($"Couldn't find \"{childPath}\".");
}
}
} }
} }

View File

@ -31,7 +31,7 @@ namespace NewHorizons.Handlers
foreach (var system in systems) foreach (var system in systems)
{ {
var systemName = system.UniqueID; var systemName = system.UniqueID;
var fact = system.Config.factRequiredForWarp; var fact = system.Config.Vessel.promptFact;
var nomaiCoords = system.Config.Vessel?.coords; var nomaiCoords = system.Config.Vessel?.coords;
if (system.UniqueID == "EyeOfTheUniverse" || nomaiCoords == null) continue; if (system.UniqueID == "EyeOfTheUniverse" || nomaiCoords == null) continue;

View File

@ -117,6 +117,8 @@ namespace NewHorizons.Patches
[HarmonyPatch(typeof(AudioSignal), nameof(AudioSignal.UpdateSignalStrength))] [HarmonyPatch(typeof(AudioSignal), nameof(AudioSignal.UpdateSignalStrength))]
public static bool AudioSignal_UpdateSignalStrength(AudioSignal __instance, Signalscope scope, float distToClosestScopeObstruction) public static bool AudioSignal_UpdateSignalStrength(AudioSignal __instance, Signalscope scope, float distToClosestScopeObstruction)
{ {
if (!SignalBuilder.Initialized) return true;
if (!SignalBuilder.CloakedSignals.Contains(__instance._name) && !SignalBuilder.QMSignals.Contains(__instance._name)) return true; if (!SignalBuilder.CloakedSignals.Contains(__instance._name) && !SignalBuilder.QMSignals.Contains(__instance._name)) return true;
__instance._canBePickedUpByScope = false; __instance._canBePickedUpByScope = false;

View File

@ -7,7 +7,7 @@
"properties": { "properties": {
"canEnterViaWarpDrive": { "canEnterViaWarpDrive": {
"type": "boolean", "type": "boolean",
"description": "Whether this system can be warped to via the warp drive", "description": "Whether this system can be warped to via the warp drive. If you set factRequiredForWarp, this will be true.",
"default": true "default": true
}, },
"destroyStockPlanets": { "destroyStockPlanets": {
@ -22,7 +22,7 @@
}, },
"factRequiredForWarp": { "factRequiredForWarp": {
"type": "string", "type": "string",
"description": "Set to the FactID that must be revealed before it can be warped to. Don't set `CanEnterViaWarpDrive` to `false` if\nyou're using this, that would make no sense." "description": "The FactID that must be revealed before it can be warped to. Don't set `canEnterViaWarpDrive` to `false` if\nyou're using this, because it will be overwritten."
}, },
"loopDuration": { "loopDuration": {
"type": "number", "type": "number",
@ -138,6 +138,10 @@
"warpExitRotation": { "warpExitRotation": {
"description": "Euler angles by which the warp exit will be oriented.", "description": "Euler angles by which the warp exit will be oriented.",
"$ref": "#/definitions/MVector3" "$ref": "#/definitions/MVector3"
},
"promptFact": {
"type": "string",
"description": "A ship log fact which will make a prompt appear showing the coordinates when you're in the Vessel."
} }
} }
}, },

10
docs/content/pages/404.md Normal file
View File

@ -0,0 +1,10 @@
---
Title: Page not Found
Hide_In_Nav: True
Render_TOC: False
---
# Page Not Found
The page you requested could not be found.

View File

@ -38,7 +38,7 @@ look something like this:
```json ```json
{ {
"name": "Wetrock", "name": "Wetrock",
"$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/body_schema.json", "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json",
"starSystem": "SolarSystem", "starSystem": "SolarSystem",
"Base": { "Base": {
"groundSize": 100, "groundSize": 100,

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@ Here's an example dialogue XML:
<!-- Example Dialogue --> <!-- Example Dialogue -->
<!-- All files must have `DialogueTree` as the root element, the xmlns:xsi=... and xsi:noNamespaceSchemaLocation=... is optional but provides improved error checking if your editor supports it --> <!-- All files must have `DialogueTree` as the root element, the xmlns:xsi=... and xsi:noNamespaceSchemaLocation=... is optional but provides improved error checking if your editor supports it -->
<DialogueTree xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <DialogueTree xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/dialogue_schema.xsd"> xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/dialogue_schema.xsd">
<NameField>EXAMPLE NPC</NameField> <!-- The name of this character --> <NameField>EXAMPLE NPC</NameField> <!-- The name of this character -->
<DialogueNode> <!-- A dialogue node is a set of pages displayed to the player optionally followed by options --> <DialogueNode> <!-- A dialogue node is a set of pages displayed to the player optionally followed by options -->

View File

@ -62,7 +62,7 @@ navigate to ShipLogManager.
<!-- Example File --> <!-- Example File -->
<!-- All files must have "AstroObjectEntry" as their root element, the xmlns:xsi=... and xsi:noNamespaceSchemaLocation=... is optional but heavily encouraged to reduce errors --> <!-- All files must have "AstroObjectEntry" as their root element, the xmlns:xsi=... and xsi:noNamespaceSchemaLocation=... is optional but heavily encouraged to reduce errors -->
<AstroObjectEntry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <AstroObjectEntry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/shiplog_schema.xsd"> xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/shiplog_schema.xsd">
<ID>EXAMPLE_PLANET</ID> <!-- The ID of the planet this xml file is for --> <ID>EXAMPLE_PLANET</ID> <!-- The ID of the planet this xml file is for -->
<Entry> <!-- An Entry For This Planet --> <Entry> <!-- An Entry For This Planet -->

View File

@ -18,7 +18,7 @@ A star system config file will look something like this:
```json ```json
{ {
"$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/star_system_schema.json", "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/star_system_schema.json",
"travelAudio": "assets/Travel.mp3", "travelAudio": "assets/Travel.mp3",
"Vessel": { "Vessel": {
"coords": { "coords": {

View File

@ -15,7 +15,7 @@ Here's an example, for `russian.json`:
```json ```json
{ {
"$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/translation_schema.json", "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/translation_schema.json",
"DialogueDictionary" : "DialogueDictionary" :
{ {
"Fred" : "Фред", "Fred" : "Фред",