From be9a036821015fbcd1019162776d265e0413fbcc Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Thu, 28 Jul 2022 19:17:38 -0500 Subject: [PATCH 01/22] Create bramble_colors.md --- docs/content/pages/reference/bramble_colors.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 docs/content/pages/reference/bramble_colors.md diff --git a/docs/content/pages/reference/bramble_colors.md b/docs/content/pages/reference/bramble_colors.md new file mode 100644 index 00000000..f6640344 --- /dev/null +++ b/docs/content/pages/reference/bramble_colors.md @@ -0,0 +1,15 @@ +--- +Title: Bramble Colors +Render_TOC: False +--- + +| Dimension | Fog color | Node color | +|-------------|------------------------------------------|-----------------------------------------| +| Cluster | | | +| Vessel | {"r": 206, "g": 187, "b": 137, "a": 255} | | +| Small Nest | {"r": 131, "g": 128, "b": 121, "a": 255} | | +| Pioneer | {"r": 106, "g": 116, "b": 99, "a": 255} | | +| Hub | {"r": 84, "g": 83, "b": 73, "a": 255} | | +| Exit Only | {"r": 113, "g": 107, "b": 81, "a": 255} | | +| Escape Pod | {"r": 83, "g": 99, "b": 87, "a": 255} | | +| Angler Nest | {"r": 113, "g": 107, "b": 81, "a": 255} | {"r": 255, "g": 129, "b": 83, "a": 255} | \ No newline at end of file From 7bd4f6cd3afeee7fde0f4fe159ca193d37859f83 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Thu, 28 Jul 2022 22:26:29 -0500 Subject: [PATCH 02/22] Fix fifth ring maybe --- NewHorizons/Builder/Props/NomaiTextBuilder.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/NewHorizons/Builder/Props/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiTextBuilder.cs index bc6da1a6..69a57bcd 100644 --- a/NewHorizons/Builder/Props/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiTextBuilder.cs @@ -81,7 +81,7 @@ namespace NewHorizons.Builder.Props _computerPrefab.name = "Prefab_NOM_Computer"; _computerPrefab.transform.rotation = Quaternion.identity; - _preCrashComputerPrefab = SearchUtilities.Find("DB_EscapePodDimension_Body/Sector_EscapePodDimension/Sector_EscapePodBody/Interactables_EscapePodBody/Prefab_NOM_Vessel_Computer").InstantiateInactive(); + _preCrashComputerPrefab = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_EscapePodCrashSite/Sector_CrashFragment/EscapePod_Socket/Interactibles_EscapePod/Prefab_NOM_Vessel_Computer").InstantiateInactive(); _preCrashComputerPrefab.name = "Prefab_NOM_Vessel_Computer"; _preCrashComputerPrefab.transform.rotation = Quaternion.identity; @@ -299,9 +299,6 @@ namespace NewHorizons.Builder.Props if (info.normal != null) up = planetGO.transform.TransformDirection(info.normal); computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation; - // Move it slightly up more - computerObject.transform.position += up.normalized * 0.1f; - var computer = computerObject.GetComponent(); computer.SetSector(sector); @@ -310,6 +307,15 @@ namespace NewHorizons.Builder.Props computer._nomaiTextAsset.name = Path.GetFileNameWithoutExtension(info.xmlFile); AddTranslation(xmlPath); + // Make fifth ring work + var fifthRingObject = computerObject.transform.Find("Props_NOM_Vessel_Computer 1/Props_NOM_Vessel_Computer_Effects (4)"); + fifthRingObject.SetActive(true); + var fifthRing = fifthRingObject.GetComponent(); + //fifthRing._baseProjectorColor = new Color(1.4118, 1.5367, 4, 1); + //fifthRing._baseTextColor = new Color(0.8824, 0.9604, 2.5, 1); + //fifthRing._baseTextShadowColor = new Color(0.3529, 0.3843, 1, 0.25); + fifthRing._computer = computer; + computerObject.SetActive(true); // All rings are rendered by detail builder so dont do that (have to wait for entries to be set) From bc768b26249554c04d57c9a2b77482ae4013ad97 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Thu, 28 Jul 2022 22:29:26 -0500 Subject: [PATCH 03/22] hn --- NewHorizons/Builder/Props/NomaiTextBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/NomaiTextBuilder.cs b/NewHorizons/Builder/Props/NomaiTextBuilder.cs index 69a57bcd..bf6986b9 100644 --- a/NewHorizons/Builder/Props/NomaiTextBuilder.cs +++ b/NewHorizons/Builder/Props/NomaiTextBuilder.cs @@ -308,7 +308,7 @@ namespace NewHorizons.Builder.Props AddTranslation(xmlPath); // Make fifth ring work - var fifthRingObject = computerObject.transform.Find("Props_NOM_Vessel_Computer 1/Props_NOM_Vessel_Computer_Effects (4)"); + var fifthRingObject = computerObject.FindChild("Props_NOM_Vessel_Computer 1/Props_NOM_Vessel_Computer_Effects (4)"); fifthRingObject.SetActive(true); var fifthRing = fifthRingObject.GetComponent(); //fifthRing._baseProjectorColor = new Color(1.4118, 1.5367, 4, 1); From 04825d6b427a058382cc97cf3b90934df2ba6c49 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Fri, 29 Jul 2022 18:50:22 -0500 Subject: [PATCH 04/22] Complete color table --- .../content/pages/reference/bramble_colors.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/content/pages/reference/bramble_colors.md b/docs/content/pages/reference/bramble_colors.md index f6640344..7e9d37d8 100644 --- a/docs/content/pages/reference/bramble_colors.md +++ b/docs/content/pages/reference/bramble_colors.md @@ -3,13 +3,13 @@ Title: Bramble Colors Render_TOC: False --- -| Dimension | Fog color | Node color | -|-------------|------------------------------------------|-----------------------------------------| -| Cluster | | | -| Vessel | {"r": 206, "g": 187, "b": 137, "a": 255} | | -| Small Nest | {"r": 131, "g": 128, "b": 121, "a": 255} | | -| Pioneer | {"r": 106, "g": 116, "b": 99, "a": 255} | | -| Hub | {"r": 84, "g": 83, "b": 73, "a": 255} | | -| Exit Only | {"r": 113, "g": 107, "b": 81, "a": 255} | | -| Escape Pod | {"r": 83, "g": 99, "b": 87, "a": 255} | | -| Angler Nest | {"r": 113, "g": 107, "b": 81, "a": 255} | {"r": 255, "g": 129, "b": 83, "a": 255} | \ No newline at end of file +| Dimension | Fog color | Node fog color | +|-------------|------------------------------------------|------------------------------------------| +| Cluster | {"r": 126, "g": 119, "b": 101, "a": 255} | {"r": 255, "g": 245, "b": 217, "a": 255} | +| Vessel | {"r": 206, "g": 187, "b": 137, "a": 255} | {"r": 191, "g": 171, "b": 133, "a": 255} | +| Small Nest | {"r": 131, "g": 128, "b": 121, "a": 255} | {"r": 255, "g": 245, "b": 217, "a": 255} | +| Pioneer | {"r": 106, "g": 116, "b": 99, "a": 255} | {"r": 255, "g": 245, "b": 217, "a": 255} | +| Hub | {"r": 84, "g": 83, "b": 73, "a": 255} | {"r": 84, "g": 83, "b": 73, "a": 255} | +| Exit Only | {"r": 113, "g": 107, "b": 81, "a": 255} | {"r": 255, "g": 245, "b": 217, "a": 255} | +| Escape Pod | {"r": 83, "g": 99, "b": 87, "a": 255} | {"r": 255, "g": 245, "b": 217, "a": 255} | +| Angler Nest | {"r": 113, "g": 107, "b": 81, "a": 255} | {"r": 255, "g": 129, "b": 83, "a": 255} | \ No newline at end of file From 59682158eb978da9dce33e76fa837108de4849ea Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Sat, 30 Jul 2022 20:04:48 -0500 Subject: [PATCH 05/22] Fix node fog scaling --- NewHorizons/Builder/Props/BrambleNodeBuilder.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index bae2b2c0..f2cfe2b4 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -232,7 +232,6 @@ namespace NewHorizons.Builder.Props { var fog = brambleNode.FindChild("Effects/InnerWarpFogSphere"); var fogMaterial = fog.GetComponent().material; - fog.transform.localScale /= config.scale; fogMaterial.SetFloat("_Radius", fogMaterial.GetFloat("_Radius") * config.scale); fogMaterial.SetFloat("_Density", fogMaterial.GetFloat("_Density") / config.scale); } From e343d679191a3b42ee3425a9eab5b8a527898777 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Sat, 30 Jul 2022 21:09:15 -0500 Subject: [PATCH 06/22] Fix seed puncture volume --- NewHorizons/Builder/Props/BrambleNodeBuilder.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index f2cfe2b4..3e98aa2b 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -235,6 +235,10 @@ namespace NewHorizons.Builder.Props fogMaterial.SetFloat("_Radius", fogMaterial.GetFloat("_Radius") * config.scale); fogMaterial.SetFloat("_Density", fogMaterial.GetFloat("_Density") / config.scale); } + else + { + brambleNode.FindChild("Prefab_SeedPunctureVolume (2)").GetComponent().enabled = true; + } // Change the colors if (config.isSeed) SetSeedColors(brambleNode, config.fogTint?.ToColor(), config.lightTint?.ToColor()); From f5efd7b9ce5db242300165d1189ac04f1f49b162 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Sun, 31 Jul 2022 22:31:55 -0500 Subject: [PATCH 07/22] Geyser tint and force --- NewHorizons/Builder/Props/GeyserBuilder.cs | 29 ++++++++++++++++++---- NewHorizons/External/Modules/PropModule.cs | 10 ++++++++ 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/NewHorizons/Builder/Props/GeyserBuilder.cs b/NewHorizons/Builder/Props/GeyserBuilder.cs index 35d8a3f1..e79629cd 100644 --- a/NewHorizons/Builder/Props/GeyserBuilder.cs +++ b/NewHorizons/Builder/Props/GeyserBuilder.cs @@ -24,9 +24,21 @@ namespace NewHorizons.Builder.Props var up = planetGO.transform.TransformPoint(pos) - planetGO.transform.position; geyserGO.transform.rotation = Quaternion.FromToRotation(geyserGO.transform.up, up) * geyserGO.transform.rotation; - if (info.disableBubbles) geyserGO.FindChild("GeyserParticles/GeyserBubbles").SetActive(false); - if (info.disableShaft) geyserGO.FindChild("GeyserParticles/GeyserShaft").SetActive(false); - if (info.disableSpout) geyserGO.FindChild("GeyserParticles/GeyserSpout").SetActive(false); + var bubbles = geyserGO.FindChild("GeyserParticles/GeyserBubbles"); + var shaft = geyserGO.FindChild("GeyserParticles/GeyserShaft"); + var spout = geyserGO.FindChild("GeyserParticles/GeyserSpout"); + + if (info.tint != null) + { + var tint = info.tint.ToColor(); + bubbles.GetComponent().material.color = new Color(tint.r, tint.g, tint.b, Mathf.LerpUnclamped(0.5f, 1f, tint.a)); //bubbles disappear at 0.5 alpha + shaft.GetComponent().material.color = tint; + spout.GetComponent().material.color = tint; + } + + if (info.disableBubbles) bubbles.SetActive(false); + if (info.disableShaft) shaft.SetActive(false); + if (info.disableSpout) spout.SetActive(false); geyserGO.SetActive(true); @@ -35,8 +47,15 @@ namespace NewHorizons.Builder.Props // Do this after awake Delay.FireOnNextUpdate(() => geyserFluidVolume._maxHeight = 1); - geyserFluidVolume.enabled = true; // why do we enable this? idk - geyserFluidVolume.GetComponent().enabled = true; // i think this is already enabled but wtv + if (info.force == 0f) geyserFluidVolume.enabled = false; + else + { + geyserFluidVolume.enabled = true; // why do we enable this? idk + geyserFluidVolume.GetComponent().enabled = true; // i think this is already enabled but wtv + + geyserFluidVolume._attractionalFlowSpeed *= info.force / 55f; + geyserFluidVolume._directionalFlowSpeed = info.force; + } } } } diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 5b56fc5b..01d2f724 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -224,6 +224,16 @@ namespace NewHorizons.External.Modules /// [DefaultValue(-97.5f)] public float offset = -97.5f; + /// + /// Force of the geyser on objects + /// + [DefaultValue(55f)] public float force = 55f; + + /// + /// Color of the geyser. Alpha sets the particle density. + /// + public MColor tint; + /// /// Disable the individual particle systems of the geyser /// From ac7e65d4bfe2b8cf942ab6a30b56c088b3549246 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 1 Aug 2022 03:35:52 +0000 Subject: [PATCH 08/22] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 0336564e..d74800e7 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1098,6 +1098,16 @@ "format": "float", "default": -97.5 }, + "force": { + "type": "number", + "description": "Force of the geyser on objects", + "format": "float", + "default": 55.0 + }, + "tint": { + "description": "Color of the geyser. Alpha sets the particle density.", + "$ref": "#/definitions/MColor" + }, "disableBubbles": { "type": "boolean", "description": "Disable the individual particle systems of the geyser" From 342599cb968df51e86aa31de398eb065a9db27f6 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Mon, 1 Aug 2022 16:19:28 -0500 Subject: [PATCH 09/22] Dimension scale fixes --- .../Builder/Body/BrambleDimensionBuilder.cs | 20 +++++++++++-------- NewHorizons/External/Modules/BrambleModule.cs | 9 +++++++-- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index b3a15493..26bd70fa 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -22,7 +22,7 @@ namespace NewHorizons.Builder.Body public static class BrambleDimensionBuilder { - public static readonly float BASE_DIMENSION_RADIUS = 1705f; + public static readonly float BASE_DIMENSION_RADIUS = 750f; // location of all vanilla bramble dimensions //-9116.795 -19873.44 2480.327 @@ -57,7 +57,7 @@ namespace NewHorizons.Builder.Body var volumes = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Volumes_HubDimension").InstantiateInactive(); var effects = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Effects_HubDimension").InstantiateInactive(); var geometry = DetailBuilder.MakeDetail(go, sector, "DB_HubDimension_Body/Sector_HubDimension/Geometry_HubDimension", Vector3.zero, Vector3.zero, 1, false); - var exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/OuterWarp_Hub").InstantiateInactive(); + var exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Interactables_HubDimension/OuterWarp_Hub").InstantiateInactive(); var repelVolume = SearchUtilities.Find("DB_HubDimension_Body/BrambleRepelVolume").InstantiateInactive(); atmo.name = "Atmosphere"; @@ -150,13 +150,15 @@ namespace NewHorizons.Builder.Body // Set the scale var scale = config.radius / BASE_DIMENSION_RADIUS; geometry.transform.localScale = Vector3.one * scale; + sector.gameObject.GetComponent().radius *= scale; outerFogWarpVolume._warpRadius *= scale; outerFogWarpVolume._exitRadius *= scale; var fogGO = atmo.FindChild("FogSphere_Hub"); var fog = fogGO.GetComponent(); fog._fogRadius *= scale; - fog._fogDensity *= scale; + fog._fogDensity = config.fogDensity * scale; + atmo.FindChild("FogBackdrop_Hub").transform.localScale *= scale; var volumesShape = volumes.FindChild("ZeroG_Fluid_Audio_Volume"); var sphereShape = volumesShape.GetComponent(); @@ -164,17 +166,19 @@ namespace NewHorizons.Builder.Body sphereShape.radius *= scale; // Change fog color - if (body.Config.Bramble.dimension.fogTint != null) + if (config.fogTint != null) { - var color = body.Config.Bramble.dimension.fogTint.ToColor(); + var color = config.fogTint.ToColor(); fog.fogTint = color; outerFogWarpVolume._fogColor = color; } - // Set up repel volume to only contain this dimension + // Set up repel volume and cloak to scale and only contain this dimension // The base game one is on the HUB dimension and encompasses all bramble dimensions and their sectors - var cloak = repelVolume.gameObject.GetComponentInChildren(); - cloak.transform.localScale = Vector3.one * 4000f; + repelVolume.GetComponent().radius = 2400f * scale; + repelVolume.GetComponent()._innerRadius = 2010f * scale; + var cloak = repelVolume.GetComponentInChildren(); + cloak.transform.localScale = Vector3.one * 4020f * scale; cloak._sectors = new Sector[] { sector }; cloak.GetComponent().enabled = true; diff --git a/NewHorizons/External/Modules/BrambleModule.cs b/NewHorizons/External/Modules/BrambleModule.cs index e848afa7..43e0cb38 100644 --- a/NewHorizons/External/Modules/BrambleModule.cs +++ b/NewHorizons/External/Modules/BrambleModule.cs @@ -32,15 +32,20 @@ namespace NewHorizons.External.Modules /// public MColor fogTint; + /// + /// The density of the fog inside this dimension. The default is 6. + /// + [DefaultValue(6f)] public float fogDensity = 6f; + /// /// The name of the *node* that the player is taken to when exiting this dimension. /// public string linksTo; /// - /// The internal radius (in meters) of the dimension. The default is 1705. + /// The internal radius (in meters) of the dimension. The default is 750 for the Hub, Escape Pod, and Angler Nest dimensions, and 500 for the others. /// - [DefaultValue(1705f)] public float radius = 1705f; + [DefaultValue(750f)] public float radius = 750f; /// /// An array of integers from 0-5. By default, all entrances are allowed. To force this dimension to warp players in from only one point (like the anglerfish nest dimension in the base game) set this value to [3], [5], or similar. Values of 0-5 only. From 154d51023fabca129aeb6e7e5499541f938e1ae0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 1 Aug 2022 21:22:28 +0000 Subject: [PATCH 10/22] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index d74800e7..ff7a4bd7 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -535,15 +535,21 @@ "description": "The color of the fog inside this dimension. Leave blank for the default yellowish color: (113, 107, 81)", "$ref": "#/definitions/MColor" }, + "fogDensity": { + "type": "number", + "description": "The density of the fog inside this dimension. The default is 6.", + "format": "float", + "default": 6.0 + }, "linksTo": { "type": "string", "description": "The name of the *node* that the player is taken to when exiting this dimension." }, "radius": { "type": "number", - "description": "The internal radius (in meters) of the dimension. The default is 1705.", + "description": "The internal radius (in meters) of the dimension. The default is 750 for the Hub, Escape Pod, and Angler Nest dimensions, and 500 for the others.", "format": "float", - "default": 1705.0 + "default": 750.0 }, "allowedEntrances": { "type": "array", From 8037b37aef6b044b080463cb5fb4cb369b86a83a Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Sat, 6 Aug 2022 00:06:44 -0500 Subject: [PATCH 11/22] Bramble node scale/color overhaul --- .../Builder/Props/BrambleNodeBuilder.cs | 186 ++++++++++++------ NewHorizons/External/Modules/BrambleModule.cs | 21 +- 2 files changed, 143 insertions(+), 64 deletions(-) diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index 3e98aa2b..04eb9936 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -175,6 +175,7 @@ namespace NewHorizons.Builder.Props } var innerFogWarpVolume = brambleNode.GetComponent(); + var outerFogWarpVolume = GetOuterFogWarpVolumeFromAstroObject(go); var fogLight = brambleNode.GetComponent(); brambleNode.transform.parent = sector.transform; @@ -192,8 +193,6 @@ namespace NewHorizons.Builder.Props fogLight._innerWarp = innerFogWarpVolume; fogLight._linkedFogLights = new List(); fogLight._linkedLightData = new List(); - - sector.RegisterFogLight(fogLight); // If the config says only certain exits are allowed, enforce that if (config.possibleExits != null) @@ -221,35 +220,91 @@ namespace NewHorizons.Builder.Props // TODO: replace InnerFogWarpVolume with NHInnerFogWarpVolume, which overrides GetFogDensity to // account for scale (this will fix the issue with screen fog caused by scaled down nodes) - // Set the scale + // Set the main scale brambleNode.transform.localScale = Vector3.one * config.scale; innerFogWarpVolume._warpRadius *= config.scale; innerFogWarpVolume._exitRadius *= config.scale; - // Seed fog works differently, so it doesn't need to be fixed - // (it's also located on a different child path, so the below FindChild calls wouldn't work) - if (!config.isSeed) + // Set the seed/node specific scales and other stuff + if (config.isSeed) { + innerFogWarpVolume._exitRadius /= 1.8f; + brambleNode.FindChild("PointLight_DB_FogLight").GetComponent().range *= config.scale; + brambleNode.FindChild("Prefab_SeedPunctureVolume (2)").GetComponent().enabled = true; + fogLight._maxVisibleDistance = float.PositiveInfinity; // Prefab does have working foglight aside from this + fogLight._minVisibleDistance *= config.scale / 15f; + } + else + { + brambleNode.FindChild("Effects/PointLight_DB_FogLight").GetComponent().range *= config.scale; + brambleNode.FindChild("Effects/FogOverrideVolume").GetComponent().blendDistance *= config.scale; + fogLight._minVisibleDistance *= config.scale; + + // Seed fog works differently, so it doesn't need to be fixed + // (it's also located on a different child path, so the below FindChild calls wouldn't work) var fog = brambleNode.FindChild("Effects/InnerWarpFogSphere"); var fogMaterial = fog.GetComponent().material; fogMaterial.SetFloat("_Radius", fogMaterial.GetFloat("_Radius") * config.scale); fogMaterial.SetFloat("_Density", fogMaterial.GetFloat("_Density") / config.scale); } + + // Set colors + Color fogTint, farFogTint, fogLightTint, lightTint, lightShaftTint, glowTint, fogOverrideTint; + + farFogTint = config.fogTint != null ? config.fogTint.ToColor() : new Color(1f, 0.9608f, 0.851f, 1f); + lightTint = config.lightTint != null ? config.lightTint.ToColor() : Color.white; + + Color.RGBToHSV(farFogTint, out var fogH, out var fogS, out var fogV); + Color.RGBToHSV(lightTint, out var lightH, out var lightS, out var lightV); + + if (config.isSeed) + { + fogLightTint = lightTint; + fogLightTint.a = config.hasFogLight != true ? 0f : lightTint.a * 0.5f; + + lightShaftTint = Color.HSVToRGB(lightH, -Mathf.Pow(lightS - 1, 2f) + 1f, lightV); // Inverted parabola is best fit + lightShaftTint.a = lightTint.a; + } else { - brambleNode.FindChild("Prefab_SeedPunctureVolume (2)").GetComponent().enabled = true; + fogLightTint = lightTint; + fogLightTint.a = config.hasFogLight == false || (outerFogWarpVolume == null && config.hasFogLight != true) ? 0f : lightTint.a * 0.5f; + + lightShaftTint = Color.HSVToRGB(fogH, -Mathf.Pow(fogS - 1, 2f) + 1f, fogV); // Inverted parabola is best fit + lightShaftTint.a = lightTint.a; } - // Change the colors - if (config.isSeed) SetSeedColors(brambleNode, config.fogTint?.ToColor(), config.lightTint?.ToColor()); - else SetNodeColors(brambleNode, config.fogTint?.ToColor(), config.lightTint?.ToColor()); + // Apply colors + Delay.FireOnNextUpdate(() => { + if (config.isSeed) + { + SetSeedColors(brambleNode, farFogTint, fogLightTint, lightTint, lightShaftTint); + } + else + { + // Set inner fog to destination fog tint + fogTint = AstroObjectLocator.GetAstroObject(config.linksTo).gameObject.FindChild("Sector/Atmosphere/FogSphere_Hub").GetComponent().fogTint; - innerFogWarpVolume._useFarFogColor = false; - if (config.farFogTint != null) - { - innerFogWarpVolume._useFarFogColor = true; - innerFogWarpVolume._farFogColor = config.farFogTint.ToColor(); - } + // Calculate glow and fog override + Color dimFogTint; + if (go.GetComponentInChildren()) + { + dimFogTint = go.GetComponentInChildren().fogTint; + Color.RGBToHSV(dimFogTint, out var dimH, out var dimS, out var dimV); + Color.RGBToHSV(lightShaftTint, out var shaftH, out var shaftS, out var shaftV); + glowTint = Color.HSVToRGB(shaftH, shaftS, dimV * 1.25f); + glowTint.a = lightTint.a; + fogOverrideTint = Color.HSVToRGB(fogH, Mathf.Lerp(fogS, dimS, 0.5f), Mathf.Lerp(fogV, dimV, 0.5f)); + fogOverrideTint.a = 1f; + } + else + { + glowTint = fogOverrideTint = Color.clear; + } + + SetNodeColors(brambleNode, fogTint, farFogTint, fogLightTint, lightTint, lightShaftTint, glowTint, fogOverrideTint); + } + }); // Set up warps innerFogWarpVolume._sector = sector; @@ -257,7 +312,7 @@ namespace NewHorizons.Builder.Props // the OuterFogWarpVolume of the dimension this node is inside of // (null if this node is not inside of a bramble dimension, eg it's sitting on a planet or something) - innerFogWarpVolume._containerWarpVolume = GetOuterFogWarpVolumeFromAstroObject(go); + innerFogWarpVolume._containerWarpVolume = outerFogWarpVolume; var success = PairEntrance(innerFogWarpVolume, config.linksTo); if (!success) RecordUnpairedNode(innerFogWarpVolume, config.linksTo); @@ -287,58 +342,71 @@ namespace NewHorizons.Builder.Props return brambleNode; } - public static void SetNodeColors(GameObject brambleNode, Color? fogTint, Color? lightTint) + public static void SetNodeColors(GameObject brambleNode, Color fogTint, Color farFogTint, Color fogLightTint, Color lightTint, Color lightShaftTint, Color glowTint, Color fogOverrideTint) { - if (fogTint != null) + var innerFogWarpVolume = brambleNode.GetComponent(); + innerFogWarpVolume._fogColor = fogTint; + innerFogWarpVolume._farFogColor = farFogTint; + + var fogLight = brambleNode.GetComponent(); + fogLight._maxAlpha = fogLightTint.a; + fogLight._primaryLightData.maxAlpha = fogLightTint.a; + fogLight._tint = fogLightTint; + fogLight._primaryLightData.color = fogLightTint; + + var light = brambleNode.FindChild("Effects/PointLight_DB_FogLight").GetComponent(); + light.intensity = lightTint.a * 0.7f; + light.color = lightTint; + + var lightShafts = brambleNode.FindChild("Effects/DB_BrambleLightShafts"); + var lightShaft1 = lightShafts.FindChild("BrambleLightShaft1"); + var mat = lightShaft1.GetComponent().material; + mat.color = lightShaftTint; + for (int i = 1; i <= 6; i++) { - var fogRenderer = brambleNode.GetComponent(); - - fogRenderer._fogColor = fogTint.Value; - - var fogBackdrop = brambleNode.FindChild("Terrain_DB_BrambleSphere_Inner_v2/fogbackdrop_v2"); - if (fogBackdrop != null) - fogBackdrop.GetComponent().material.color = fogTint.Value; + var lightShaft = lightShafts.FindChild($"BrambleLightShaft{i}"); + lightShaft.GetComponent().sharedMaterial = mat; } - if (lightTint != null) + var glow = brambleNode.FindChild("Effects/InnerWarpFogGlow"); + glow.GetComponent().material.color = glowTint; + glow.transform.localScale *= glowTint.a; + if (glowTint.a == 0f) glow.SetActive(false); + + var fogOverride = brambleNode.FindChild("Effects/FogOverrideVolume"); + if (fogOverrideTint.a == 1f) // Override turns goofy if alpha isn't 1 { - var lightShafts = brambleNode.FindChild("Effects/DB_BrambleLightShafts"); - - var lightShaft1 = lightShafts.FindChild("BrambleLightShaft1"); - var mat = lightShaft1.GetComponent().material; - mat.color = lightTint.Value; - - for (int i = 1; i <= 6; i++) - { - var lightShaft = lightShafts.FindChild($"BrambleLightShaft{i}"); - lightShaft.GetComponent().sharedMaterial = mat; - } + var volume = fogOverride.GetComponent(); + volume.tint = fogOverrideTint; + volume.blendDistance *= lightTint.a; + volume.radius *= lightTint.a; } + else fogOverride.SetActive(false); } - public static void SetSeedColors(GameObject brambleSeed, Color? fogTint, Color? lightTint) + public static void SetSeedColors(GameObject brambleSeed, Color farFogTint, Color fogLightTint, Color lightTint, Color lightShaftTint) { - if (fogTint != null) + brambleSeed.GetComponent()._fogColor = farFogTint; + brambleSeed.FindChild("VolumetricFogSphere (2)").GetComponent().material.color = new Color(farFogTint.r * 10, farFogTint.g * 10, farFogTint.b * 10, farFogTint.a); + + var fogLight = brambleSeed.GetComponent(); + fogLight._maxAlpha = fogLightTint.a; + fogLight._primaryLightData.maxAlpha = fogLightTint.a; + fogLight._tint = fogLightTint; + fogLight._primaryLightData.color = fogLightTint; + + var light = brambleSeed.FindChild("PointLight_DB_FogLight").GetComponent(); + light.intensity = lightTint.a; + light.color = lightTint; + + var lightShafts = brambleSeed.FindChild("Terrain_DB_BrambleSphere_Seed_V2 (2)/DB_SeedLightShafts"); + var lightShaft1 = lightShafts.FindChild("DB_SeedLightShafts1"); + var mat = lightShaft1.GetComponent().material; + mat.color = lightShaftTint; + for (int i = 1; i <= 6; i++) { - var fogRenderer = brambleSeed.FindChild("VolumetricFogSphere (2)"); - - var fogMeshRenderer = fogRenderer.GetComponent(); - fogMeshRenderer.material.color = fogTint.Value; - } - - if (lightTint != null) - { - var lightShafts = brambleSeed.FindChild("Terrain_DB_BrambleSphere_Seed_V2 (2)/DB_SeedLightShafts"); - - var lightShaft1 = lightShafts.FindChild("DB_SeedLightShafts1"); - var mat = lightShaft1.GetComponent().material; - mat.color = lightTint.Value; - - for (int i = 1; i <= 6; i++) - { - var lightShaft = lightShafts.FindChild($"DB_SeedLightShafts{i}"); - lightShaft.GetComponent().sharedMaterial = mat; - } + var lightShaft = lightShafts.FindChild($"DB_SeedLightShafts{i}"); + lightShaft.GetComponent().sharedMaterial = mat; } } } diff --git a/NewHorizons/External/Modules/BrambleModule.cs b/NewHorizons/External/Modules/BrambleModule.cs index 43e0cb38..43308006 100644 --- a/NewHorizons/External/Modules/BrambleModule.cs +++ b/NewHorizons/External/Modules/BrambleModule.cs @@ -68,7 +68,8 @@ namespace NewHorizons.External.Modules public MVector3 rotation; /// - /// The physical scale of the node, as a multiplier of the original size + /// The physical scale of the node, as a multiplier of the original size. + /// Nodes are 150m across, seeds are 10m across. /// [DefaultValue(1f)] public float scale = 1f; @@ -88,24 +89,34 @@ namespace NewHorizons.External.Modules [DefaultValue(false)] public bool isSeed = false; /// - /// The color of the fog inside the node. Leave blank for the default yellowish color: (131, 124, 105, 255) + /// The color of the fog inside the node. + /// Leave blank for the default yellowish white color: (255, 245, 217, 255) /// public MColor fogTint; /// - /// The color of the shafts of light coming from the entrances to the node. Leave blank for the default yellowish color: (131, 124, 105, 255) + /// The color of the light from the node. Alpha controls brightness. + /// Leave blank for the default white color. /// public MColor lightTint; /// - /// The color a dimension's background fog turns when you approach this node (if it's in a dimension). If this node is not in a dimension, this does nothing. Leave blank for the default yellowish white color: (255, 245, 217, 255) + /// Should this node have a point of light from afar? + /// By default, nodes will have a foglight, while seeds won't, and neither will if not in a dimension. /// - public MColor farFogTint; + public bool? hasFogLight; /// /// An array of integers from 0-5. By default, all exits are allowed. To force this node to warp players out from only one hole set this value to [3], [5], or similar. Values of 0-5 only. /// public int[] possibleExits; + + #region Obsolete + + [Obsolete("farFogTint is deprecated, please use fogTint instead")] + public MColor farFogTint; + + #endregion Obsolete } } } From a8135d904edf54b253721223d98f166e1807f418 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 6 Aug 2022 05:09:14 +0000 Subject: [PATCH 12/22] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index ff7a4bd7..60fa8a75 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -575,7 +575,7 @@ }, "scale": { "type": "number", - "description": "The physical scale of the node, as a multiplier of the original size", + "description": "The physical scale of the node, as a multiplier of the original size. \nNodes are 150m across, seeds are 10m across.", "format": "float", "default": 1.0 }, @@ -593,16 +593,19 @@ "default": false }, "fogTint": { - "description": "The color of the fog inside the node. Leave blank for the default yellowish color: (131, 124, 105, 255)", + "description": "The color of the fog inside the node. \nLeave blank for the default yellowish white color: (255, 245, 217, 255)", "$ref": "#/definitions/MColor" }, "lightTint": { - "description": "The color of the shafts of light coming from the entrances to the node. Leave blank for the default yellowish color: (131, 124, 105, 255)", + "description": "The color of the light from the node. Alpha controls brightness.\nLeave blank for the default white color.", "$ref": "#/definitions/MColor" }, - "farFogTint": { - "description": "The color a dimension's background fog turns when you approach this node (if it's in a dimension). If this node is not in a dimension, this does nothing. Leave blank for the default yellowish white color: (255, 245, 217, 255)", - "$ref": "#/definitions/MColor" + "hasFogLight": { + "type": [ + "boolean", + "null" + ], + "description": "Should this node have a point of light from afar? \nBy default, nodes will have a foglight, while seeds won't, and neither will if not in a dimension." }, "possibleExits": { "type": "array", From e7b250300ceb58885a292ce9fa164d7cdd2e3fa8 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Sun, 7 Aug 2022 16:04:28 -0500 Subject: [PATCH 13/22] conflict --- NewHorizons/Builder/Body/BrambleDimensionBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index 26bd70fa..774b1a7b 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -57,7 +57,7 @@ namespace NewHorizons.Builder.Body var volumes = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Volumes_HubDimension").InstantiateInactive(); var effects = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Effects_HubDimension").InstantiateInactive(); var geometry = DetailBuilder.MakeDetail(go, sector, "DB_HubDimension_Body/Sector_HubDimension/Geometry_HubDimension", Vector3.zero, Vector3.zero, 1, false); - var exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Interactables_HubDimension/OuterWarp_Hub").InstantiateInactive(); + var exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/OuterWarp_Hub").InstantiateInactive(); var repelVolume = SearchUtilities.Find("DB_HubDimension_Body/BrambleRepelVolume").InstantiateInactive(); atmo.name = "Atmosphere"; From c566e9658536c0c89d990f2234c1d9231ce351d8 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Sun, 7 Aug 2022 16:06:24 -0500 Subject: [PATCH 14/22] undo --- NewHorizons/Builder/Body/BrambleDimensionBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs index 90c74f4e..7c7c7ce6 100644 --- a/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs +++ b/NewHorizons/Builder/Body/BrambleDimensionBuilder.cs @@ -62,7 +62,7 @@ namespace NewHorizons.Builder.Body var detailInfo = new PropModule.DetailInfo(); var geometry = DetailBuilder.MakeDetail(go, sector, prefab, detailInfo); - var exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/OuterWarp_Hub").InstantiateInactive(); + var exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Interactables_HubDimension/OuterWarp_Hub").InstantiateInactive(); var repelVolume = SearchUtilities.Find("DB_HubDimension_Body/BrambleRepelVolume").InstantiateInactive(); atmo.name = "Atmosphere"; From cfcf1ceb54a893bf3c96f630a024de1ff4c08a78 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Mon, 8 Aug 2022 16:08:12 -0500 Subject: [PATCH 15/22] Light shaft hue shift --- NewHorizons/Builder/Props/BrambleNodeBuilder.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index 04eb9936..cb46855c 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -262,7 +262,7 @@ namespace NewHorizons.Builder.Props fogLightTint = lightTint; fogLightTint.a = config.hasFogLight != true ? 0f : lightTint.a * 0.5f; - lightShaftTint = Color.HSVToRGB(lightH, -Mathf.Pow(lightS - 1, 2f) + 1f, lightV); // Inverted parabola is best fit + lightShaftTint = CalculateLightShaftTint(lightH, lightS, lightV); lightShaftTint.a = lightTint.a; } else @@ -270,7 +270,7 @@ namespace NewHorizons.Builder.Props fogLightTint = lightTint; fogLightTint.a = config.hasFogLight == false || (outerFogWarpVolume == null && config.hasFogLight != true) ? 0f : lightTint.a * 0.5f; - lightShaftTint = Color.HSVToRGB(fogH, -Mathf.Pow(fogS - 1, 2f) + 1f, fogV); // Inverted parabola is best fit + lightShaftTint = CalculateLightShaftTint(fogH, fogS, fogV); lightShaftTint.a = lightTint.a; } @@ -286,6 +286,7 @@ namespace NewHorizons.Builder.Props fogTint = AstroObjectLocator.GetAstroObject(config.linksTo).gameObject.FindChild("Sector/Atmosphere/FogSphere_Hub").GetComponent().fogTint; // Calculate glow and fog override + // Will work with any fog Color dimFogTint; if (go.GetComponentInChildren()) { @@ -340,6 +341,17 @@ namespace NewHorizons.Builder.Props // Done! brambleNode.SetActive(true); return brambleNode; + + static Color CalculateLightShaftTint(float H, float S, float V) + { + // Sine curve approximation shifts hue to compensate for shader shenanigans + H += -1f / 24f * Mathf.Sin(6f * Mathf.PI * H); + + // Inverted parabola is best fit for limited base game examples + S = -Mathf.Pow(S - 1f, 2f) + 1f; + + return Color.HSVToRGB(H, S, V); + } } public static void SetNodeColors(GameObject brambleNode, Color fogTint, Color farFogTint, Color fogLightTint, Color lightTint, Color lightShaftTint, Color glowTint, Color fogOverrideTint) From da8ef0db921aecd18ba60eb7632b672e0cd09d82 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Tue, 9 Aug 2022 14:45:16 -0500 Subject: [PATCH 16/22] Geyser audio --- NewHorizons/Builder/Props/GeyserBuilder.cs | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/NewHorizons/Builder/Props/GeyserBuilder.cs b/NewHorizons/Builder/Props/GeyserBuilder.cs index e79629cd..2013915a 100644 --- a/NewHorizons/Builder/Props/GeyserBuilder.cs +++ b/NewHorizons/Builder/Props/GeyserBuilder.cs @@ -56,6 +56,30 @@ namespace NewHorizons.Builder.Props geyserFluidVolume._attractionalFlowSpeed *= info.force / 55f; geyserFluidVolume._directionalFlowSpeed = info.force; } + + geyserGO.GetComponent().SetSector(sector); + var oneShotAudio = geyserGO.FindChild("Geyser_OneShotAudioSrc"); + var loopAudio = geyserGO.FindChild("Geyser_LoopAudioSrc"); + oneShotAudio.GetComponent().SetSector(sector); + loopAudio.GetComponent().SetSector(sector); + + // Someone might want a geyser just for its force maybe idk + if (info.disableSpout & info.disableShaft & info.disableBubbles) + { + oneShotAudio.SetActive(false); + loopAudio.SetActive(false); + } + // Disable start/end sounds if its just bubbles + else if (info.disableSpout & info.disableShaft) + { + oneShotAudio.SetActive(false); + } + // If it starts at the shaft, move the start/end sounds to it + else if ((info.disableSpout & !info.disableShaft) | info.offset == -67f) + { + oneShotAudio.transform.SetLocalPositionY(67f); + } + } } } From 2ce2241e7be7c6032bb03be7385597fa2f506783 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Tue, 9 Aug 2022 22:03:28 -0500 Subject: [PATCH 17/22] Geyser durations --- NewHorizons/Builder/Props/GeyserBuilder.cs | 4 +++- NewHorizons/External/Modules/PropModule.cs | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/GeyserBuilder.cs b/NewHorizons/Builder/Props/GeyserBuilder.cs index 2013915a..f8784c3d 100644 --- a/NewHorizons/Builder/Props/GeyserBuilder.cs +++ b/NewHorizons/Builder/Props/GeyserBuilder.cs @@ -39,6 +39,9 @@ namespace NewHorizons.Builder.Props if (info.disableBubbles) bubbles.SetActive(false); if (info.disableShaft) shaft.SetActive(false); if (info.disableSpout) spout.SetActive(false); + var geyserController = geyserGO.GetComponent(); + geyserController._activeDuration = info.activeDuration; + geyserController._inactiveDuration = info.inactiveDuration; geyserGO.SetActive(true); @@ -79,7 +82,6 @@ namespace NewHorizons.Builder.Props { oneShotAudio.transform.SetLocalPositionY(67f); } - } } } diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index f68acbc7..c0a1db0e 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -239,6 +239,16 @@ namespace NewHorizons.External.Modules /// [DefaultValue(55f)] public float force = 55f; + /// + /// Time in seconds eruptions last for + /// + [DefaultValue(10f)] public float activeDuration = 10f; + + /// + /// Time in seconds between eruptions + /// + [DefaultValue(19f)] public float inactiveDuration = 19f; + /// /// Color of the geyser. Alpha sets the particle density. /// From 2833089e9ddc46ff2dbe809cf9f80b50f2f91ccd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 10 Aug 2022 03:06:08 +0000 Subject: [PATCH 18/22] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index a594026f..23b03948 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1124,6 +1124,18 @@ "format": "float", "default": 55.0 }, + "activeDuration": { + "type": "number", + "description": "Time in seconds eruptions last for", + "format": "float", + "default": 10.0 + }, + "inactiveDuration": { + "type": "number", + "description": "Time in seconds between eruptions", + "format": "float", + "default": 19.0 + }, "tint": { "description": "Color of the geyser. Alpha sets the particle density.", "$ref": "#/definitions/MColor" From 17be25189d106f44f03215aa598ca000618c6d8c Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Wed, 10 Aug 2022 13:39:27 -0500 Subject: [PATCH 19/22] Geyser volume --- NewHorizons/Builder/Props/GeyserBuilder.cs | 27 ++++++++++++---------- NewHorizons/External/Modules/PropModule.cs | 5 ++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/NewHorizons/Builder/Props/GeyserBuilder.cs b/NewHorizons/Builder/Props/GeyserBuilder.cs index f8784c3d..5b04150c 100644 --- a/NewHorizons/Builder/Props/GeyserBuilder.cs +++ b/NewHorizons/Builder/Props/GeyserBuilder.cs @@ -39,6 +39,7 @@ namespace NewHorizons.Builder.Props if (info.disableBubbles) bubbles.SetActive(false); if (info.disableShaft) shaft.SetActive(false); if (info.disableSpout) spout.SetActive(false); + var geyserController = geyserGO.GetComponent(); geyserController._activeDuration = info.activeDuration; geyserController._inactiveDuration = info.inactiveDuration; @@ -66,19 +67,21 @@ namespace NewHorizons.Builder.Props oneShotAudio.GetComponent().SetSector(sector); loopAudio.GetComponent().SetSector(sector); - // Someone might want a geyser just for its force maybe idk - if (info.disableSpout & info.disableShaft & info.disableBubbles) - { - oneShotAudio.SetActive(false); - loopAudio.SetActive(false); - } - // Disable start/end sounds if its just bubbles - else if (info.disableSpout & info.disableShaft) - { - oneShotAudio.SetActive(false); - } + Delay.FireOnNextUpdate(() => { + if (info.volume == 0) + { + oneShotAudio.SetActive(false); + loopAudio.SetActive(false); + } + else + { + oneShotAudio.GetComponent().SetMaxVolume(info.volume); + loopAudio.GetComponent().SetMaxVolume(info.volume); + } + }); + // If it starts at the shaft, move the start/end sounds to it - else if ((info.disableSpout & !info.disableShaft) | info.offset == -67f) + if ((info.disableSpout & !info.disableShaft) | info.offset == -67f) { oneShotAudio.transform.SetLocalPositionY(67f); } diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index c0a1db0e..52ab42c6 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -258,6 +258,11 @@ namespace NewHorizons.External.Modules /// Disable the individual particle systems of the geyser /// public bool disableBubbles, disableShaft, disableSpout; + + /// + /// Loudness of the geyser + /// + [DefaultValue(0.7f)] public float volume = 0.7f; } [JsonObject] From d69fd91324879ed7282ba0e9d612e9d83b052784 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 10 Aug 2022 18:41:59 +0000 Subject: [PATCH 20/22] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index eea36095..2b9fa811 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1152,6 +1152,12 @@ "disableSpout": { "type": "boolean", "description": "Disable the individual particle systems of the geyser" + }, + "volume": { + "type": "number", + "description": "Loudness of the geyser", + "format": "float", + "default": 0.7 } } }, From d29855115728eb2d18d6d7f5aa5e717892d3d275 Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Wed, 10 Aug 2022 13:51:47 -0500 Subject: [PATCH 21/22] yee haw --- NewHorizons/Builder/Props/GeyserBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/GeyserBuilder.cs b/NewHorizons/Builder/Props/GeyserBuilder.cs index 5b04150c..f9d3afaa 100644 --- a/NewHorizons/Builder/Props/GeyserBuilder.cs +++ b/NewHorizons/Builder/Props/GeyserBuilder.cs @@ -81,7 +81,7 @@ namespace NewHorizons.Builder.Props }); // If it starts at the shaft, move the start/end sounds to it - if ((info.disableSpout & !info.disableShaft) | info.offset == -67f) + if ((info.disableSpout && !info.disableShaft) || info.offset == -67f) { oneShotAudio.transform.SetLocalPositionY(67f); } From 1f35d085ed97e895e7bb0d0d2433c0d726081c1a Mon Sep 17 00:00:00 2001 From: TerrificTrifid <99054745+TerrificTrifid@users.noreply.github.com> Date: Wed, 10 Aug 2022 14:07:51 -0500 Subject: [PATCH 22/22] Main menu light --- NewHorizons/Handlers/TitleSceneHandler.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Handlers/TitleSceneHandler.cs b/NewHorizons/Handlers/TitleSceneHandler.cs index 1792ca12..42b6e6a4 100644 --- a/NewHorizons/Handlers/TitleSceneHandler.cs +++ b/NewHorizons/Handlers/TitleSceneHandler.cs @@ -67,8 +67,9 @@ namespace NewHorizons.Handlers lightGO.transform.parent = SearchUtilities.Find("Scene/Background").transform; lightGO.transform.localPosition = new Vector3(-47.9203f, 145.7596f, 43.1802f); var light = lightGO.AddComponent(); - light.color = new Color(1f, 1f, 1f, 1f); - light.range = 100; + light.type = LightType.Directional; + light.color = Color.white; + light.range = float.PositiveInfinity; light.intensity = 0.8f; }