From c844bafac31a09c0114af6c864d77c56b4885738 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 9 Oct 2024 20:45:53 -0400 Subject: [PATCH 01/10] Fix Outsider/Codec signal incompat --- NewHorizons/Builder/Props/Audio/SignalBuilder.cs | 10 +++++++++- NewHorizons/manifest.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Builder/Props/Audio/SignalBuilder.cs b/NewHorizons/Builder/Props/Audio/SignalBuilder.cs index 9fd8617c..07ffafd8 100644 --- a/NewHorizons/Builder/Props/Audio/SignalBuilder.cs +++ b/NewHorizons/Builder/Props/Audio/SignalBuilder.cs @@ -171,7 +171,15 @@ namespace NewHorizons.Builder.Props.Audio audioSignal._onlyAudibleToScope = info.onlyAudibleToScope; audioSignal._identificationDistance = info.identificationRadius; audioSignal._canBePickedUpByScope = true; - audioSignal._outerFogWarpVolume = planetGO.GetComponentInChildren(); // shouldn't break non-bramble signals + // The outsider adds outer fog warp volumes to Bramble which break any signals NH places there + if (Main.Instance.ModHelper.Interaction.ModExists("SBtT.TheOutsider") && planetGO.GetComponent()._name == AstroObject.Name.DarkBramble) + { + audioSignal._outerFogWarpVolume = null; + } + else + { + audioSignal._outerFogWarpVolume = planetGO.GetComponentInChildren(); // shouldn't break non-bramble signals + } // If it can be heard regularly then we play it immediately owAudioSource.playOnAwake = !info.onlyAudibleToScope; diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 2581a2bb..3e3e060f 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,7 +4,7 @@ "author": "xen, Bwc9876, JohnCorby, MegaPiggy, Trifid, and friends", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.23.2", + "version": "1.23.3", "owmlVersion": "2.12.1", "dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "PacificEngine.OW_CommonResources" ], From f41b57a97e1f760354afd03d03570ba58b2fa6eb Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 9 Oct 2024 21:45:45 -0400 Subject: [PATCH 02/10] Fix moving satellites of satellites --- NewHorizons/Handlers/PlanetCreationHandler.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index 201def01..f0001677 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -848,6 +848,8 @@ namespace NewHorizons.Handlers // Get ready to move all the satellites var relativeMoonPositions = children.Select(x => x.transform.position - go.transform.position).ToArray(); + var relativeMoonMoonPositions = children.Select(x => AstroObjectLocator.GetChildren(x.GetComponent()) + .Select(childchild => (childchild?.transform?.position ?? Vector3.zero) - go.transform.position)).ToArray(); // If its tidally locked change the alignment var alignment = go.GetComponent(); @@ -874,11 +876,15 @@ namespace NewHorizons.Handlers } else { + var j = 0; foreach (var childChild in AstroObjectLocator.GetChildren(childAO)) { - if (childChild == null) continue; - var dPos = childChild.transform.position - child.transform.position; - childChild.transform.position = go.transform.position + relativeMoonPositions[i] + dPos; + if (childChild != null) + { + var dPos = relativeMoonMoonPositions[i].ElementAt(j); + childChild.transform.position = go.transform.position + dPos; + } + j++; } // Make sure the moons get updated to the new AO childAO._primaryBody = newAO; From a7560aa2c55689dcac192b998151644312c42912 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 9 Oct 2024 22:07:09 -0400 Subject: [PATCH 03/10] Fix sometimes bringing duplicate object to other system --- NewHorizons/Handlers/HeldItemHandler.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NewHorizons/Handlers/HeldItemHandler.cs b/NewHorizons/Handlers/HeldItemHandler.cs index 14ee0814..80c2f695 100644 --- a/NewHorizons/Handlers/HeldItemHandler.cs +++ b/NewHorizons/Handlers/HeldItemHandler.cs @@ -91,6 +91,9 @@ public static class HeldItemHandler private static void OnStarSystemChanging(string _) { + // Double check we're still holding it + _currentlyHeldItem = Locator.GetToolModeSwapper().GetItemCarryTool().GetHeldItem()?.gameObject; + if (_currentlyHeldItem != null) { // Track it so that when we return to this system we can delete the original From f0213e857977d4c8a53b9c63995dba3fe349aa03 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 9 Oct 2024 22:14:24 -0400 Subject: [PATCH 04/10] Fix seeing bramble fog when vessel warping #957 --- NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs b/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs index e4f993a3..e62d1d75 100644 --- a/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs +++ b/NewHorizons/Patches/WarpPatches/VesselWarpControllerPatches.cs @@ -23,7 +23,10 @@ namespace NewHorizons.Patches.WarpPatches if (!Main.Instance.IsWarpingFromVessel) PlayerData.SaveWarpedToTheEye(TimeLoopUtilities.GetVanillaSecondsRemaining()); + // This is totally letting us see the interior of bramble when warping Locator.GetPlayerSectorDetector().RemoveFromAllSectors(); + // This is a very jank workaround to stop us seeing all that #957 + Locator.GetPlayerCamera().farClipPlane = 0; LoadManager.EnableAsyncLoadTransition(); return false; From d0e23ca5aad3e6ac33d2dafe67a2ae261c2bbdb0 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 9 Oct 2024 22:25:30 -0400 Subject: [PATCH 05/10] Update AtmosphereModule.cs --- NewHorizons/External/Modules/AtmosphereModule.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NewHorizons/External/Modules/AtmosphereModule.cs b/NewHorizons/External/Modules/AtmosphereModule.cs index eb31dac2..5aba48a5 100644 --- a/NewHorizons/External/Modules/AtmosphereModule.cs +++ b/NewHorizons/External/Modules/AtmosphereModule.cs @@ -61,6 +61,7 @@ namespace NewHorizons.External.Modules /// /// Relative filepath to the fog color ramp texture, if you put fog. /// x axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top). + /// Optional. If you set fogTint, a default fog ramp will be tinted for you. /// public string fogRampPath; From b5e3e4d89c6eedb650a87b2a52989da866797250 Mon Sep 17 00:00:00 2001 From: Ben C Date: Thu, 10 Oct 2024 02:28:07 +0000 Subject: [PATCH 06/10] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 100d8d92..f218990e 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -370,7 +370,7 @@ }, "fogRampPath": { "type": "string", - "description": "Relative filepath to the fog color ramp texture, if you put fog.\nx axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top)." + "description": "Relative filepath to the fog color ramp texture, if you put fog.\nx axis is angle to sun (left at midnight, right at noon), y axis is distance to camera (close at bottom, far at top).\nOptional. If you set fogTint, a default fog ramp will be tinted for you." }, "hasOxygen": { "type": "boolean", From cfcddf53ebd54936d7452fdc9360ac73455053c9 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 9 Oct 2024 22:38:55 -0400 Subject: [PATCH 07/10] Fix tornado scales --- NewHorizons/Builder/Props/TornadoBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/TornadoBuilder.cs b/NewHorizons/Builder/Props/TornadoBuilder.cs index c2d29093..098bf466 100644 --- a/NewHorizons/Builder/Props/TornadoBuilder.cs +++ b/NewHorizons/Builder/Props/TornadoBuilder.cs @@ -158,7 +158,7 @@ namespace NewHorizons.Builder.Props // Resize it so the force volume goes all the way up var fluidGO = tornadoGO.transform.Find(downwards ? "MockDownTornado_FluidCenter" : "MockUpTornado_FluidCenter"); fluidGO.GetComponent()._fluidType = info.fluidType.ConvertToOW(FluidVolume.Type.CLOUD); - fluidGO.localScale = new Vector3(1, 2f, 1); + fluidGO.localPosition = Vector3.up * 4.8f; if (info.tint != null) { From aa2da3a4c7230e637694d8967017c44b71d94c0a Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 9 Oct 2024 23:02:17 -0400 Subject: [PATCH 08/10] Document ReuseDialogueOptionsListFrom --- docs/src/content/docs/guides/dialogue.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/src/content/docs/guides/dialogue.md b/docs/src/content/docs/guides/dialogue.md index 77d8631d..450b8317 100644 --- a/docs/src/content/docs/guides/dialogue.md +++ b/docs/src/content/docs/guides/dialogue.md @@ -27,6 +27,24 @@ A persistent condition is similar to a condition, except it _persists_ through l A remote trigger is used to have an NPC talk to you from a distance; ex: Slate stopping you for the umpteenth time to tell you information you already knew. +### ReuseDialogueOptionsListFrom + +This is a custom XML node introduced by New Horizons. Use it when adding new dialogue to existing characters, to repeat the dialogue options list from another node. + +For example, Slate's first dialogue with options is named `Scientist5`. To make a custom DialogueNode using these dialogue options (meaning new dialogue said by Slate, but reusing the possible player responses) you can write: + +```xml + + ... + + NEW DIALOGUE FOR SLATE HERE. + + + Scientist5 + + +``` + ## Example XML Here's an example dialogue XML: From 5f576db799c066c3c60532a45d1d5678fc08b317 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 9 Oct 2024 23:53:47 -0400 Subject: [PATCH 09/10] Update INewHorizons.cs --- NewHorizons/INewHorizons.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NewHorizons/INewHorizons.cs b/NewHorizons/INewHorizons.cs index 12002b1e..350d0e2b 100644 --- a/NewHorizons/INewHorizons.cs +++ b/NewHorizons/INewHorizons.cs @@ -146,7 +146,8 @@ namespace NewHorizons void DefineStarSystem(string name, string config, IModBehaviour mod); /// - /// Allows creation of dialogue by directly passing the xml and dialogueInfo json contents as strings + /// Allows creation of dialogue by directly passing the xml and dialogueInfo json contents as strings. + /// Must be called at least 2 frames before entering dialogue if you're using ReuseDialogueOptionsFrom /// /// TextAsset name used for compatibility with voice mod. Just has to be a unique identifier. /// The contents of the dialogue xml file as a string From 948752a076e76d86f122f96c2161c799fead3dc3 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Wed, 9 Oct 2024 23:55:54 -0400 Subject: [PATCH 10/10] Update dialogue.md --- docs/src/content/docs/guides/dialogue.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/src/content/docs/guides/dialogue.md b/docs/src/content/docs/guides/dialogue.md index 450b8317..1f7edac7 100644 --- a/docs/src/content/docs/guides/dialogue.md +++ b/docs/src/content/docs/guides/dialogue.md @@ -45,6 +45,8 @@ For example, Slate's first dialogue with options is named `Scientist5`. To make ``` +Note: If you're loading dialogue in code, 2 frames must pass before entering the conversation in order for ReuseDialogueOptionsListFrom to take effect. + ## Example XML Here's an example dialogue XML: