mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'dev' into stellar-remnants
This commit is contained in:
commit
52af5965ed
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
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
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@ -6,16 +6,16 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
{
|
||||
public static void Make(GameObject planetGO, Sector sector, PlanetConfig config)
|
||||
{
|
||||
GameObject airGO = new GameObject("Air");
|
||||
var airGO = new GameObject("Air");
|
||||
airGO.SetActive(false);
|
||||
airGO.layer = 17;
|
||||
airGO.transform.parent = sector?.transform ? sector.transform : planetGO.transform;
|
||||
|
||||
SphereCollider sc = airGO.AddComponent<SphereCollider>();
|
||||
var sc = airGO.AddComponent<SphereCollider>();
|
||||
sc.isTrigger = true;
|
||||
sc.radius = config.Atmosphere.size;
|
||||
|
||||
SimpleFluidVolume sfv = airGO.AddComponent<SimpleFluidVolume>();
|
||||
var sfv = airGO.AddComponent<SimpleFluidVolume>();
|
||||
sfv._layer = 5;
|
||||
sfv._priority = 1;
|
||||
sfv._density = 1.2f;
|
||||
@ -23,7 +23,11 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
sfv._allowShipAutoroll = true;
|
||||
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._radialCenter = airGO.transform;
|
||||
shockLayerRuleset._minShockSpeed = config.Atmosphere.minShockSpeed;
|
||||
@ -55,7 +59,7 @@ namespace NewHorizons.Builder.Atmosphere
|
||||
vref._layer = 0;
|
||||
vref._priority = 0;
|
||||
|
||||
AudioSource AS = airGO.AddComponent<AudioSource>();
|
||||
var AS = airGO.AddComponent<AudioSource>();
|
||||
AS.mute = false;
|
||||
AS.bypassEffects = false;
|
||||
AS.bypassListenerEffects = false;
|
||||
|
||||
@ -25,6 +25,8 @@ namespace NewHorizons.Builder.Props
|
||||
public static List<SignalName> QMSignals { get; private set; }
|
||||
public static List<SignalName> CloakedSignals { get; private set; }
|
||||
|
||||
public static bool Initialized;
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
Logger.LogVerbose($"Initializing SignalBuilder");
|
||||
@ -77,6 +79,8 @@ namespace NewHorizons.Builder.Props
|
||||
|
||||
QMSignals = new List<SignalName>() { SignalName.Quantum_QM };
|
||||
CloakedSignals = new List<SignalName>();
|
||||
|
||||
Initialized = true;
|
||||
}
|
||||
|
||||
public static SignalFrequency AddFrequency(string str)
|
||||
|
||||
11
NewHorizons/External/Configs/StarSystemConfig.cs
vendored
11
NewHorizons/External/Configs/StarSystemConfig.cs
vendored
@ -15,7 +15,7 @@ namespace NewHorizons.External.Configs
|
||||
public class StarSystemConfig
|
||||
{
|
||||
/// <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>
|
||||
[DefaultValue(true)] public bool canEnterViaWarpDrive = true;
|
||||
|
||||
@ -30,8 +30,8 @@ namespace NewHorizons.External.Configs
|
||||
[DefaultValue(true)] public bool enableTimeLoop = true;
|
||||
|
||||
/// <summary>
|
||||
/// Set to 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.
|
||||
/// The FactID that must be revealed before it can be warped to. Don't set `canEnterViaWarpDrive` to `false` if
|
||||
/// you're using this, because it will be overwritten.
|
||||
/// </summary>
|
||||
public string factRequiredForWarp;
|
||||
|
||||
@ -189,6 +189,11 @@ namespace NewHorizons.External.Configs
|
||||
/// Euler angles by which the warp exit will be oriented.
|
||||
/// </summary>
|
||||
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>
|
||||
|
||||
@ -284,27 +284,6 @@ namespace NewHorizons.Handlers
|
||||
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
|
||||
go = SharedGenerateBody(body, go, sector, rb);
|
||||
|
||||
@ -587,7 +566,8 @@ namespace NewHorizons.Handlers
|
||||
{
|
||||
var surfaceSize = body.Config.Base.surfaceSize;
|
||||
|
||||
AirBuilder.Make(go, sector, body.Config);
|
||||
if (body.Config.Atmosphere.size != 0)
|
||||
AirBuilder.Make(go, sector, body.Config);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
@ -773,5 +756,26 @@ namespace NewHorizons.Handlers
|
||||
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}\".");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ namespace NewHorizons.Handlers
|
||||
foreach (var system in systems)
|
||||
{
|
||||
var systemName = system.UniqueID;
|
||||
var fact = system.Config.factRequiredForWarp;
|
||||
var fact = system.Config.Vessel.promptFact;
|
||||
var nomaiCoords = system.Config.Vessel?.coords;
|
||||
|
||||
if (system.UniqueID == "EyeOfTheUniverse" || nomaiCoords == null) continue;
|
||||
|
||||
@ -117,6 +117,8 @@ namespace NewHorizons.Patches
|
||||
[HarmonyPatch(typeof(AudioSignal), nameof(AudioSignal.UpdateSignalStrength))]
|
||||
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;
|
||||
|
||||
__instance._canBePickedUpByScope = false;
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
"properties": {
|
||||
"canEnterViaWarpDrive": {
|
||||
"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
|
||||
},
|
||||
"destroyStockPlanets": {
|
||||
@ -22,7 +22,7 @@
|
||||
},
|
||||
"factRequiredForWarp": {
|
||||
"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": {
|
||||
"type": "number",
|
||||
@ -138,6 +138,10 @@
|
||||
"warpExitRotation": {
|
||||
"description": "Euler angles by which the warp exit will be oriented.",
|
||||
"$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
10
docs/content/pages/404.md
Normal 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.
|
||||
|
||||
@ -38,7 +38,7 @@ look something like this:
|
||||
```json
|
||||
{
|
||||
"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",
|
||||
"Base": {
|
||||
"groundSize": 100,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -38,7 +38,7 @@ Here's an example dialogue XML:
|
||||
<!-- 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 -->
|
||||
<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 -->
|
||||
|
||||
<DialogueNode> <!-- A dialogue node is a set of pages displayed to the player optionally followed by options -->
|
||||
|
||||
@ -62,7 +62,7 @@ navigate to ShipLogManager.
|
||||
<!-- 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 -->
|
||||
<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 -->
|
||||
|
||||
<Entry> <!-- An Entry For This Planet -->
|
||||
|
||||
@ -18,7 +18,7 @@ A star system config file will look something like this:
|
||||
|
||||
```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",
|
||||
"Vessel": {
|
||||
"coords": {
|
||||
|
||||
@ -15,7 +15,7 @@ Here's an example, for `russian.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" :
|
||||
{
|
||||
"Fred" : "Фред",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user