From 4ae5ec17b16306d65214747ff56d00b9306fdddf Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 8 Sep 2023 01:16:15 -0400 Subject: [PATCH 01/14] Obsolete pulsars --- NewHorizons/Builder/Body/StellarRemnantBuilder.cs | 7 ------- NewHorizons/External/Configs/PlanetConfig.cs | 3 +++ NewHorizons/External/Modules/VariableSize/StarModule.cs | 2 +- SchemaExporter/SchemaExporter.cs | 2 ++ 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/NewHorizons/Builder/Body/StellarRemnantBuilder.cs b/NewHorizons/Builder/Body/StellarRemnantBuilder.cs index 8cfd7520..5dd00158 100644 --- a/NewHorizons/Builder/Body/StellarRemnantBuilder.cs +++ b/NewHorizons/Builder/Body/StellarRemnantBuilder.cs @@ -42,11 +42,6 @@ namespace NewHorizons.Builder.Body case StellarRemnantType.NeutronStar: MakeNeutronStar(go, sector, mod, star.Config.Star); - break; - case StellarRemnantType.Pulsar: - MakeNeutronStar(go, sector, mod, star.Config.Star); - // TODO: add jets, up rotation speed (use a RotateTransform on the star instead of changing sidereal period) - break; case StellarRemnantType.BlackHole: MakeBlackhole(go, sector, star.Config.Star); @@ -146,8 +141,6 @@ namespace NewHorizons.Builder.Body return MakeWhiteDwarf(planet, null, mod, progenitor, proxy); case StellarRemnantType.NeutronStar: return MakeNeutronStar(planet, null, mod, progenitor, proxy); - case StellarRemnantType.Pulsar: - return MakeNeutronStar(planet, null, mod, progenitor, proxy); case StellarRemnantType.BlackHole: return MakeBlackhole(planet, null, progenitor, proxy); default: diff --git a/NewHorizons/External/Configs/PlanetConfig.cs b/NewHorizons/External/Configs/PlanetConfig.cs index d1248900..db5dc435 100644 --- a/NewHorizons/External/Configs/PlanetConfig.cs +++ b/NewHorizons/External/Configs/PlanetConfig.cs @@ -459,6 +459,9 @@ namespace NewHorizons.External.Configs if (Star != null) { if (!Star.goSupernova) Star.stellarDeathType = StellarDeathType.None; + + // Gave up on supporting pulsars + if (Star.stellarRemnantType == StellarRemnantType.Pulsar) Star.stellarRemnantType = StellarRemnantType.NeutronStar; } // Signals no longer use two different variables for audio diff --git a/NewHorizons/External/Modules/VariableSize/StarModule.cs b/NewHorizons/External/Modules/VariableSize/StarModule.cs index 3b833051..2da1bc69 100644 --- a/NewHorizons/External/Modules/VariableSize/StarModule.cs +++ b/NewHorizons/External/Modules/VariableSize/StarModule.cs @@ -154,7 +154,7 @@ namespace NewHorizons.External.Modules.VariableSize [EnumMember(Value = @"default")] Default, [EnumMember(Value = @"whiteDwarf")] WhiteDwarf, [EnumMember(Value = @"neutronStar")] NeutronStar, - [EnumMember(Value = @"pulsar")] Pulsar, + [Obsolete] Pulsar, [EnumMember(Value = @"blackHole")] BlackHole, [EnumMember(Value = @"custom")] Custom } diff --git a/SchemaExporter/SchemaExporter.cs b/SchemaExporter/SchemaExporter.cs index 6aa43dcd..3874aa87 100644 --- a/SchemaExporter/SchemaExporter.cs +++ b/SchemaExporter/SchemaExporter.cs @@ -88,6 +88,8 @@ public static class SchemaExporter schema.Definitions["NomaiTextType"].EnumerationNames.Remove("CairnVariant"); schema.Definitions["QuantumGroupType"].Enumeration.Remove("FailedValidation"); schema.Definitions["QuantumGroupType"].EnumerationNames.Remove("FailedValidation"); + schema.Definitions["StellarRemnantType"].Enumeration.Remove("Pulsar"); + schema.Definitions["StellarRemnantType"].EnumerationNames.Remove("Pulsar"); break; case "Star System Schema": schema.Definitions["NomaiCoordinates"].Properties["x"].UniqueItems = true; From 806fe9ded2e86cb3f93091dfb6e9cdb593378997 Mon Sep 17 00:00:00 2001 From: Ben C Date: Fri, 8 Sep 2023 05:18:39 +0000 Subject: [PATCH 02/14] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index a63e8eb5..380c4dfb 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -3507,7 +3507,6 @@ "Default", "WhiteDwarf", "NeutronStar", - "Pulsar", "BlackHole", "Custom" ], @@ -3515,7 +3514,6 @@ "default", "whiteDwarf", "neutronStar", - "pulsar", "blackHole", "custom" ] From 84c3655a32b1edf9f7f0bc3e58389b8cde108d04 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 11 Sep 2023 22:42:08 -0400 Subject: [PATCH 03/14] Maybe fix ghost bird --- NewHorizons/Builder/Props/DetailBuilder.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 66c16a95..55f77152 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -339,10 +339,12 @@ namespace NewHorizons.Builder.Props component.gameObject.layer = Layer.IgnoreSun; } } - // I forget why this is here + // Else it spams a ton of NRE, happens when you try to put a non-hostile Ghostbird else if (component is GhostIK or GhostEffects) { - UnityEngine.Object.DestroyImmediate(component); + // For when somebody (pikmin) makes a Unity ghost bird + if (component.transform.parent.GetComponent() == null) + UnityEngine.Object.DestroyImmediate(component); return; } else if (component is DarkMatterVolume) From 900c7333a8fb468dfb20baf46089f5010a0a9878 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Mon, 11 Sep 2023 20:20:14 -0700 Subject: [PATCH 04/14] move around code, more comment --- NewHorizons/Builder/Props/DetailBuilder.cs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 55f77152..245ba6c1 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -339,14 +339,6 @@ namespace NewHorizons.Builder.Props component.gameObject.layer = Layer.IgnoreSun; } } - // Else it spams a ton of NRE, happens when you try to put a non-hostile Ghostbird - else if (component is GhostIK or GhostEffects) - { - // For when somebody (pikmin) makes a Unity ghost bird - if (component.transform.parent.GetComponent() == null) - UnityEngine.Object.DestroyImmediate(component); - return; - } else if (component is DarkMatterVolume) { var probeVisuals = component.gameObject.transform.Find("ProbeVisuals"); @@ -402,8 +394,15 @@ namespace NewHorizons.Builder.Props else if (component is Renderer renderer && component.gameObject.GetComponent() == null) renderer.enabled = true; else if(component is Shape shape) shape.enabled = true; - // If it's not a moving anglerfish make sure the anim controller is regular - else if(component is AnglerfishAnimController && component.transform.parent.GetComponent() == null) //Manual parent chain so we can find inactive + // If it's not a moving ghostbird (ie Prefab_IP_GhostBird/Ghostbird_IP_ANIM) make sure it doesnt spam NREs + // Manual parent chain so we can find inactive + else if (component is GhostIK or GhostEffects && component.transform.parent.GetComponent() == null) + { + UnityEngine.Object.DestroyImmediate(component); + } + // If it's not a moving anglerfish (ie Anglerfish_Body/Beast_Anglerfish) make sure the anim controller is regular + // Manual parent chain so we can find inactive + else if(component is AnglerfishAnimController && component.transform.parent.GetComponent() == null) { component.gameObject.AddComponent(); } From 588306f936eaf4d84b05dc0f312f15c22cf7940f Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 11 Sep 2023 23:49:03 -0400 Subject: [PATCH 05/14] Change default particle height to not NRE probably --- .../Builder/Atmosphere/EffectsBuilder.cs | 70 ++++++++++++++----- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs b/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs index e06c1800..2896619c 100644 --- a/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs @@ -2,6 +2,7 @@ using NewHorizons.External.Configs; using NewHorizons.External.Modules; using NewHorizons.Utility; using UnityEngine; + namespace NewHorizons.Builder.Atmosphere { public static class EffectsBuilder @@ -55,29 +56,19 @@ namespace NewHorizons.Builder.Atmosphere { InitPrefabs(); - GameObject effectsGO = new GameObject("Effects"); + var effectsGO = new GameObject("Effects"); effectsGO.SetActive(false); effectsGO.transform.parent = sector?.transform ?? planetGO.transform; effectsGO.transform.position = planetGO.transform.position; - SectorCullGroup SCG = effectsGO.AddComponent(); - SCG._sector = sector; - SCG._particleSystemSuspendMode = CullGroup.ParticleSystemSuspendMode.Stop; - SCG._occlusionCulling = false; - SCG._dynamicCullingBounds = false; - SCG._waitForStreaming = false; + var sectorCullGroup = effectsGO.AddComponent(); + sectorCullGroup._sector = sector; + sectorCullGroup._particleSystemSuspendMode = CullGroup.ParticleSystemSuspendMode.Stop; + sectorCullGroup._occlusionCulling = false; + sectorCullGroup._dynamicCullingBounds = false; + sectorCullGroup._waitForStreaming = false; - var minHeight = config.Base.surfaceSize; - if (config.HeightMap?.minHeight != null) - { - if (config.Water?.size >= config.HeightMap.minHeight) minHeight = config.Water.size; // use sea level if its higher - else minHeight = config.HeightMap.minHeight; - } - else if (config.Water?.size != null) minHeight = config.Water.size; - else if (config.Lava?.size != null) minHeight = config.Lava.size; - - var maxHeight = config.Atmosphere.size; - if (config.Atmosphere.clouds?.outerCloudRadius != null) maxHeight = config.Atmosphere.clouds.outerCloudRadius; + var (minHeight, maxHeight) = GetDefaultHeightRange(config); foreach (var particleField in config.ParticleFields) { @@ -130,5 +121,48 @@ namespace NewHorizons.Builder.Atmosphere _ => null, }; } + + private static (float, float) GetDefaultHeightRange(PlanetConfig config) + { + // Determining default values for min/max height + var minHeight = 0f; + + if (config.HeightMap?.minHeight != null) + { + if (config.Water?.size >= config.HeightMap.minHeight) minHeight = config.Water.size; // use sea level if its higher + else minHeight = config.HeightMap.minHeight; + } + else if (config.Water?.size != null) + { + minHeight = config.Water.size; + } + else if (config.Lava?.size != null) + { + minHeight = config.Lava.size; + } + else if (config.Base != null) + { + minHeight = config.Base.surfaceSize; + } + + var maxHeight = 100f; + if (config.Atmosphere != null) + { + if (config.Atmosphere.clouds?.outerCloudRadius != null) + { + maxHeight = config.Atmosphere.clouds.outerCloudRadius; + } + else + { + maxHeight = config.Atmosphere.size; + } + } + else if (config.Base != null) + { + maxHeight = config.Base.surfaceSize * 2f; + } + + return (minHeight, maxHeight); + } } } From d3eff8ce2a8079427c674b3ef4f8a044844b72b3 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 11 Sep 2023 23:50:09 -0400 Subject: [PATCH 06/14] Double min height instead --- NewHorizons/Builder/Atmosphere/EffectsBuilder.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs b/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs index 2896619c..b4c74b78 100644 --- a/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/EffectsBuilder.cs @@ -124,7 +124,6 @@ namespace NewHorizons.Builder.Atmosphere private static (float, float) GetDefaultHeightRange(PlanetConfig config) { - // Determining default values for min/max height var minHeight = 0f; if (config.HeightMap?.minHeight != null) @@ -146,6 +145,7 @@ namespace NewHorizons.Builder.Atmosphere } var maxHeight = 100f; + if (config.Atmosphere != null) { if (config.Atmosphere.clouds?.outerCloudRadius != null) @@ -157,9 +157,9 @@ namespace NewHorizons.Builder.Atmosphere maxHeight = config.Atmosphere.size; } } - else if (config.Base != null) + else if (minHeight != 0f) { - maxHeight = config.Base.surfaceSize * 2f; + maxHeight = minHeight * 2f; } return (minHeight, maxHeight); From ba38800450aa0d91f8c08d9ce69077079fe187e3 Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 14 Sep 2023 19:33:24 -0700 Subject: [PATCH 07/14] manully clear system specific caches in reload configs --- NewHorizons/Main.cs | 1 + NewHorizons/Utility/DebugTools/DebugReload.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index facd1493..9bfef433 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -196,6 +196,7 @@ namespace NewHorizons } }; + // why is this false when called in Start if (resetTranslation) { TranslationHandler.ClearTables(); diff --git a/NewHorizons/Utility/DebugTools/DebugReload.cs b/NewHorizons/Utility/DebugTools/DebugReload.cs index af3bd938..74a6ef39 100644 --- a/NewHorizons/Utility/DebugTools/DebugReload.cs +++ b/NewHorizons/Utility/DebugTools/DebugReload.cs @@ -1,4 +1,5 @@ using NewHorizons.Handlers; +using NewHorizons.Utility.Files; using NewHorizons.Utility.OWML; using OWML.Common; using OWML.Common.Menus; @@ -48,6 +49,11 @@ namespace NewHorizons.Utility.DebugTools SearchUtilities.Find("/PauseMenu/PauseMenuManagers").GetComponent().OnSkipToNextTimeLoop(); Main.Instance.ChangeCurrentStarSystem(Main.Instance.CurrentStarSystem); + + NHLogger.Log($"Reloading star system {Main.Instance.CurrentStarSystem} - Clearing system-specific caches!"); + ImageUtilities.ClearCache(); + AudioUtilities.ClearCache(); + AssetBundleUtilities.ClearCache(); Main.SecondsElapsedInLoop = -1f; } From d184a28ceb547285b3d93ec9d43fb1ae7ab7e4dc Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 14 Sep 2023 20:40:46 -0700 Subject: [PATCH 08/14] better log --- NewHorizons/Utility/DebugTools/DebugReload.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Utility/DebugTools/DebugReload.cs b/NewHorizons/Utility/DebugTools/DebugReload.cs index 74a6ef39..0f581ac8 100644 --- a/NewHorizons/Utility/DebugTools/DebugReload.cs +++ b/NewHorizons/Utility/DebugTools/DebugReload.cs @@ -50,7 +50,7 @@ namespace NewHorizons.Utility.DebugTools Main.Instance.ChangeCurrentStarSystem(Main.Instance.CurrentStarSystem); - NHLogger.Log($"Reloading star system {Main.Instance.CurrentStarSystem} - Clearing system-specific caches!"); + NHLogger.Log($"Reloading configs for star system {Main.Instance.CurrentStarSystem} - Clearing system-specific caches!"); ImageUtilities.ClearCache(); AudioUtilities.ClearCache(); AssetBundleUtilities.ClearCache(); From 5d75e64438b744907442c9a28d28041324d5891e Mon Sep 17 00:00:00 2001 From: orclecle <17728957+TRSasasusu@users.noreply.github.com> Date: Fri, 15 Sep 2023 12:42:17 +0900 Subject: [PATCH 09/14] Update japanese.json --- NewHorizons/Assets/translations/japanese.json | 64 ++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Assets/translations/japanese.json b/NewHorizons/Assets/translations/japanese.json index b67fb1fe..e9c56386 100644 --- a/NewHorizons/Assets/translations/japanese.json +++ b/NewHorizons/Assets/translations/japanese.json @@ -1,6 +1,68 @@ { "$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/translation_schema.json", + "DialogueDictionary": { + "NEW_HORIZONS_WARP_DRIVE_DIALOGUE_1": "探査艇にワープドライブが搭載されました!", + "NEW_HORIZONS_WARP_DRIVE_DIALOGUE_2": "航行記録に新たに追加された“インターステラーモード”にて、別の星系をロックオンします。", + "NEW_HORIZONS_WARP_DRIVE_DIALOGUE_3": "あとはシートベルトを締めて、それから自動操縦ボタンを押すだけでワープできます!" + }, "UIDictionary": { + "INTERSTELLAR_MODE": "インターステラーモード", + "FREQ_STATUE": "Nomai像", + "FREQ_WARP_CORE": "反重力流束", + "FREQ_UNKNOWN": "???", + "ENGAGE_WARP_PROMPT": "{0}へのワープを開始", + "WARP_LOCKED": "自動操縦のロックオン先:\n{0}", + "LOCK_AUTOPILOT_WARP": "星系に自動操縦をロックオンする", + "RICH_PRESENCE_EXPLORING": "{0}を探検中。", + "RICH_PRESENCE_WARPING": "{0}へワープ中。", + "OUTDATED_VERSION_WARNING": "警告\n\nNew Horizonsはバージョン{0}以上でのみ動作します。このOuter Wildsのバージョンは{1}です。\n\nOuter Wildsをアップデートするか、もしくはNew Horizonsをアンインストールしてください。", + "JSON_FAILED_TO_LOAD": "無効なファイル:{0}", + "DEBUG_RAYCAST": "Raycast", + "DEBUG_PLACE": "Place Object", + "DEBUG_PLACE_TEXT": "Place Nomai Text", + "DEBUG_UNDO": "Undo", + "DEBUG_REDO": "Redo", "Vessel": "船" + }, + "OtherDictionary": { + "NOMAI_SHUTTLE_COMPUTER": "シャトル]]>は現在{0}]]>に停泊している。" + }, + "AchievementTranslations": { + "NH_EATEN_OUTSIDE_BRAMBLE": { + "Name": "収容違反", + "Description": "闇のイバラの外で食べられる。" + }, + "NH_MULTIPLE_SYSTEM": { + "Name": "旅人", + "Description": "5つの異なる星系を連続して訪れる。" + }, + "NH_NEW_FREQ": { + "Name": "異常な周波数", + "Description": "新たな周波数を発見する。" + }, + "NH_PROBE_LOST": { + "Name": "失われた接続", + "Description": "偵察機との接続が断たれる。" + }, + "NH_WARP_DRIVE": { + "Name": "不正確な伝承", + "Description": "探査艇のワープドライブを使う。" + }, + "NH_VESSEL_WARP": { + "Name": "正確な伝承", + "Description": "船でどこかの星系へワープする。" + }, + "NH_RAFTING": { + "Name": "イカダといかり", + "Description": "イカダに乗る。" + }, + "NH_SUCKED_INTO_LAVA_BY_TORNADO": { + "Name": "ダイクロン", + "Description": "竜巻で溶岩へと吸い込まれる。" + }, + "NH_TALK_TO_FIVE_CHARACTERS": { + "Name": "社会", + "Description": "誰か5人と話す。" + } } -} \ No newline at end of file +} From 7beb66606ca88d831f4829edc4422ff97419af9e Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Thu, 14 Sep 2023 20:45:25 -0700 Subject: [PATCH 10/14] force clear cache flag for less duplication --- NewHorizons/Main.cs | 6 ++++-- NewHorizons/Utility/DebugTools/DebugReload.cs | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index 9bfef433..50b4e146 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -97,6 +97,7 @@ namespace NewHorizons private bool _playerAwake; public bool PlayerSpawned { get; set; } + public bool ForceClearCaches { get; set; } // for reloading configs public ShipWarpController ShipWarpController { get; private set; } @@ -196,7 +197,6 @@ namespace NewHorizons } }; - // why is this false when called in Start if (resetTranslation) { TranslationHandler.ClearTables(); @@ -289,8 +289,10 @@ namespace NewHorizons EnumUtilities.ClearCache(); // Caches of other assets only have to be cleared if we changed star systems - if (CurrentStarSystem != _previousStarSystem) + if (ForceClearCaches || CurrentStarSystem != _previousStarSystem) { + ForceClearCaches = false; + NHLogger.Log($"Changing star system from {_previousStarSystem} to {CurrentStarSystem} - Clearing system-specific caches!"); ImageUtilities.ClearCache(); AudioUtilities.ClearCache(); diff --git a/NewHorizons/Utility/DebugTools/DebugReload.cs b/NewHorizons/Utility/DebugTools/DebugReload.cs index 0f581ac8..87dc99cf 100644 --- a/NewHorizons/Utility/DebugTools/DebugReload.cs +++ b/NewHorizons/Utility/DebugTools/DebugReload.cs @@ -48,12 +48,8 @@ namespace NewHorizons.Utility.DebugTools SearchUtilities.Find("/PauseMenu/PauseMenuManagers").GetComponent().OnSkipToNextTimeLoop(); + Main.Instance.ForceClearCaches = true; Main.Instance.ChangeCurrentStarSystem(Main.Instance.CurrentStarSystem); - - NHLogger.Log($"Reloading configs for star system {Main.Instance.CurrentStarSystem} - Clearing system-specific caches!"); - ImageUtilities.ClearCache(); - AudioUtilities.ClearCache(); - AssetBundleUtilities.ClearCache(); Main.SecondsElapsedInLoop = -1f; } From c8208fa0878e28136164f1ee5af9101234bdcf38 Mon Sep 17 00:00:00 2001 From: coderCleric Date: Fri, 15 Sep 2023 16:32:34 -0600 Subject: [PATCH 11/14] Fix preview fog lights not being in the correct positions --- NewHorizons/Builder/Props/BrambleNodeBuilder.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index c02837c8..775047a9 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -235,7 +235,11 @@ namespace NewHorizons.Builder.Props // account for scale (this will fix the issue with screen fog caused by scaled down nodes) // Set the main scale - brambleNode.transform.localScale = Vector3.one * config.scale; + // Can't just use localScale of root, that makes the preview fog lights get pulled in too much + foreach(Transform child in brambleNode.transform) + { + child.localScale = Vector3.one * config.scale; + } innerFogWarpVolume._warpRadius *= config.scale; innerFogWarpVolume._exitRadius *= config.scale; From a84baacb934908ab6064a4452b16e65c0c513c8b Mon Sep 17 00:00:00 2001 From: coderCleric Date: Fri, 15 Sep 2023 16:42:06 -0600 Subject: [PATCH 12/14] Reverted a weird fog scaling that was messing things up. --- NewHorizons/Builder/Props/BrambleNodeBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index 775047a9..95f25549 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -263,7 +263,7 @@ namespace NewHorizons.Builder.Props // (it's also located on a different child path, so the below FindChild calls wouldn't work) // Default size is 70 var fog = brambleNode.FindChild("Effects/InnerWarpFogSphere"); - fog.transform.localScale = Vector3.one * config.scale * 70f; + //fog.transform.localScale = Vector3.one * config.scale * 70f; This is already scaled by its parent, don't know why we scale it again // Copy shared material to not be shared var fogRenderer = fog.GetComponent(); From 1dc04d75622d5a6fe437d10ac8d2b313dfae3be8 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 27 Sep 2023 13:19:28 -0400 Subject: [PATCH 13/14] Update to 14, learn launch codes if starting loop 1 in a custom system --- NewHorizons/Main.cs | 7 +++++++ NewHorizons/NewHorizons.csproj | 4 ++-- NewHorizons/manifest.json | 4 ++-- SchemaExporter/SchemaExporter.csproj | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index facd1493..dcc6f09d 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -544,6 +544,13 @@ namespace NewHorizons ResetCurrentStarSystem(); } + // We are in a custom system on the first loop -> The time loop isn't active, that's not very good + // TimeLoop uses the launch codes condition to know if they loop is active or not + if (CurrentStarSystem != "SolarSystem" && CurrentStarSystem != "EyeOfTheUniverse" && PlayerData.LoadLoopCount() == 1) + { + PlayerData.SetPersistentCondition("LAUNCH_CODES_GIVEN", true); + } + // We only check previous when the scene unloads, and at that point current should be updated to the new system NHLogger.LogVerbose($"Set the previous system to {CurrentStarSystem}"); _previousStarSystem = CurrentStarSystem; diff --git a/NewHorizons/NewHorizons.csproj b/NewHorizons/NewHorizons.csproj index 97051df9..c1e195b3 100644 --- a/NewHorizons/NewHorizons.csproj +++ b/NewHorizons/NewHorizons.csproj @@ -15,8 +15,8 @@ none - - + + diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index 42fe40e5..e493bc9c 100644 --- a/NewHorizons/manifest.json +++ b/NewHorizons/manifest.json @@ -4,8 +4,8 @@ "author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book", "name": "New Horizons", "uniqueName": "xen.NewHorizons", - "version": "1.16.4", - "owmlVersion": "2.9.7", + "version": "1.17.0", + "owmlVersion": "2.9.8", "dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_CommonResources" ], "pathsToPreserve": [ "planets", "systems", "translations" ] diff --git a/SchemaExporter/SchemaExporter.csproj b/SchemaExporter/SchemaExporter.csproj index 010199ac..e4e5c0f6 100644 --- a/SchemaExporter/SchemaExporter.csproj +++ b/SchemaExporter/SchemaExporter.csproj @@ -20,7 +20,7 @@ - + From 778e86c1e0a5fcd4448171ad3762be1fac592ea5 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 27 Sep 2023 14:24:34 -0400 Subject: [PATCH 14/14] Fix warp requirement checking being inconsistent --- .../ShipLog/ShipLogStarChartMode.cs | 15 +-------- NewHorizons/Handlers/StarChartHandler.cs | 32 ++++++++++++++++++- NewHorizons/Main.cs | 28 ++++++++++------ 3 files changed, 51 insertions(+), 24 deletions(-) diff --git a/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs b/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs index a99ea18c..a1d466eb 100644 --- a/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs +++ b/NewHorizons/Components/ShipLog/ShipLogStarChartMode.cs @@ -54,20 +54,7 @@ namespace NewHorizons.Components.ShipLog _nextCardIndex = 0; foreach (var starSystem in Main.SystemDict.Keys) { - // Get rid of the warp option for the current system - if (starSystem == Main.Instance.CurrentStarSystem) continue; - - var config = Main.SystemDict[starSystem]; - - // Conditions to allow warping into that system (either no planets (stock system) or has a ship spawn point) - var flag = false; - if (starSystem.Equals("SolarSystem")) flag = true; - else if (starSystem.Equals("EyeOfTheUniverse")) flag = false; - else if (config.Spawn?.shipSpawn != null) flag = true; - - if (!StarChartHandler.HasUnlockedSystem(starSystem)) continue; - - if (flag && Main.SystemDict[starSystem].Config.canEnterViaWarpDrive) + if (StarChartHandler.CanWarpToSystem(starSystem)) { AddSystemCard(starSystem); } diff --git a/NewHorizons/Handlers/StarChartHandler.cs b/NewHorizons/Handlers/StarChartHandler.cs index 437c62dd..b1ef9eea 100644 --- a/NewHorizons/Handlers/StarChartHandler.cs +++ b/NewHorizons/Handlers/StarChartHandler.cs @@ -1,3 +1,4 @@ +using Epic.OnlineServices; using NewHorizons.Components.ShipLog; using NewHorizons.External; using NewHorizons.OtherMods.CustomShipLogModes; @@ -64,11 +65,15 @@ namespace NewHorizons.Handlers } } + /// + /// Can the player warp to any system at all + /// + /// public static bool CanWarp() { foreach (var system in _systems) { - if (system.Config.canEnterViaWarpDrive && system.Spawn?.shipSpawn != null && HasUnlockedSystem(system.UniqueID)) + if (CanWarpToSystem(system.UniqueID)) { return true; } @@ -76,6 +81,11 @@ namespace NewHorizons.Handlers return false; } + /// + /// Do they have the fact required for a system + /// + /// + /// public static bool HasUnlockedSystem(string system) { if (_starSystemToFactID == null || _starSystemToFactID.Count == 0) @@ -89,6 +99,26 @@ namespace NewHorizons.Handlers return ShipLogHandler.KnowsFact(factID); } + /// + /// Is it actually a valid warp target + /// + /// + /// + public static bool CanWarpToSystem(string system) + { + var config = Main.SystemDict[system]; + + var canWarpTo = false; + if (system.Equals("SolarSystem")) canWarpTo = true; + else if (system.Equals("EyeOfTheUniverse")) canWarpTo = false; + else if (config.Spawn?.shipSpawn != null) canWarpTo = true; + + return canWarpTo + && Main.SystemDict[system].Config.canEnterViaWarpDrive + && system != Main.Instance.CurrentStarSystem + && HasUnlockedSystem(system); + } + public static void OnRevealFact(string factID) { if (_factIDToStarSystem.TryGetValue(factID, out var systemUnlocked)) diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index dcc6f09d..b1b05a1d 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -467,7 +467,10 @@ namespace NewHorizons ShipWarpController = SearchUtilities.Find("Ship_Body").AddComponent(); ShipWarpController.Init(); } - if (HasWarpDrive == true) EnableWarpDrive(); + if (HasWarpDrive == true) + { + EnableWarpDrive(); + } var shouldWarpInFromShip = IsWarpingFromShip && ShipWarpController != null; var shouldWarpInFromVessel = IsWarpingFromVessel && VesselWarpHandler.VesselSpawnPoint != null; @@ -490,6 +493,13 @@ namespace NewHorizons var northPoleSurface = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_NorthPoleSurface").GetComponent(); var remoteViewer = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_NorthHemisphere/Sector_NorthPole/Sector_NorthPoleSurface/Interactables_NorthPoleSurface/LowBuilding/Prefab_NOM_RemoteViewer").GetComponent(); remoteViewer._visualSector = northPoleSurface; + + // We are in a custom system on the first loop -> The time loop isn't active, that's not very good + // TimeLoop uses the launch codes condition to know if the loop is active or not + if (CurrentStarSystem != "SolarSystem" && PlayerData.LoadLoopCount() == 1) + { + PlayerData.SetPersistentCondition("LAUNCH_CODES_GIVEN", true); + } } else if (isEyeOfTheUniverse) { @@ -544,13 +554,6 @@ namespace NewHorizons ResetCurrentStarSystem(); } - // We are in a custom system on the first loop -> The time loop isn't active, that's not very good - // TimeLoop uses the launch codes condition to know if they loop is active or not - if (CurrentStarSystem != "SolarSystem" && CurrentStarSystem != "EyeOfTheUniverse" && PlayerData.LoadLoopCount() == 1) - { - PlayerData.SetPersistentCondition("LAUNCH_CODES_GIVEN", true); - } - // We only check previous when the scene unloads, and at that point current should be updated to the new system NHLogger.LogVerbose($"Set the previous system to {CurrentStarSystem}"); _previousStarSystem = CurrentStarSystem; @@ -586,7 +589,14 @@ namespace NewHorizons public void EnableWarpDrive() { NHLogger.LogVerbose("Setting up warp drive"); - PlanetCreationHandler.LoadBody(LoadConfig(this, "Assets/WarpDriveConfig.json")); + + // In weird edge case when starting in another system on a new expedition, don't want it to briefly pop up during warp + if (!IsWarpingFromShip) + { + // This is the dialogue that tells them the ship log has a warp drive feature + PlanetCreationHandler.LoadBody(LoadConfig(this, "Assets/WarpDriveConfig.json")); + } + HasWarpDrive = true; }