From 5d02897ec1ee3160dc0ff432e35e92b7e5851ddd Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 11 Jan 2023 23:42:29 -0500 Subject: [PATCH 01/18] Add water, sand, lava to title screen planets Also fixed the sizes to not be random and to actually be consistent. --- NewHorizons/Handlers/TitleSceneHandler.cs | 83 +++++++++++++++++------ 1 file changed, 61 insertions(+), 22 deletions(-) diff --git a/NewHorizons/Handlers/TitleSceneHandler.cs b/NewHorizons/Handlers/TitleSceneHandler.cs index 9faee29c6..b953b2bfd 100644 --- a/NewHorizons/Handlers/TitleSceneHandler.cs +++ b/NewHorizons/Handlers/TitleSceneHandler.cs @@ -75,31 +75,72 @@ public static void DisplayBodyOnTitleScreen(List bodies) private static GameObject LoadTitleScreenBody(NewHorizonsBody body) { Logger.LogVerbose($"Displaying {body.Config.name} on the title screen"); - GameObject titleScreenGO = new GameObject(body.Config.name + "_TitleScreen"); - HeightMapModule heightMap = new HeightMapModule(); - var minSize = 15; - var maxSize = 30; - float size = minSize; + var titleScreenGO = new GameObject(body.Config.name + "_TitleScreen"); + + var maxSize = -1f; + if (body.Config.HeightMap != null) { - size = Mathf.Clamp(body.Config.HeightMap.maxHeight / 10, minSize, maxSize); - heightMap.textureMap = body.Config.HeightMap.textureMap; - heightMap.heightMap = body.Config.HeightMap.heightMap; - heightMap.maxHeight = size; - heightMap.minHeight = body.Config.HeightMap.minHeight * size / body.Config.HeightMap.maxHeight; - heightMap.stretch = body.Config.HeightMap.stretch; + HeightMapBuilder.Make(titleScreenGO, null, body.Config.HeightMap, body.Mod, 30); + maxSize = body.Config.HeightMap.maxHeight; } if (body.Config.Atmosphere?.clouds?.texturePath != null && body.Config.Atmosphere?.clouds?.cloudsPrefab != CloudPrefabType.Transparent) { // Hacky but whatever I just want a sphere - size = Mathf.Clamp(body.Config.Atmosphere.size / 10, minSize, maxSize); - heightMap.maxHeight = heightMap.minHeight = size + 1; - heightMap.textureMap = body.Config.Atmosphere.clouds.texturePath; + var cloudTextureMap = new HeightMapModule(); + cloudTextureMap.maxHeight = cloudTextureMap.minHeight = body.Config.Atmosphere.size; + cloudTextureMap.textureMap = body.Config.Atmosphere.clouds.texturePath; + HeightMapBuilder.Make(titleScreenGO, null, cloudTextureMap, body.Mod, 30); + maxSize = Mathf.Max(maxSize, cloudTextureMap.maxHeight); } + else + { + if (body.Config.Water != null) + { + var waterGO = GameObject.CreatePrimitive(PrimitiveType.Sphere); + var size = 2f * Mathf.Max(body.Config.Water.size, body.Config.Water.size * body.Config.Water.curve?.FirstOrDefault()?.value ?? 0f); + + waterGO.transform.localScale = Vector3.one * size; + + var mr = waterGO.GetComponent(); + mr.material.color = body.Config.Water.tint?.ToColor() ?? Color.blue; + + waterGO.transform.parent = titleScreenGO.transform; + waterGO.transform.localPosition = Vector3.zero; + + maxSize = Mathf.Max(maxSize, size); + } + if (body.Config.Lava != null) + { + var lavaGO = GameObject.CreatePrimitive(PrimitiveType.Sphere); + var size = 2f * Mathf.Max(body.Config.Lava.size, body.Config.Lava.size * body.Config.Lava.curve?.FirstOrDefault()?.value ?? 0f); + + lavaGO.transform.localScale = Vector3.one * size; - HeightMapBuilder.Make(titleScreenGO, null, heightMap, body.Mod, 30); + var mr = lavaGO.GetComponent(); + mr.material.color = body.Config.Lava.tint?.ToColor() ?? Color.red; - GameObject pivot = GameObject.Instantiate(SearchUtilities.Find("Scene/Background/PlanetPivot"), SearchUtilities.Find("Scene/Background").transform); + lavaGO.transform.parent = titleScreenGO.transform; + lavaGO.transform.localPosition = Vector3.zero; + + maxSize = Mathf.Max(maxSize, size); + } + if (body.Config.Sand != null) + { + var sandGO = GameObject.CreatePrimitive(PrimitiveType.Sphere); + var size = 2f * Mathf.Max(body.Config.Sand.size, body.Config.Sand.size * body.Config.Sand.curve?.FirstOrDefault()?.value ?? 0f); + + sandGO.transform.localScale = Vector3.one * size; + sandGO.GetComponent().material.color = body.Config.Sand.tint?.ToColor() ?? Color.yellow; + + sandGO.transform.parent = titleScreenGO.transform; + sandGO.transform.localPosition = Vector3.zero; + + maxSize = Mathf.Max(maxSize, size); + } + } + + var pivot = GameObject.Instantiate(SearchUtilities.Find("Scene/Background/PlanetPivot"), SearchUtilities.Find("Scene/Background").transform); pivot.GetComponent()._degreesPerSecond = 10f; foreach (Transform child in pivot.transform) { @@ -111,17 +152,15 @@ private static GameObject LoadTitleScreenBody(NewHorizonsBody body) { foreach (var ring in body.Config.Rings) { - RingModule newRing = new RingModule(); - newRing.innerRadius = size * 1.2f; - newRing.outerRadius = size * 2f; - newRing.texture = ring.texture; - RingBuilder.Make(titleScreenGO, null, newRing, body.Mod); + RingBuilder.Make(titleScreenGO, null, ring, body.Mod); + + maxSize = Mathf.Max(maxSize, ring.outerRadius); } - titleScreenGO.transform.localScale = Vector3.one * 0.8f; } titleScreenGO.transform.parent = pivot.transform; titleScreenGO.transform.localPosition = Vector3.zero; + titleScreenGO.transform.localScale = Vector3.one * 30f / maxSize; return titleScreenGO; } From 7d168c14fc05d7d786ea88b1cc4e17f8b2b82692 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 19 Jan 2023 15:51:24 -0800 Subject: [PATCH 02/18] change randomizer to common resources --- NewHorizons/manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 95333d165..6f386cbef 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,9 +4,9 @@ "author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.8.5", + "version": "1.8.6", "owmlVersion": "2.9.0", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], - "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ], + "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ], "pathsToPreserve": [ "planets", "systems", "translations" ] } From f1097a65d59c2b3184b428a625244f0b33971e78 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 21 Jan 2023 23:35:13 -0500 Subject: [PATCH 03/18] Add volumes for changing star system and triggering credits --- .../Builder/Body/SingularityBuilder.cs | 2 +- .../Volumes/ChangeStarSystemVolumeBuilder.cs | 18 +++++++++ .../Builder/Volumes/CreditsVolumeBuilder.cs | 18 +++++++++ .../Builder/Volumes/VolumesBuildManager.cs | 14 +++++++ ...SystemVolume.cs => BlackHoleWarpVolume.cs} | 4 +- .../Components/Volumes/LoadCreditsVolume.cs | 35 ++++++++++++++++++ NewHorizons/Components/Volumes/WarpVolume.cs | 31 ++++++++++++++++ NewHorizons/External/Modules/VolumesModule.cs | 37 +++++++++++++++++++ NewHorizons/manifest.json | 2 +- 9 files changed, 157 insertions(+), 4 deletions(-) create mode 100644 NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs create mode 100644 NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs rename NewHorizons/Components/Volumes/{ChangeStarSystemVolume.cs => BlackHoleWarpVolume.cs} (85%) create mode 100644 NewHorizons/Components/Volumes/LoadCreditsVolume.cs create mode 100644 NewHorizons/Components/Volumes/WarpVolume.cs diff --git a/NewHorizons/Builder/Body/SingularityBuilder.cs b/NewHorizons/Builder/Body/SingularityBuilder.cs index 40f2afd71..96466121b 100644 --- a/NewHorizons/Builder/Body/SingularityBuilder.cs +++ b/NewHorizons/Builder/Body/SingularityBuilder.cs @@ -203,7 +203,7 @@ public static void PairSingularities(string blackHoleID, string whiteHoleID, Gam if (hasDestructionVolume) destructionVolumeGO.AddComponent(); else if (targetStarSystem != null) { - var wormholeVolume = destructionVolumeGO.AddComponent(); + var wormholeVolume = destructionVolumeGO.AddComponent(); wormholeVolume.TargetSolarSystem = targetStarSystem; } } diff --git a/NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs b/NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs new file mode 100644 index 000000000..2d97bbd36 --- /dev/null +++ b/NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs @@ -0,0 +1,18 @@ +using NewHorizons.Components.Volumes; +using NewHorizons.External.Modules; +using UnityEngine; + +namespace NewHorizons.Builder.Volumes +{ + internal static class ChangeStarSystemVolumeBuilder + { + public static WarpVolume Make(GameObject planetGO, Sector sector, VolumesModule.ChangeStarSystemVolumeInfo info) + { + var volume = VolumeBuilder.Make(planetGO, sector, info); + + volume.TargetSolarSystem = info.targetStarSystem; + + return volume; + } + } +} diff --git a/NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs b/NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs new file mode 100644 index 000000000..c34745c1b --- /dev/null +++ b/NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs @@ -0,0 +1,18 @@ +using NewHorizons.Components.Volumes; +using NewHorizons.External.Modules; +using UnityEngine; + +namespace NewHorizons.Builder.Volumes +{ + internal static class CreditsVolumeBuilder + { + public static LoadCreditsVolume Make(GameObject planetGO, Sector sector, VolumesModule.LoadCreditsVolumeInfo info) + { + var volume = VolumeBuilder.Make(planetGO, sector, info); + + volume.creditsType = info.creditsType; + + return volume; + } + } +} diff --git a/NewHorizons/Builder/Volumes/VolumesBuildManager.cs b/NewHorizons/Builder/Volumes/VolumesBuildManager.cs index 802363b5e..cd1f474ad 100644 --- a/NewHorizons/Builder/Volumes/VolumesBuildManager.cs +++ b/NewHorizons/Builder/Volumes/VolumesBuildManager.cs @@ -192,6 +192,20 @@ public static void Make(GameObject go, Sector sector, OWRigidbody planetBody, Pl VolumeBuilder.Make(go, sector, lightSourceVolume); } } + if (config.Volumes.solarSystemVolume != null) + { + foreach (var solarSystemVolume in config.Volumes.solarSystemVolume) + { + ChangeStarSystemVolumeBuilder.Make(go, sector, solarSystemVolume); + } + } + if (config.Volumes.creditsVolume != null) + { + foreach (var creditsVolume in config.Volumes.creditsVolume) + { + CreditsVolumeBuilder.Make(go, sector, creditsVolume); + } + } } } } diff --git a/NewHorizons/Components/Volumes/ChangeStarSystemVolume.cs b/NewHorizons/Components/Volumes/BlackHoleWarpVolume.cs similarity index 85% rename from NewHorizons/Components/Volumes/ChangeStarSystemVolume.cs rename to NewHorizons/Components/Volumes/BlackHoleWarpVolume.cs index bdf43aae6..58202aa17 100644 --- a/NewHorizons/Components/Volumes/ChangeStarSystemVolume.cs +++ b/NewHorizons/Components/Volumes/BlackHoleWarpVolume.cs @@ -1,6 +1,6 @@ -namespace NewHorizons.Components.Volumes +namespace NewHorizons.Components.Volumes { - public class ChangeStarSystemVolume : BlackHoleDestructionVolume + public class BlackHoleWarpVolume : BlackHoleDestructionVolume { public string TargetSolarSystem { get; set; } diff --git a/NewHorizons/Components/Volumes/LoadCreditsVolume.cs b/NewHorizons/Components/Volumes/LoadCreditsVolume.cs new file mode 100644 index 000000000..119908406 --- /dev/null +++ b/NewHorizons/Components/Volumes/LoadCreditsVolume.cs @@ -0,0 +1,35 @@ +using NewHorizons.External.Modules; +using UnityEngine; + +namespace NewHorizons.Components.Volumes +{ + internal class LoadCreditsVolume : BaseVolume + { + public VolumesModule.LoadCreditsVolumeInfo.CreditsType creditsType = VolumesModule.LoadCreditsVolumeInfo.CreditsType.Fast; + + public override void OnTriggerVolumeEntry(GameObject hitObj) + { + if (hitObj.CompareTag("PlayerDetector")) + { + switch(creditsType) + { + case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Fast: + LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack); + break; + case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Final: + LoadManager.LoadScene(OWScene.Credits_Final, LoadManager.FadeType.ToBlack); + break; + case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Kazoo: + TimelineObliterationController.s_hasRealityEnded = true; + LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack); + break; + } + } + } + + public override void OnTriggerVolumeExit(GameObject hitObj) + { + + } + } +} diff --git a/NewHorizons/Components/Volumes/WarpVolume.cs b/NewHorizons/Components/Volumes/WarpVolume.cs new file mode 100644 index 000000000..f5be0007b --- /dev/null +++ b/NewHorizons/Components/Volumes/WarpVolume.cs @@ -0,0 +1,31 @@ +using NewHorizons.External.Modules; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace NewHorizons.Components.Volumes +{ + internal class WarpVolume : BaseVolume + { + public string TargetSolarSystem; + + public override void OnTriggerVolumeEntry(GameObject hitObj) + { + if (hitObj.CompareTag("PlayerDetector")) + { + if (Main.Instance.CurrentStarSystem != TargetSolarSystem) // Otherwise it really breaks idk why + { + Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, PlayerState.AtFlightConsole()); + } + } + } + + public override void OnTriggerVolumeExit(GameObject hitObj) + { + + } + } +} diff --git a/NewHorizons/External/Modules/VolumesModule.cs b/NewHorizons/External/Modules/VolumesModule.cs index b1cc6b207..39dfb90be 100644 --- a/NewHorizons/External/Modules/VolumesModule.cs +++ b/NewHorizons/External/Modules/VolumesModule.cs @@ -106,6 +106,16 @@ public class VolumesModule /// public PriorityVolumeInfo[] zeroGravityVolumes; + /// + /// Entering this volume will load a new solar system. + /// + public ChangeStarSystemVolumeInfo[] solarSystemVolume; + + /// + /// Enter this volume to be sent to the end credits scene + /// + public LoadCreditsVolumeInfo[] creditsVolume; + [JsonObject] public class VolumeInfo { @@ -136,6 +146,33 @@ public class VolumeInfo public string rename; } + [JsonObject] + public class ChangeStarSystemVolumeInfo : VolumeInfo + { + /// + /// The star system that entering this volume will send you to. + /// + [DefaultValue("SolarSystem")] + public string targetStarSystem; + } + + [JsonObject] + public class LoadCreditsVolumeInfo : VolumeInfo + { + [JsonConverter(typeof(StringEnumConverter))] + public enum CreditsType + { + [EnumMember(Value = @"fast")] Fast = 0, + + [EnumMember(Value = @"final")] Final = 1, + + [EnumMember(Value = @"kazoo")] Kazoo = 2 + } + + [DefaultValue("fast")] + public CreditsType creditsType = CreditsType.Fast; + } + [JsonObject] public class PriorityVolumeInfo : VolumeInfo { diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 95333d165..7968e81a9 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.8.5", + "version": "1.8.6", "owmlVersion": "2.9.0", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ], From 3253ef6ce997a75ebe0312403085596658171b01 Mon Sep 17 00:00:00 2001 From: Ben C Date: Sun, 22 Jan 2023 04:37:47 +0000 Subject: [PATCH 04/18] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 93 ++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index dc13be31e..97d49113c 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -2715,6 +2715,20 @@ "items": { "$ref": "#/definitions/PriorityVolumeInfo" } + }, + "solarSystemVolume": { + "type": "array", + "description": "Entering this volume will load a new solar system.", + "items": { + "$ref": "#/definitions/ChangeStarSystemVolumeInfo" + } + }, + "creditsVolume": { + "type": "array", + "description": "Enter this volume to be sent to the end credits scene", + "items": { + "$ref": "#/definitions/LoadCreditsVolumeInfo" + } } } }, @@ -3728,6 +3742,85 @@ "default": 1 } } + }, + "ChangeStarSystemVolumeInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "position": { + "description": "The location of this volume. Optional (will default to 0,0,0).", + "$ref": "#/definitions/MVector3" + }, + "radius": { + "type": "number", + "description": "The radius of this volume.", + "format": "float", + "default": 1.0 + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional coordinates are relative to parent instead of the root planet object." + }, + "rename": { + "type": "string", + "description": "An optional rename of this volume." + }, + "targetStarSystem": { + "type": "string", + "description": "The star system that entering this volume will send you to.", + "default": "SolarSystem" + } + } + }, + "LoadCreditsVolumeInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "position": { + "description": "The location of this volume. Optional (will default to 0,0,0).", + "$ref": "#/definitions/MVector3" + }, + "radius": { + "type": "number", + "description": "The radius of this volume.", + "format": "float", + "default": 1.0 + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional coordinates are relative to parent instead of the root planet object." + }, + "rename": { + "type": "string", + "description": "An optional rename of this volume." + }, + "creditsType": { + "default": "fast", + "$ref": "#/definitions/CreditsType" + } + } + }, + "CreditsType": { + "type": "string", + "description": "", + "x-enumNames": [ + "Fast", + "Final", + "Kazoo" + ], + "enum": [ + "fast", + "final", + "kazoo" + ] } }, "$docs": { From d7c3e06e3adeec1da5caa92c7c286f4db3f5aaa3 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 21 Jan 2023 23:52:51 -0500 Subject: [PATCH 05/18] Add submerge controller to dark matter --- NewHorizons/Builder/Body/WaterBuilder.cs | 4 +++- NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Body/WaterBuilder.cs b/NewHorizons/Builder/Body/WaterBuilder.cs index ae72bce6e..9c6f68ed1 100644 --- a/NewHorizons/Builder/Body/WaterBuilder.cs +++ b/NewHorizons/Builder/Body/WaterBuilder.cs @@ -39,7 +39,7 @@ internal static void InitPrefabs() if (_oceanAmbientLight == null) _oceanAmbientLight = SearchUtilities.Find("Ocean_GD").GetComponent()._ambientLight.gameObject.InstantiateInactive().Rename("OceanAmbientLight").DontDestroyOnLoad(); } - public static void Make(GameObject planetGO, Sector sector, OWRigidbody rb, WaterModule module) + public static RadialFluidVolume Make(GameObject planetGO, Sector sector, OWRigidbody rb, WaterModule module) { InitPrefabs(); @@ -148,6 +148,8 @@ public static void Make(GameObject planetGO, Sector sector, OWRigidbody rb, Wate waterGO.transform.position = planetGO.transform.position; waterGO.SetActive(true); + + return fluidVolume; } } } diff --git a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs index 06fc721d8..5ebb65faf 100644 --- a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs @@ -62,6 +62,20 @@ public static HazardVolume Make(GameObject planetGO, Sector sector, OWRigidbody var visorFrostEffectVolume = go.AddComponent(); visorFrostEffectVolume._frostRate = 0.5f; visorFrostEffectVolume._maxFrost = 0.91f; + + var water = planetGO.GetComponentInChildren(); + if (water != null) + { + var submerge = go.AddComponent(); + submerge._activeWhenSubmerged = false; + submerge._effectVolumes = new EffectVolume[] { visorFrostEffectVolume }; + // THERE ARE NO RENDERERS??? RUH ROH!!! + + var detector = go.AddComponent(); + detector.AddVolume(water); + + submerge._fluidDetector = detector; + } } else if (info.type == VolumesModule.HazardVolumeInfo.HazardType.ELECTRICITY) { From f48c79908bc735cbe64893e1b45c360a47a2485b Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 21 Jan 2023 23:55:34 -0500 Subject: [PATCH 06/18] Should fix submerging dark matter --- NewHorizons/Builder/Props/DetailBuilder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index a3d4e9589..0d6f7b3b7 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -312,6 +312,11 @@ private static void FixComponent(Component component, GameObject planetGO) if (probeVisuals != null) probeVisuals.gameObject.SetActive(true); } + if (component is DarkMatterSubmergeController submergeController) + { + submergeController._fluidDetector?.SetDetectableFluid(planetGO.GetComponentInChildren()); + } + // Fix anglerfish speed on orbiting planets if (component is AnglerfishController angler) { From 4108683515cd7f74453c4c74e0ffdb4331780995 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 22 Jan 2023 00:15:35 -0500 Subject: [PATCH 07/18] Fix fluid detector --- NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs index 5ebb65faf..929d796f6 100644 --- a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs @@ -71,7 +71,11 @@ public static HazardVolume Make(GameObject planetGO, Sector sector, OWRigidbody submerge._effectVolumes = new EffectVolume[] { visorFrostEffectVolume }; // THERE ARE NO RENDERERS??? RUH ROH!!! - var detector = go.AddComponent(); + var detectorGO = new GameObject("ConstantFluidDetector"); + detectorGO.transform.parent = go.transform; + detectorGO.transform.localPosition = Vector3.zero; + detectorGO.layer = OWLayerMask.detectorMask; + var detector = detectorGO.AddComponent(); detector.AddVolume(water); submerge._fluidDetector = detector; From a17f0e88dc90991e1e75b16aa359596938a83b23 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 21 Jan 2023 21:19:12 -0800 Subject: [PATCH 08/18] use layer --- NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs index 929d796f6..5799c8f8f 100644 --- a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs @@ -74,7 +74,7 @@ public static HazardVolume Make(GameObject planetGO, Sector sector, OWRigidbody var detectorGO = new GameObject("ConstantFluidDetector"); detectorGO.transform.parent = go.transform; detectorGO.transform.localPosition = Vector3.zero; - detectorGO.layer = OWLayerMask.detectorMask; + detectorGO.layer = LayerMask.NameToLayer("BasicDetector"); var detector = detectorGO.AddComponent(); detector.AddVolume(water); From 2e19aada5331c9cca2d6571b3e91ae2255015cf3 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 22 Jan 2023 00:22:51 -0500 Subject: [PATCH 09/18] Update HazardVolumeBuilder.cs --- NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs index 5799c8f8f..679bcc149 100644 --- a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs @@ -63,7 +63,7 @@ public static HazardVolume Make(GameObject planetGO, Sector sector, OWRigidbody visorFrostEffectVolume._frostRate = 0.5f; visorFrostEffectVolume._maxFrost = 0.91f; - var water = planetGO.GetComponentInChildren(); + var water = planetGO.GetComponentsInChildren().FirstOrDefault(x => x._fluidType == FluidVolume.Type.WATER); if (water != null) { var submerge = go.AddComponent(); From 65519b456365ae0d990b7af111cf95dbdb6c02b9 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 21 Jan 2023 21:28:17 -0800 Subject: [PATCH 10/18] fix --- NewHorizons/Builder/Props/DetailBuilder.cs | 3 ++- NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 0d6f7b3b7..a09c83d8b 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -314,7 +314,8 @@ private static void FixComponent(Component component, GameObject planetGO) if (component is DarkMatterSubmergeController submergeController) { - submergeController._fluidDetector?.SetDetectableFluid(planetGO.GetComponentInChildren()); + var water = planetGO.GetComponentsInChildren().FirstOrDefault(x => x._fluidType == FluidVolume.Type.WATER); + submergeController._fluidDetector?.SetDetectableFluid(water); } // Fix anglerfish speed on orbiting planets diff --git a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs index 679bcc149..272c559dc 100644 --- a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs @@ -76,7 +76,7 @@ public static HazardVolume Make(GameObject planetGO, Sector sector, OWRigidbody detectorGO.transform.localPosition = Vector3.zero; detectorGO.layer = LayerMask.NameToLayer("BasicDetector"); var detector = detectorGO.AddComponent(); - detector.AddVolume(water); + detector.SetDetectableFluid(water); submerge._fluidDetector = detector; } From 28a518817850c442159691b08beef8d15d88b4fa Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Sun, 22 Jan 2023 00:28:59 -0500 Subject: [PATCH 11/18] Add hazard to effect volumes --- NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs index 272c559dc..6561460e1 100644 --- a/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/HazardVolumeBuilder.cs @@ -68,7 +68,7 @@ public static HazardVolume Make(GameObject planetGO, Sector sector, OWRigidbody { var submerge = go.AddComponent(); submerge._activeWhenSubmerged = false; - submerge._effectVolumes = new EffectVolume[] { visorFrostEffectVolume }; + submerge._effectVolumes = new EffectVolume[] { hazardVolume, visorFrostEffectVolume }; // THERE ARE NO RENDERERS??? RUH ROH!!! var detectorGO = new GameObject("ConstantFluidDetector"); From a98b2dd2f29c8c344b658773d8aeeff18aaae55e Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Sun, 22 Jan 2023 14:52:23 -0500 Subject: [PATCH 12/18] Add fallback key to rich presence --- NewHorizons/Handlers/PlanetCreationHandler.cs | 2 +- NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs | 8 ++++++++ .../OtherMods/OWRichPresence/RichPresenceHandler.cs | 8 ++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index c8191b91a..22ddba900 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -466,7 +466,7 @@ public static GameObject GenerateStandardBody(NewHorizonsBody body, bool default }); } - RichPresenceHandler.SetUpPlanet(body.Config.name, go, sector); + RichPresenceHandler.SetUpPlanet(body.Config.name, go, sector, body.Config.Star != null, body.Config.Atmosphere != null); Logger.LogVerbose($"Finished creating [{body.Config.name}]"); diff --git a/NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs b/NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs index e2132b89d..45ab90400 100644 --- a/NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs +++ b/NewHorizons/OtherMods/OWRichPresence/IRichPresenceAPI.cs @@ -9,6 +9,14 @@ public interface IRichPresenceAPI public void SetTriggerActivation(bool active); public GameObject CreateTrigger(GameObject parent, string message, string imageKey); public GameObject CreateTrigger(GameObject parent, Sector sector, string message, string imageKey); + public GameObject CreateTrigger(GameObject parent, string message, string imageKey, string fallback); + public GameObject CreateTrigger(GameObject parent, Sector sector, string message, string imageKey, string fallback); + public void CreateTriggerVolume(OWTriggerVolume triggerVolume, string message, string imageKey); + public void CreateTriggerVolume(OWTriggerVolume triggerVolume, string message, string imageKey, string fallback); + public GameObject CreateTriggerVolume(GameObject parent, float radius, string message, string imageKey); + public GameObject CreateTriggerVolume(GameObject parent, float radius, string message, string imageKey, string fallback); + public GameObject CreateTriggerVolume(GameObject parent, Vector3 localPosition, float radius, string message, string imageKey); + public GameObject CreateTriggerVolume(GameObject parent, Vector3 localPosition, float radius, string message, string imageKey, string fallback); public void SetCurrentRootPresence(string message, string imageKey); } } diff --git a/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs b/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs index 727bc0821..5be1fdecf 100644 --- a/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs +++ b/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs @@ -38,7 +38,7 @@ public static void Init() } } - public static void SetUpPlanet(string name, GameObject go, Sector sector) + public static void SetUpPlanet(string name, GameObject go, Sector sector, bool isStar = false, bool hasAtmosphere = false) { if (!Enabled) return; @@ -47,7 +47,11 @@ public static void SetUpPlanet(string name, GameObject go, Sector sector) var localizedName = TranslationHandler.GetTranslation(name, TranslationHandler.TextType.UI); var message = TranslationHandler.GetTranslation("RICH_PRESENCE_EXPLORING", TranslationHandler.TextType.UI).Replace("{0}", localizedName); - API.CreateTrigger(go, sector, message, name.Replace(" ", "").Replace("'", "").Replace("-", "").ToLowerInvariant()); + string fallbackKey = "defaultplanet"; + if (isStar) fallbackKey = "defaultstar"; + else if (hasAtmosphere) fallbackKey = "defaultplanetatmosphere"; + + API.CreateTrigger(go, sector, message, name.Replace(" ", "").Replace("'", "").Replace("-", "").ToLowerInvariant(), fallbackKey); } public static void OnStarSystemLoaded(string name) From 5b483466554e829a3324c34563d5f188dbc44148 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Sun, 22 Jan 2023 14:52:38 -0500 Subject: [PATCH 13/18] Change key to newhorizons --- NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs b/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs index 5be1fdecf..70ef21846 100644 --- a/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs +++ b/NewHorizons/OtherMods/OWRichPresence/RichPresenceHandler.cs @@ -63,7 +63,7 @@ public static void OnStarSystemLoaded(string name) var localizedName = ShipLogStarChartMode.UniqueIDToName(name); var message = TranslationHandler.GetTranslation("RICH_PRESENCE_EXPLORING", TranslationHandler.TextType.UI).Replace("{0}", localizedName); - API.SetCurrentRootPresence(message, "sun"); + API.SetCurrentRootPresence(message, "newhorizons"); } public static void OnChangeStarSystem(string destination) From 72ac673bcb61b21f17a5d41b0fb04d0d10e563a0 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 22 Jan 2023 14:58:39 -0500 Subject: [PATCH 14/18] Fix materials (thanks john) --- NewHorizons/Handlers/TitleSceneHandler.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Handlers/TitleSceneHandler.cs b/NewHorizons/Handlers/TitleSceneHandler.cs index b953b2bfd..783013b0d 100644 --- a/NewHorizons/Handlers/TitleSceneHandler.cs +++ b/NewHorizons/Handlers/TitleSceneHandler.cs @@ -65,6 +65,7 @@ public static void DisplayBodyOnTitleScreen(List bodies) var lightGO = new GameObject("Light"); lightGO.transform.parent = SearchUtilities.Find("Scene/Background").transform; lightGO.transform.localPosition = new Vector3(-47.9203f, 145.7596f, 43.1802f); + lightGO.transform.localRotation = Quaternion.Euler(13.1412f, 122.8785f, 169.4302f); var light = lightGO.AddComponent(); light.type = LightType.Directional; light.color = Color.white; @@ -103,7 +104,18 @@ private static GameObject LoadTitleScreenBody(NewHorizonsBody body) waterGO.transform.localScale = Vector3.one * size; var mr = waterGO.GetComponent(); - mr.material.color = body.Config.Water.tint?.ToColor() ?? Color.blue; + var colour = body.Config.Water.tint?.ToColor() ?? Color.blue; + mr.material.color = new Color(colour.r, colour.g, colour.b, 0.9f); + + // Make it transparent! + mr.material.SetOverrideTag("RenderType", "Transparent"); + mr.material.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One); + mr.material.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); + mr.material.SetInt("_ZWrite", 0); + mr.material.DisableKeyword("_ALPHATEST_ON"); + mr.material.DisableKeyword("_ALPHABLEND_ON"); + mr.material.EnableKeyword("_ALPHAPREMULTIPLY_ON"); + mr.material.renderQueue = (int)UnityEngine.Rendering.RenderQueue.Transparent; waterGO.transform.parent = titleScreenGO.transform; waterGO.transform.localPosition = Vector3.zero; @@ -119,6 +131,7 @@ private static GameObject LoadTitleScreenBody(NewHorizonsBody body) var mr = lavaGO.GetComponent(); mr.material.color = body.Config.Lava.tint?.ToColor() ?? Color.red; + mr.material.SetColor("_EmissionColor", mr.material.color * 2f); lavaGO.transform.parent = titleScreenGO.transform; lavaGO.transform.localPosition = Vector3.zero; @@ -131,7 +144,9 @@ private static GameObject LoadTitleScreenBody(NewHorizonsBody body) var size = 2f * Mathf.Max(body.Config.Sand.size, body.Config.Sand.size * body.Config.Sand.curve?.FirstOrDefault()?.value ?? 0f); sandGO.transform.localScale = Vector3.one * size; - sandGO.GetComponent().material.color = body.Config.Sand.tint?.ToColor() ?? Color.yellow; + var mr = sandGO.GetComponent(); + mr.material.color = body.Config.Sand.tint?.ToColor() ?? Color.yellow; + mr.material.SetFloat("_Glossiness", 0); sandGO.transform.parent = titleScreenGO.transform; sandGO.transform.localPosition = Vector3.zero; From 0cecf29799b6462d7ab9b4bcbcf18cf6ae5eea40 Mon Sep 17 00:00:00 2001 From: Nick Date: Sun, 22 Jan 2023 15:07:07 -0500 Subject: [PATCH 15/18] Update TitleSceneHandler.cs --- NewHorizons/Handlers/TitleSceneHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Handlers/TitleSceneHandler.cs b/NewHorizons/Handlers/TitleSceneHandler.cs index 783013b0d..45e515e49 100644 --- a/NewHorizons/Handlers/TitleSceneHandler.cs +++ b/NewHorizons/Handlers/TitleSceneHandler.cs @@ -83,7 +83,7 @@ private static GameObject LoadTitleScreenBody(NewHorizonsBody body) if (body.Config.HeightMap != null) { HeightMapBuilder.Make(titleScreenGO, null, body.Config.HeightMap, body.Mod, 30); - maxSize = body.Config.HeightMap.maxHeight; + maxSize = Mathf.Max(maxSize, body.Config.HeightMap.maxHeight, body.Config.HeightMap.minHeight); } if (body.Config.Atmosphere?.clouds?.texturePath != null && body.Config.Atmosphere?.clouds?.cloudsPrefab != CloudPrefabType.Transparent) { From e38b8b53192cf164afe6d36d205155aa1f4fa310 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sun, 22 Jan 2023 12:59:45 -0800 Subject: [PATCH 16/18] fix --- NewHorizons/Builder/Props/DetailBuilder.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index a09c83d8b..62f9cfdb2 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -315,7 +315,9 @@ private static void FixComponent(Component component, GameObject planetGO) if (component is DarkMatterSubmergeController submergeController) { var water = planetGO.GetComponentsInChildren().FirstOrDefault(x => x._fluidType == FluidVolume.Type.WATER); - submergeController._fluidDetector?.SetDetectableFluid(water); + // dont use SetDetectableFluid here because Awake hasn't been called yet + if (submergeController._fluidDetector) + submergeController._fluidDetector._onlyDetectableFluid = water; } // Fix anglerfish speed on orbiting planets From 7ebfd1ebf617942e7168ebfcc698be556206a7c7 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Sun, 22 Jan 2023 18:00:42 -0500 Subject: [PATCH 17/18] use planet sector if no primary body --- NewHorizons/Builder/Body/FunnelBuilder.cs | 6 ++++-- NewHorizons/Handlers/PlanetCreationHandler.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Builder/Body/FunnelBuilder.cs b/NewHorizons/Builder/Body/FunnelBuilder.cs index c3969e902..cde0e76aa 100644 --- a/NewHorizons/Builder/Body/FunnelBuilder.cs +++ b/NewHorizons/Builder/Body/FunnelBuilder.cs @@ -34,7 +34,7 @@ internal static void InitPrefabs() if (_lavaMaterial == null) _lavaMaterial = new Material(SearchUtilities.Find("VolcanicMoon_Body/MoltenCore_VM/LavaSphere").GetComponent().sharedMaterial).DontDestroyOnLoad(); } - public static void Make(GameObject planetGO, ConstantForceDetector detector, OWRigidbody rigidbody, FunnelModule module) + public static void Make(GameObject planetGO, Sector sector, ConstantForceDetector detector, OWRigidbody rigidbody, FunnelModule module) { InitPrefabs(); @@ -165,7 +165,9 @@ public static void Make(GameObject planetGO, ConstantForceDetector detector, OWR break; } - var sector = planetGO.GetComponent().GetPrimaryBody().GetRootSector(); + var primaryBody = planetGO.GetComponent().GetPrimaryBody(); + if (primaryBody != null) sector = primaryBody.GetRootSector(); + proxyGO.GetComponent().SetSector(sector); geoGO.GetComponent().SetSector(sector); volumesGO.GetComponent().SetSector(sector); diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index c8191b91a..ca07f1a19 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -638,7 +638,7 @@ private static GameObject SharedGenerateBody(NewHorizonsBody body, GameObject go if (body.Config.Funnel != null) { - FunnelBuilder.Make(go, go.GetComponentInChildren(), rb, body.Config.Funnel); + FunnelBuilder.Make(go, sector, go.GetComponentInChildren(), rb, body.Config.Funnel); } // Has to go last probably From d42df46a33c52303f29a9926713028744b10db39 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 23 Jan 2023 08:48:22 -0500 Subject: [PATCH 18/18] Only use primary body sector if its a binary focal point --- NewHorizons/Builder/Body/FunnelBuilder.cs | 8 +++++--- NewHorizons/Handlers/PlanetCreationHandler.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NewHorizons/Builder/Body/FunnelBuilder.cs b/NewHorizons/Builder/Body/FunnelBuilder.cs index cde0e76aa..aeeea8819 100644 --- a/NewHorizons/Builder/Body/FunnelBuilder.cs +++ b/NewHorizons/Builder/Body/FunnelBuilder.cs @@ -4,6 +4,7 @@ using UnityEngine; using Logger = NewHorizons.Utility.Logger; using NewHorizons.External.Modules.VariableSize; +using NewHorizons.Components.Orbital; namespace NewHorizons.Builder.Body { @@ -34,7 +35,7 @@ internal static void InitPrefabs() if (_lavaMaterial == null) _lavaMaterial = new Material(SearchUtilities.Find("VolcanicMoon_Body/MoltenCore_VM/LavaSphere").GetComponent().sharedMaterial).DontDestroyOnLoad(); } - public static void Make(GameObject planetGO, Sector sector, ConstantForceDetector detector, OWRigidbody rigidbody, FunnelModule module) + public static void Make(GameObject planetGO, Sector sector, OWRigidbody rigidbody, FunnelModule module) { InitPrefabs(); @@ -55,7 +56,7 @@ public static void Make(GameObject planetGO, Sector sector, ConstantForceDetecto var detectorGO = new GameObject("Detector_Funnel"); detectorGO.transform.parent = funnelGO.transform; var funnelDetector = detectorGO.AddComponent(); - funnelDetector._inheritDetector = detector; + funnelDetector._inheritDetector = planetGO.GetComponentInChildren(); funnelDetector._detectableFields = new ForceVolume[0]; detectorGO.AddComponent(); @@ -165,8 +166,9 @@ public static void Make(GameObject planetGO, Sector sector, ConstantForceDetecto break; } + // We take the sector of the binary focal point if it exists for this funnel (like with the twins) var primaryBody = planetGO.GetComponent().GetPrimaryBody(); - if (primaryBody != null) sector = primaryBody.GetRootSector(); + if (primaryBody?.GetComponent() != null) sector = primaryBody.GetRootSector(); proxyGO.GetComponent().SetSector(sector); geoGO.GetComponent().SetSector(sector); diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index ca07f1a19..6c2bb0a0c 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -638,7 +638,7 @@ private static GameObject SharedGenerateBody(NewHorizonsBody body, GameObject go if (body.Config.Funnel != null) { - FunnelBuilder.Make(go, sector, go.GetComponentInChildren(), rb, body.Config.Funnel); + FunnelBuilder.Make(go, sector, rb, body.Config.Funnel); } // Has to go last probably