diff --git a/NewHorizons/Assets/translations/portuguese_br.json b/NewHorizons/Assets/translations/portuguese_br.json index cac86858..279aa104 100644 --- a/NewHorizons/Assets/translations/portuguese_br.json +++ b/NewHorizons/Assets/translations/portuguese_br.json @@ -1,6 +1,69 @@ { - "$schema": "https://raw.githubusercontent.com/xen-42/outer-wilds-new-horizons/main/NewHorizons/Schemas/translation_schema.json", + "$schema": "https://raw.githubusercontent.com/outer-wilds-new-horizons/new-horizons/main/NewHorizons/Schemas/translation_schema.json", + "DialogueDictionary": { + "NEW_HORIZONS_WARP_DRIVE_DIALOGUE_1": "Sua nave agora está equipada com uma unidade de translocação!", + "NEW_HORIZONS_WARP_DRIVE_DIALOGUE_2": "Você pode usar a nova aba \"Modo Interestelar\" no diário de bordo de sua nave para ajustar o piloto automático rumo a outro sistema solar.", + "NEW_HORIZONS_WARP_DRIVE_DIALOGUE_3": "Então é só acionar o piloto automático e relaxar!" + }, "UIDictionary": { - "Vessel": "Hospedeiro" + "INTERSTELLAR_MODE": "Modo Interestelar", + "FREQ_STATUE": "Estátua Nomai", + "FREQ_WARP_CORE": "Fluxo Anti-Gravitacional", + "FREQ_UNKNOWN": "???", + "ENGAGE_WARP_PROMPT": "Acionar translocação a {0}", + "WARP_LOCKED": "PILOTO AUTOMÁTICO AJUSTADO PARA:\n{0}", + "LOCK_AUTOPILOT_WARP": "Ajustar Piloto Automático para sistema solar", + "RICH_PRESENCE_EXPLORING": "Explorando {0}.", + "RICH_PRESENCE_WARPING": "Translocando para {0}.", + "OUTDATED_VERSION_WARNING": "AVISO\n\nA mod New Horizons funciona apenas na versão {0} ou superior. Você está usando a versão {1}.\n\nAtualize Outer Wilds ou desinstale NH.", + "JSON_FAILED_TO_LOAD": "Arquivo(s) inválido(s): {0}", + "DEBUG_RAYCAST": "Raycast", + "DEBUG_PLACE": "Posicionar objeto", + "DEBUG_PLACE_TEXT": "Colocar texto Nomai", + "DEBUG_UNDO": "Desfazer", + "DEBUG_REDO": "Refazer", + "Vessel": "Hospedeiro", + "DLC_REQUIRED": "AVISO\n\nVocê tem addons (ex. {0}) instalados que requerem a DLC, mas a mesma não está habilitada.\n\nSuas mods podem não funcionar como esperado." + }, + "OtherDictionary": { + "NOMAI_SHUTTLE_COMPUTER": "A exploradora]]> está repousando por hora em: {0}]]>." + }, + "AchievementTranslations": { + "NH_EATEN_OUTSIDE_BRAMBLE": { + "Name": "Fenda de Contenção", + "Description": "Seja devorado fora dos limites de Abrolho Sombrio" + }, + "NH_MULTIPLE_SYSTEM": { + "Name": "Viajante", + "Description": "Visite 5 sistemas solares seguidos." + }, + "NH_NEW_FREQ": { + "Name": "Frequências Anômalas", + "Description": "Descubra uma nova frequência." + }, + "NH_PROBE_LOST": { + "Name": "Conexão Perdida", + "Description": "Perca seu pequeno batedor." + }, + "NH_WARP_DRIVE": { + "Name": "História Mal Contada", + "Description": "Use a unidade de translocação da nave." + }, + "NH_VESSEL_WARP": { + "Name": "História Acertada", + "Description": "Transloque para um sistema estelar usando o Hospedeiro." + }, + "NH_RAFTING": { + "Name": "A Jangada e os Furiosos", + "Description": "Dê um rolé de jangada." + }, + "NH_SUCKED_INTO_LAVA_BY_TORNADO": { + "Name": "Dieclone", + "Description": "Seja sugado na lava por um tornado." + }, + "NH_TALK_TO_FIVE_CHARACTERS": { + "Name": "Social", + "Description": "Converse com 5 personagens." + } } -} \ No newline at end of file +} diff --git a/NewHorizons/Builder/General/GravityBuilder.cs b/NewHorizons/Builder/General/GravityBuilder.cs index 7d202e27..e358d1a8 100644 --- a/NewHorizons/Builder/General/GravityBuilder.cs +++ b/NewHorizons/Builder/General/GravityBuilder.cs @@ -27,9 +27,9 @@ namespace NewHorizons.Builder.General gravityGO.layer = Layer.BasicEffectVolume; gravityGO.SetActive(false); - var SC = gravityGO.AddComponent(); - SC.isTrigger = true; - SC.radius = gravityRadius; + var sphereCollider = gravityGO.AddComponent(); + sphereCollider.isTrigger = true; + sphereCollider.radius = gravityRadius; var owCollider = gravityGO.AddComponent(); owCollider.SetLODActivationMask(DynamicOccupant.Player); @@ -49,7 +49,8 @@ namespace NewHorizons.Builder.General if (config.Base.surfaceGravity == 0) alignmentRadius = 0; gravityVolume._alignmentRadius = config.Base.gravityAlignmentRadiusOverride ?? alignmentRadius; - gravityVolume._upperSurfaceRadius = config.FocalPoint != null ? 0 : config.Base.surfaceSize; + // Nobody write any FocalPoint overriding here, those work as intended gravitationally so deal with it! + gravityVolume._upperSurfaceRadius = config.Base.surfaceSize; gravityVolume._lowerSurfaceRadius = 0; gravityVolume._layer = 3; gravityVolume._priority = config.Base.gravityVolumePriority; @@ -59,6 +60,21 @@ namespace NewHorizons.Builder.General gravityVolume._isPlanetGravityVolume = true; gravityVolume._cutoffRadius = 0f; + // If it's a focal point dont add collision stuff + // This is overkill + if (config.FocalPoint != null) + { + owCollider.enabled = false; + owTriggerVolume.enabled = false; + sphereCollider.radius = 0; + sphereCollider.enabled = false; + sphereCollider.isTrigger = false; + // This should ensure that even if the player enters the volume, it counts them as being inside the zero-gee cave equivalent + gravityVolume._cutoffRadius = gravityVolume._upperSurfaceRadius; + gravityVolume._lowerSurfaceRadius = gravityVolume._upperSurfaceRadius; + gravityVolume._cutoffAcceleration = 0; + } + gravityGO.SetActive(true); ao._gravityVolume = gravityVolume; diff --git a/NewHorizons/Builder/Props/DetailBuilder.cs b/NewHorizons/Builder/Props/DetailBuilder.cs index 2b7dbfde..2de1ccbd 100644 --- a/NewHorizons/Builder/Props/DetailBuilder.cs +++ b/NewHorizons/Builder/Props/DetailBuilder.cs @@ -459,6 +459,15 @@ namespace NewHorizons.Builder.Props { component.gameObject.AddComponent(); } + else if (component is RaftDock dock) + { + // These flood toggles are to disable flooded docks on the Stranger + // Presumably the user isn't making one of those + foreach (var toggle in dock.GetComponents()) + { + Component.DestroyImmediate(toggle); + } + } } /// @@ -486,7 +495,10 @@ namespace NewHorizons.Builder.Props // Disable the angler anim controller because we don't want Update or LateUpdate to run, just need it to set the initial Animator state angler.enabled = false; angler.OnChangeAnglerState(AnglerfishController.AnglerState.Lurking); - + + angler._animator.SetFloat("MoveSpeed", angler._moveCurrent); + angler._animator.SetFloat("Jaw", angler._jawCurrent); + Destroy(this); } } diff --git a/NewHorizons/Builder/Props/EyeOfTheUniverseBuilder.cs b/NewHorizons/Builder/Props/EyeOfTheUniverseBuilder.cs new file mode 100644 index 00000000..b8c84b62 --- /dev/null +++ b/NewHorizons/Builder/Props/EyeOfTheUniverseBuilder.cs @@ -0,0 +1,258 @@ +using NewHorizons.Builder.Props.Audio; +using NewHorizons.Components.EyeOfTheUniverse; +using NewHorizons.External; +using NewHorizons.External.Modules; +using NewHorizons.External.Modules.Props.Audio; +using NewHorizons.External.Modules.Props.EyeOfTheUniverse; +using NewHorizons.Handlers; +using NewHorizons.Utility; +using NewHorizons.Utility.OuterWilds; +using NewHorizons.Utility.OWML; +using UnityEngine; + +namespace NewHorizons.Builder.Props +{ + public static class EyeOfTheUniverseBuilder + { + public static TravelerEyeController MakeEyeTraveler(GameObject planetGO, Sector sector, EyeTravelerInfo info, NewHorizonsBody nhBody) + { + var travelerData = EyeSceneHandler.CreateEyeTravelerData(info.id); + travelerData.info = info; + travelerData.requirementsMet = true; + + if (!string.IsNullOrEmpty(info.requiredFact) && !ShipLogHandler.KnowsFact(info.requiredFact)) + { + travelerData.requirementsMet = false; + } + + if (!string.IsNullOrEmpty(info.requiredPersistentCondition) && !DialogueConditionManager.SharedInstance.GetConditionState(info.requiredPersistentCondition)) + { + travelerData.requirementsMet = false; + } + + if (!travelerData.requirementsMet) + { + return null; + } + + var go = DetailBuilder.Make(planetGO, sector, nhBody.Mod, info); + + var travelerController = go.GetAddComponent(); + if (!string.IsNullOrEmpty(info.startPlayingCondition)) + { + travelerController._startPlayingCondition = info.startPlayingCondition; + } + else if (string.IsNullOrEmpty(travelerController._startPlayingCondition)) + { + NHLogger.LogError($"Eye Traveler with ID \"{info.id}\" does not have a Start Playing condition set"); + } + if (travelerController._animator == null) + { + travelerController._animator = go.GetComponentInChildren(); + } + if (info.dialogue != null) + { + var (dialogueTree, remoteTrigger) = DialogueBuilder.Make(planetGO, sector, info.dialogue, nhBody.Mod); + if (info.dialogue.position == null && info.dialogue.parentPath == null) + { + info.dialogue.isRelativeToParent = true; + } + GeneralPropBuilder.MakeFromExisting(dialogueTree.gameObject, planetGO, sector, info.dialogue, defaultParent: go.transform); + + if (travelerController._dialogueTree != null) + { + travelerController._dialogueTree.OnStartConversation -= travelerController.OnStartConversation; + travelerController._dialogueTree.OnEndConversation -= travelerController.OnEndConversation; + } + travelerController._dialogueTree = dialogueTree; + travelerController._dialogueTree.OnStartConversation += travelerController.OnStartConversation; + travelerController._dialogueTree.OnEndConversation += travelerController.OnEndConversation; + } + else if (travelerController._dialogueTree == null) + { + travelerController._dialogueTree = go.GetComponentInChildren(); + if (travelerController._dialogueTree == null) + { + NHLogger.LogError($"Eye Traveler with ID \"{info.id}\" does not have any dialogue set"); + } + } + + travelerData.controller = travelerController; + + OWAudioSource loopAudioSource = null; + + if (info.signal != null) + { + if (string.IsNullOrEmpty(info.signal.name)) + { + info.signal.name = go.name; + } + if (string.IsNullOrEmpty(info.signal.frequency)) + { + info.signal.frequency = "Traveler"; + } + var signalGO = SignalBuilder.Make(planetGO, sector, info.signal, nhBody.Mod); + if (info.signal.position == null && info.signal.parentPath == null) + { + info.signal.isRelativeToParent = true; + } + GeneralPropBuilder.MakeFromExisting(signalGO, planetGO, sector, info.signal, defaultParent: go.transform); + + var signal = signalGO.GetComponent(); + travelerController._signal = signal; + signal.SetSignalActivation(false); + loopAudioSource = signal.GetOWAudioSource(); + + } + else if (travelerController._signal == null) + { + NHLogger.LogError($"Eye Traveler with ID \"{info.id}\" does not have any loop audio set"); + } + + travelerData.loopAudioSource = loopAudioSource; + + OWAudioSource finaleAudioSource = null; + + if (!string.IsNullOrEmpty(info.finaleAudio)) + { + var finaleAudioInfo = new AudioSourceInfo() + { + audio = info.finaleAudio, + track = External.SerializableEnums.NHAudioMixerTrackName.Music, + volume = 1f, + }; + finaleAudioSource = GeneralAudioBuilder.Make(planetGO, sector, finaleAudioInfo, nhBody.Mod); + finaleAudioSource.SetTrack(finaleAudioInfo.track.ConvertToOW()); + finaleAudioSource.loop = false; + finaleAudioSource.spatialBlend = 0f; + finaleAudioSource.playOnAwake = false; + finaleAudioSource.gameObject.SetActive(true); + } + + travelerData.finaleAudioSource = finaleAudioSource; + + return travelerController; + } + + public static QuantumInstrument MakeQuantumInstrument(GameObject planetGO, Sector sector, QuantumInstrumentInfo info, NewHorizonsBody nhBody) + { + var travelerData = EyeSceneHandler.GetEyeTravelerData(info.id); + + if (travelerData != null && !travelerData.requirementsMet) + { + return null; + } + + var go = DetailBuilder.Make(planetGO, sector, nhBody.Mod, info); + go.layer = Layer.Interactible; + if (info.interactRadius > 0f) + { + var collider = go.AddComponent(); + collider.radius = info.interactRadius; + collider.isTrigger = true; + go.GetAddComponent(); + } + + go.GetAddComponent(); + var quantumInstrument = go.GetAddComponent(); + quantumInstrument._gatherWithScope = info.gatherWithScope; + ArrayHelpers.Append(ref quantumInstrument._deactivateObjects, go); + + var trigger = go.AddComponent(); + trigger.gatherCondition = info.gatherCondition; + + if (travelerData != null) + { + travelerData.quantumInstruments.Add(quantumInstrument); + } + else + { + NHLogger.LogError($"Quantum instrument with ID \"{info.id}\" has no matching eye traveler"); + } + + info.signal ??= new SignalInfo(); + + if (travelerData?.info != null && travelerData.info.signal != null) + { + if (string.IsNullOrEmpty(info.signal.name)) + { + info.signal.name = travelerData.info.signal.name; + } + if (string.IsNullOrEmpty(info.signal.audio)) + { + info.signal.audio = travelerData.info.signal.audio; + } + if (string.IsNullOrEmpty(info.signal.frequency)) + { + info.signal.frequency = travelerData.info.signal.frequency; + } + } + + if (!string.IsNullOrEmpty(info.signal.audio)) + { + var signalGO = SignalBuilder.Make(planetGO, sector, info.signal, nhBody.Mod); + if (info.signal.position == null && info.signal.parentPath == null) + { + info.signal.isRelativeToParent = true; + } + GeneralPropBuilder.MakeFromExisting(signalGO, planetGO, sector, info.signal, defaultParent: go.transform); + } + else + { + NHLogger.LogError($"Eye Traveler with ID \"{info.id}\" does not have any loop audio set"); + } + + return quantumInstrument; + } + + public static InstrumentZone MakeInstrumentZone(GameObject planetGO, Sector sector, InstrumentZoneInfo info, NewHorizonsBody nhBody) + { + var travelerData = EyeSceneHandler.GetEyeTravelerData(info.id); + + if (travelerData != null && !travelerData.requirementsMet) + { + return null; + } + + var go = DetailBuilder.Make(planetGO, sector, nhBody.Mod, info); + + var instrumentZone = go.AddComponent(); + + if (travelerData != null) + { + travelerData.instrumentZones.Add(instrumentZone); + } + else + { + NHLogger.LogError($"Instrument zone with ID \"{info.id}\" has no matching eye traveler"); + } + + return instrumentZone; + } + + public static void Make(GameObject go, Sector sector, EyeOfTheUniverseModule module, NewHorizonsBody nhBody) + { + if (module.eyeTravelers != null) + { + foreach (var info in module.eyeTravelers) + { + MakeEyeTraveler(go, sector, info, nhBody); + } + } + if (module.instrumentZones != null) + { + foreach (var info in module.instrumentZones) + { + MakeInstrumentZone(go, sector, info, nhBody); + } + } + if (module.quantumInstruments != null) + { + foreach (var info in module.quantumInstruments) + { + MakeQuantumInstrument(go, sector, info, nhBody); + } + } + } + } +} diff --git a/NewHorizons/Builder/Props/QuantumBuilder.cs b/NewHorizons/Builder/Props/QuantumBuilder.cs index 90227e11..302270e8 100644 --- a/NewHorizons/Builder/Props/QuantumBuilder.cs +++ b/NewHorizons/Builder/Props/QuantumBuilder.cs @@ -223,111 +223,8 @@ namespace NewHorizons.Builder.Props shuffle._shuffledObjects = propsInGroup.Select(p => p.transform).ToArray(); shuffle.Awake(); // this doesn't get called on its own for some reason. what? how? - AddBoundsVisibility(shuffleParent); + BoundsUtilities.AddBoundsVisibility(shuffleParent); shuffleParent.SetActive(true); } - - - struct BoxShapeReciever - { - public MeshFilter f; - public SkinnedMeshRenderer s; - public GameObject gameObject; - } - - public static void AddBoundsVisibility(GameObject g) - { - var meshFilters = g.GetComponentsInChildren(); - var skinnedMeshRenderers = g.GetComponentsInChildren(); - - var boxShapeRecievers = meshFilters - .Select(f => new BoxShapeReciever() { f = f, gameObject = f.gameObject }) - .Concat( - skinnedMeshRenderers.Select(s => new BoxShapeReciever() { s = s, gameObject = s.gameObject }) - ) - .ToList(); - - foreach (var boxshapeReciever in boxShapeRecievers) - { - var box = boxshapeReciever.gameObject.AddComponent(); - boxshapeReciever.gameObject.AddComponent(); - boxshapeReciever.gameObject.AddComponent(); - - var fixer = boxshapeReciever.gameObject.AddComponent(); - fixer.shape = box; - fixer.meshFilter = boxshapeReciever.f; - fixer.skinnedMeshRenderer = boxshapeReciever.s; - } - } - - // BUG: ignores skinned guys. this coincidentally makes it work without BoxShapeFixer - public static Bounds GetBoundsOfSelfAndChildMeshes(GameObject g) - { - var meshFilters = g.GetComponentsInChildren(); - var corners = meshFilters.SelectMany(m => GetMeshCorners(m, g)).ToList(); - - Bounds b = new Bounds(corners[0], Vector3.zero); - corners.ForEach(corner => b.Encapsulate(corner)); - - return b; - } - - public static Vector3[] GetMeshCorners(MeshFilter m, GameObject relativeTo = null) - { - var bounds = m.mesh.bounds; - - var localCorners = new Vector3[] - { - bounds.min, - bounds.max, - new Vector3(bounds.min.x, bounds.min.y, bounds.max.z), - new Vector3(bounds.min.x, bounds.max.y, bounds.min.z), - new Vector3(bounds.max.x, bounds.min.y, bounds.min.z), - new Vector3(bounds.min.x, bounds.max.y, bounds.max.z), - new Vector3(bounds.max.x, bounds.min.y, bounds.max.z), - new Vector3(bounds.max.x, bounds.max.y, bounds.min.z), - }; - - var globalCorners = localCorners.Select(localCorner => m.transform.TransformPoint(localCorner)).ToArray(); - - if (relativeTo == null) return globalCorners; - - return globalCorners.Select(globalCorner => relativeTo.transform.InverseTransformPoint(globalCorner)).ToArray(); - } - } - - /// - /// for some reason mesh bounds are wrong unless we wait a bit - /// so this script contiously checks everything until it is correct - /// - /// this actually only seems to be a problem with skinned renderers. normal ones work fine - /// TODO: at some point narrow this down to just skinned, instead of doing everything and checking every frame - /// - public class BoxShapeFixer : MonoBehaviour - { - public BoxShape shape; - public MeshFilter meshFilter; - public SkinnedMeshRenderer skinnedMeshRenderer; - - public void Update() - { - if (meshFilter == null && skinnedMeshRenderer == null) - { - NHLogger.LogVerbose("Useless BoxShapeFixer, destroying"); - DestroyImmediate(this); - } - - Mesh sharedMesh = null; - if (meshFilter != null) sharedMesh = meshFilter.sharedMesh; - if (skinnedMeshRenderer != null) sharedMesh = skinnedMeshRenderer.sharedMesh; - - if (sharedMesh == null) return; - if (sharedMesh.bounds.size == Vector3.zero) return; - - shape.size = sharedMesh.bounds.size; - shape.center = sharedMesh.bounds.center; - - DestroyImmediate(this); - } } } diff --git a/NewHorizons/Builder/Props/RaftBuilder.cs b/NewHorizons/Builder/Props/RaftBuilder.cs index 98196885..59f734bf 100644 --- a/NewHorizons/Builder/Props/RaftBuilder.cs +++ b/NewHorizons/Builder/Props/RaftBuilder.cs @@ -66,6 +66,9 @@ namespace NewHorizons.Builder.Props var waterVolume = planetGO.GetComponentInChildren(); fluidDetector._alignmentFluid = waterVolume; fluidDetector._buoyancy.checkAgainstWaves = true; + // Rafts were unable to trigger docks because these were disabled for some reason + fluidDetector.GetComponent().enabled = true; + fluidDetector.GetComponent().enabled = true; // Light sensors foreach (var lightSensor in raftObject.GetComponentsInChildren()) diff --git a/NewHorizons/Components/EyeOfTheUniverse/EyeMusicController.cs b/NewHorizons/Components/EyeOfTheUniverse/EyeMusicController.cs new file mode 100644 index 00000000..12a4a386 --- /dev/null +++ b/NewHorizons/Components/EyeOfTheUniverse/EyeMusicController.cs @@ -0,0 +1,145 @@ +using NewHorizons.Utility.OWML; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace NewHorizons.Components.EyeOfTheUniverse +{ + public class EyeMusicController : MonoBehaviour + { + // Delay between game logic and audio to ensure audio system has time to schedule all loops for the same tick + const double TIME_BUFFER_WINDOW = 0.5; + + private List _loopSources = new(); + private List _finaleSources = new(); + private bool _transitionToFinale; + private bool _isPlaying; + private double _segmentEndAudioTime; + private float _segmentEndGameTime; + private CosmicInflationController _cosmicInflationController; + + public void RegisterLoopSource(OWAudioSource src) + { + src.loop = false; + src.SetLocalVolume(1f); + src.Stop(); + src.playOnAwake = false; + _loopSources.Add(src); + } + + public void RegisterFinaleSource(OWAudioSource src) + { + src.loop = false; + src.SetLocalVolume(1f); + src.Stop(); + src.playOnAwake = false; + _finaleSources.Add(src); + } + + public void StartPlaying() + { + if (_isPlaying) return; + _isPlaying = true; + StartCoroutine(DoLoop()); + } + + public void TransitionToFinale() + { + _transitionToFinale = true; + + // Schedule finale for as soon as the current segment loop ends + double finaleAudioTime = _segmentEndAudioTime; + float finaleGameTime = _segmentEndGameTime; + + // Cancel loop audio + foreach (var loopSrc in _loopSources) + { + loopSrc._audioSource.SetScheduledEndTime(finaleAudioTime); + } + + // Set quantum sphere inflation timer + var finaleDuration = _cosmicInflationController._travelerFinaleSource.clip.length; + _cosmicInflationController._startFormationTime = Time.time; + _cosmicInflationController._finishFormationTime = finaleGameTime + finaleDuration - 4f; + + // Play finale in sync + foreach (var finaleSrc in _finaleSources) + { + finaleSrc._audioSource.PlayScheduled(finaleAudioTime); + } + } + + private void Awake() + { + _cosmicInflationController = FindObjectOfType(); + } + + private IEnumerator DoLoop() + { + // Determine timing using the first loop audio clip (should be Riebeck's banjo loop) + var referenceLoopClip = _loopSources.First().clip; + double loopDuration = referenceLoopClip.samples / (double)referenceLoopClip.frequency; + + // Vanilla audio divides the loop into 4 segments, but that actually causes weird key shifting during the crossfade + int segmentCount = 2; + double segmentDuration = loopDuration / segmentCount; + + // Track when the next loop will play, in both audio system time and game time + double nextLoopAudioTime = AudioSettings.dspTime + TIME_BUFFER_WINDOW; + float nextLoopGameTime = Time.time + (float)TIME_BUFFER_WINDOW; + + while (!_transitionToFinale) + { + // Play loops in sync + double loopStartAudioTime = nextLoopAudioTime; + float loopStartGameTime = nextLoopGameTime; + + foreach (var loopSrc in _loopSources) + { + if (!loopSrc.gameObject.activeInHierarchy) continue; + if (loopSrc.loop) continue; + // We only need to schedule once and then Unity will loop it for us + loopSrc._audioSource.PlayScheduled(loopStartAudioTime); + loopSrc.loop = true; + } + + // Schedule next loop + nextLoopAudioTime += loopDuration; + nextLoopGameTime += (float)loopDuration; + + // Track loop segment timing (the current musical verse should always finish playing before the finale) + for (int i = 0; i < segmentCount; i++) + { + _segmentEndAudioTime = loopStartAudioTime + segmentDuration * (i + 1); + _segmentEndGameTime = loopStartGameTime + (float)(segmentDuration * (i + 1)); + + // Wait until the next segment + while (Time.time < _segmentEndGameTime && !_transitionToFinale) + { + yield return null; + } + + // Interrupt the remaining segments for the finale + if (_transitionToFinale) break; + } + } + + // Wait until the bubble has finished expanding + while (Time.time < _cosmicInflationController._finishFormationTime) + { + yield return null; + } + + // Disable audio signals + foreach (var loopSrc in _loopSources) + { + var signal = loopSrc.GetComponent(); + if (signal != null) + { + signal.SetSignalActivation(false, 0f); + } + } + } + } +} diff --git a/NewHorizons/Components/EyeOfTheUniverse/InstrumentZone.cs b/NewHorizons/Components/EyeOfTheUniverse/InstrumentZone.cs new file mode 100644 index 00000000..37d0948f --- /dev/null +++ b/NewHorizons/Components/EyeOfTheUniverse/InstrumentZone.cs @@ -0,0 +1,12 @@ +using UnityEngine; + +namespace NewHorizons.Components.EyeOfTheUniverse +{ + /// + /// Class does nothing but is used with GetComponent to find instrument zones in the hierarchy + /// + public class InstrumentZone : MonoBehaviour + { + + } +} diff --git a/NewHorizons/Components/EyeOfTheUniverse/QuantumInstrumentTrigger.cs b/NewHorizons/Components/EyeOfTheUniverse/QuantumInstrumentTrigger.cs new file mode 100644 index 00000000..c927c36c --- /dev/null +++ b/NewHorizons/Components/EyeOfTheUniverse/QuantumInstrumentTrigger.cs @@ -0,0 +1,30 @@ +using UnityEngine; + +namespace NewHorizons.Components.EyeOfTheUniverse +{ + public class QuantumInstrumentTrigger : MonoBehaviour + { + public string gatherCondition; + + private QuantumInstrument _quantumInstrument; + + private void Awake() + { + _quantumInstrument = GetComponent(); + _quantumInstrument.OnFinishGather += OnFinishGather; + } + + private void OnDestroy() + { + _quantumInstrument.OnFinishGather -= OnFinishGather; + } + + private void OnFinishGather() + { + if (!string.IsNullOrEmpty(gatherCondition)) + { + DialogueConditionManager.SharedInstance.SetConditionState(gatherCondition, true); + } + } + } +} diff --git a/NewHorizons/External/Configs/PlanetConfig.cs b/NewHorizons/External/Configs/PlanetConfig.cs index c5ef092c..6184ed36 100644 --- a/NewHorizons/External/Configs/PlanetConfig.cs +++ b/NewHorizons/External/Configs/PlanetConfig.cs @@ -102,6 +102,11 @@ namespace NewHorizons.External.Configs /// public DreamModule Dream; + /// + /// Add features exclusive to the Eye of the Universe scene + /// + public EyeOfTheUniverseModule EyeOfTheUniverse; + /// /// Make this body into a focal point (barycenter) /// diff --git a/NewHorizons/External/Modules/EyeOfTheUniverseModule.cs b/NewHorizons/External/Modules/EyeOfTheUniverseModule.cs new file mode 100644 index 00000000..58e878c1 --- /dev/null +++ b/NewHorizons/External/Modules/EyeOfTheUniverseModule.cs @@ -0,0 +1,24 @@ +using NewHorizons.External.Modules.Props.EyeOfTheUniverse; +using Newtonsoft.Json; + +namespace NewHorizons.External.Modules +{ + [JsonObject] + public class EyeOfTheUniverseModule + { + /// + /// Add custom travelers to the campfire sequence + /// + public EyeTravelerInfo[] eyeTravelers; + + /// + /// Add instrument zones which contain puzzles to gather a quantum instrument. You can parent other props to these with `parentPath` + /// + public InstrumentZoneInfo[] instrumentZones; + + /// + /// Add quantum instruments which cause their associated eye traveler to appear and instrument zones to disappear + /// + public QuantumInstrumentInfo[] quantumInstruments; + } +} diff --git a/NewHorizons/External/Modules/Props/EyeOfTheUniverse/EyeTravelerInfo.cs b/NewHorizons/External/Modules/Props/EyeOfTheUniverse/EyeTravelerInfo.cs new file mode 100644 index 00000000..82f5abe8 --- /dev/null +++ b/NewHorizons/External/Modules/Props/EyeOfTheUniverse/EyeTravelerInfo.cs @@ -0,0 +1,50 @@ +using NewHorizons.External.Modules.Props.Audio; +using NewHorizons.External.Modules.Props.Dialogue; +using Newtonsoft.Json; + +namespace NewHorizons.External.Modules.Props.EyeOfTheUniverse +{ + [JsonObject] + public class EyeTravelerInfo : DetailInfo + { + /// + /// A unique ID to associate this traveler with their corresponding quantum instruments and instrument zones. Must be unique for each traveler. + /// + public string id; + + /// + /// If set, the player must know this ship log fact for this traveler (and their instrument zones and quantum instruments) to appear. The fact does not need to exist in the current star system; the player's save data will be checked directly. + /// + public string requiredFact; + + /// + /// If set, the player must have this persistent dialogue condition set for this traveler (and their instrument zones and quantum instruments) to appear. + /// + public string requiredPersistentCondition; + + /// + /// The dialogue condition that will trigger the traveler to start playing their instrument. Must be unique for each traveler. + /// + public string startPlayingCondition; + + /// + /// If specified, this dialogue condition must be set for the traveler to participate in the campfire song. Otherwise, the song will be able to start without them. + /// + public string participatingCondition; + + /// + /// The audio signal to use for the traveler while playing around the campfire (and also for their paired quantum instrument if another is not specified). The audio clip should be 16 measures at 92 BPM (approximately 42 seconds long). + /// + public SignalInfo signal; + + /// + /// The audio to use for the traveler during the finale of the campfire song. It should be 8 measures of the main loop at 92 BPM followed by 2 measures of fade-out (approximately 26 seconds long in total). Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list. + /// + public string finaleAudio; + + /// + /// The dialogue to use for this traveler. If omitted, the first CharacterDialogueTree in the object will be used. + /// + public DialogueInfo dialogue; + } +} diff --git a/NewHorizons/External/Modules/Props/EyeOfTheUniverse/InstrumentZoneInfo.cs b/NewHorizons/External/Modules/Props/EyeOfTheUniverse/InstrumentZoneInfo.cs new file mode 100644 index 00000000..047babb9 --- /dev/null +++ b/NewHorizons/External/Modules/Props/EyeOfTheUniverse/InstrumentZoneInfo.cs @@ -0,0 +1,13 @@ +using Newtonsoft.Json; + +namespace NewHorizons.External.Modules.Props.EyeOfTheUniverse +{ + [JsonObject] + public class InstrumentZoneInfo : DetailInfo + { + /// + /// The unique ID of the Eye Traveler associated with this instrument zone. + /// + public string id; + } +} diff --git a/NewHorizons/External/Modules/Props/EyeOfTheUniverse/QuantumInstrumentInfo.cs b/NewHorizons/External/Modules/Props/EyeOfTheUniverse/QuantumInstrumentInfo.cs new file mode 100644 index 00000000..1a686b9c --- /dev/null +++ b/NewHorizons/External/Modules/Props/EyeOfTheUniverse/QuantumInstrumentInfo.cs @@ -0,0 +1,40 @@ +using NewHorizons.External.Modules.Props.Audio; +using Newtonsoft.Json; +using System.ComponentModel; + +namespace NewHorizons.External.Modules.Props.EyeOfTheUniverse +{ + [JsonObject] + public class QuantumInstrumentInfo : DetailInfo + { + /// + /// The unique ID of the Eye Traveler associated with this quantum instrument. + /// + public string id; + + /// + /// A dialogue condition to set when gathering this quantum instrument. Use it in conjunction with `activationCondition` or `deactivationCondition` on other details. + /// + public string gatherCondition; + + /// + /// Allows gathering this quantum instrument using the zoomed-in signalscope, like Chert's bongos. + /// + public bool gatherWithScope; + + /// + /// The audio signal emitted by this quantum instrument. The fields `name`, `audio`, and `frequency` will be copied from the corresponding Eye Traveler's signal if not specified here. + /// + public SignalInfo signal; + + /// + /// The radius of the added sphere collider that will be used for interaction. + /// + [DefaultValue(0.5f)] public float interactRadius = 0.5f; + + /// + /// The furthest distance where the player can interact with this quantum instrument. + /// + [DefaultValue(2f)] public float interactRange = 2f; + } +} diff --git a/NewHorizons/Handlers/EyeDetailCacher.cs b/NewHorizons/Handlers/EyeDetailCacher.cs index 62dfb460..f4ff2ed0 100644 --- a/NewHorizons/Handlers/EyeDetailCacher.cs +++ b/NewHorizons/Handlers/EyeDetailCacher.cs @@ -19,6 +19,36 @@ public static class EyeDetailCacher foreach (var body in Main.BodyDict["EyeOfTheUniverse"]) { NHLogger.LogVerbose($"{nameof(EyeDetailCacher)}: {body.Config.name}"); + if (body.Config?.EyeOfTheUniverse?.eyeTravelers != null) + { + foreach (var detail in body.Config.EyeOfTheUniverse.eyeTravelers) + { + if (!string.IsNullOrEmpty(detail.assetBundle)) continue; + + AddPathToCache(detail.path); + } + } + + if (body.Config?.EyeOfTheUniverse?.instrumentZones != null) + { + foreach (var detail in body.Config.EyeOfTheUniverse.instrumentZones) + { + if (!string.IsNullOrEmpty(detail.assetBundle)) continue; + + AddPathToCache(detail.path); + } + } + + if (body.Config?.EyeOfTheUniverse?.quantumInstruments != null) + { + foreach (var detail in body.Config.EyeOfTheUniverse.quantumInstruments) + { + if (!string.IsNullOrEmpty(detail.assetBundle)) continue; + + AddPathToCache(detail.path); + } + } + if (body.Config?.Props?.details != null) { foreach (var detail in body.Config.Props.details) diff --git a/NewHorizons/Handlers/EyeSceneHandler.cs b/NewHorizons/Handlers/EyeSceneHandler.cs index a0c925a9..7a3a4c1a 100644 --- a/NewHorizons/Handlers/EyeSceneHandler.cs +++ b/NewHorizons/Handlers/EyeSceneHandler.cs @@ -1,14 +1,66 @@ using NewHorizons.Builder.General; using NewHorizons.Components.EyeOfTheUniverse; using NewHorizons.Components.Stars; +using NewHorizons.External.Modules.Props.EyeOfTheUniverse; using NewHorizons.External.SerializableData; using NewHorizons.Utility; +using NewHorizons.Utility.OWML; +using System.Collections.Generic; +using System.Linq; using UnityEngine; namespace NewHorizons.Handlers { public static class EyeSceneHandler { + private static Dictionary _eyeTravelers = new(); + private static EyeMusicController _eyeMusicController; + + public static void Init() + { + _eyeTravelers.Clear(); + _eyeMusicController = null; + } + + public static EyeMusicController GetMusicController() + { + return _eyeMusicController; + } + + public static EyeTravelerData GetEyeTravelerData(string id) + { + if (_eyeTravelers.TryGetValue(id, out EyeTravelerData traveler)) + { + return traveler; + } + return traveler; + } + + public static EyeTravelerData CreateEyeTravelerData(string id) + { + if (_eyeTravelers.TryGetValue(id, out EyeTravelerData traveler)) + { + return traveler; + } + traveler = new EyeTravelerData() + { + id = id, + info = null, + controller = null, + loopAudioSource = null, + finaleAudioSource = null, + instrumentZones = new(), + quantumInstruments = new(), + }; + _eyeTravelers[traveler.id] = traveler; + return traveler; + } + + public static List GetActiveCustomEyeTravelers() + { + return _eyeTravelers.Values.Where(t => t.requirementsMet).ToList(); + } + public static void OnSceneLoad() { // Create astro objects for eye and vessel because they didn't have them somehow. @@ -134,5 +186,142 @@ namespace NewHorizons.Handlers SunLightEffectsController.AddStar(starController); SunLightEffectsController.AddStarLight(sunLight); } + + public static void SetUpEyeCampfireSequence() + { + if (!GetActiveCustomEyeTravelers().Any()) return; + + _eyeMusicController = new GameObject("EyeMusicController").AddComponent(); + + var quantumCampsiteController = Object.FindObjectOfType(); + var cosmicInflationController = Object.FindObjectOfType(); + + _eyeMusicController.RegisterFinaleSource(cosmicInflationController._travelerFinaleSource); + + foreach (var controller in quantumCampsiteController._travelerControllers) + { + _eyeMusicController.RegisterLoopSource(controller._signal.GetOWAudioSource()); + } + + foreach (var eyeTraveler in GetActiveCustomEyeTravelers()) + { + if (eyeTraveler.controller != null) + { + eyeTraveler.controller.gameObject.SetActive(false); + + ArrayHelpers.Append(ref quantumCampsiteController._travelerControllers, eyeTraveler.controller); + eyeTraveler.controller.OnStartPlaying += quantumCampsiteController.OnTravelerStartPlaying; + + ArrayHelpers.Append(ref cosmicInflationController._travelers, eyeTraveler.controller); + eyeTraveler.controller.OnStartPlaying += cosmicInflationController.OnTravelerStartPlaying; + + ArrayHelpers.Append(ref cosmicInflationController._inflationObjects, eyeTraveler.controller.transform); + } + else + { + NHLogger.LogError($"Missing Eye Traveler for ID \"{eyeTraveler.id}\""); + } + + if (eyeTraveler.loopAudioSource != null) + { + eyeTraveler.loopAudioSource.GetComponent().SetSignalActivation(false); + _eyeMusicController.RegisterLoopSource(eyeTraveler.loopAudioSource); + } + if (eyeTraveler.finaleAudioSource != null) + { + _eyeMusicController.RegisterFinaleSource(eyeTraveler.finaleAudioSource); + } + + foreach (var quantumInstrument in eyeTraveler.quantumInstruments) + { + ArrayHelpers.Append(ref quantumInstrument._activateObjects, eyeTraveler.controller.gameObject); + ArrayHelpers.Append(ref quantumInstrument._deactivateObjects, eyeTraveler.instrumentZones.Select(z => z.gameObject)); + + var ancestorInstrumentZone = quantumInstrument.GetComponentInParent(); + if (ancestorInstrumentZone == null) + { + // Quantum instrument is not a child of an instrument zone, so treat it like its own zone + quantumInstrument.gameObject.SetActive(false); + ArrayHelpers.Append(ref quantumCampsiteController._instrumentZones, quantumInstrument.gameObject); + + ArrayHelpers.Append(ref cosmicInflationController._inflationObjects, quantumInstrument.transform); + } + } + + foreach (var instrumentZone in eyeTraveler.instrumentZones) + { + instrumentZone.gameObject.SetActive(false); + ArrayHelpers.Append(ref quantumCampsiteController._instrumentZones, instrumentZone.gameObject); + + ArrayHelpers.Append(ref cosmicInflationController._inflationObjects, instrumentZone.transform); + } + } + + UpdateTravelerPositions(); + } + + public static void UpdateTravelerPositions() + { + if (!GetActiveCustomEyeTravelers().Any()) return; + + var quantumCampsiteController = Object.FindObjectOfType(); + + var travelers = new List() + { + quantumCampsiteController._travelerControllers[0].transform, // Riebeck + quantumCampsiteController._travelerControllers[2].transform, // Chert + quantumCampsiteController._travelerControllers[6].transform, // Esker + quantumCampsiteController._travelerControllers[1].transform, // Felspar + quantumCampsiteController._travelerControllers[3].transform, // Gabbro + }; + + if (quantumCampsiteController._hasMetSolanum) + { + travelers.Add(quantumCampsiteController._travelerControllers[4].transform); // Solanum + } + if (quantumCampsiteController._hasMetPrisoner) + { + travelers.Add(quantumCampsiteController._travelerControllers[5].transform); // Prisoner + } + + // Custom travelers (starting at index 7) + for (int i = 7; i < quantumCampsiteController._travelerControllers.Length; i++) + { + travelers.Add(quantumCampsiteController._travelerControllers[i].transform); + } + + var radius = 2f + 0.2f * travelers.Count; + var angle = Mathf.PI * 2f / travelers.Count; + var index = 0; + + foreach (var traveler in travelers) + { + // Esker isn't at height 0 so we have to do all this + var initialY = traveler.transform.position.y; + var newPos = quantumCampsiteController.transform.TransformPoint(new Vector3( + Mathf.Cos(angle * index) * radius, + 0f, + -Mathf.Sin(angle * index) * radius + )); + newPos.y = initialY; + traveler.transform.position = newPos; + var lookTarget = quantumCampsiteController.transform.position; + lookTarget.y = newPos.y; + traveler.transform.LookAt(lookTarget, traveler.transform.up); + index++; + } + } + + public class EyeTravelerData + { + public string id; + public EyeTravelerInfo info; + public TravelerEyeController controller; + public OWAudioSource loopAudioSource; + public OWAudioSource finaleAudioSource; + public List quantumInstruments = new(); + public List instrumentZones = new(); + public bool requirementsMet; + } } } diff --git a/NewHorizons/Handlers/InvulnerabilityHandler.cs b/NewHorizons/Handlers/InvulnerabilityHandler.cs index 9aa0e793..cacc9e19 100644 --- a/NewHorizons/Handlers/InvulnerabilityHandler.cs +++ b/NewHorizons/Handlers/InvulnerabilityHandler.cs @@ -1,36 +1,44 @@ using NewHorizons.Utility.OWML; using UnityEngine; +using UnityEngine.SceneManagement; namespace NewHorizons.Handlers { internal class InvulnerabilityHandler { - private static float _defaultImpactDeathSpeed = -1f; + /// + /// Used in patches + /// + public static bool Invincible { get; private set; } public static void MakeInvulnerable(bool invulnerable) { NHLogger.Log($"Toggling immortality: {invulnerable}"); + Invincible = invulnerable; var deathManager = GetDeathManager(); var resources = GetPlayerResouces(); if (invulnerable) { - if (_defaultImpactDeathSpeed == -1f) - _defaultImpactDeathSpeed = deathManager._impactDeathSpeed; - - deathManager._impactDeathSpeed = Mathf.Infinity; deathManager._invincible = true; + resources._invincible = true; } else { - deathManager._impactDeathSpeed = _defaultImpactDeathSpeed; resources._currentHealth = 100f; deathManager._invincible = false; + resources._invincible = false; } } private static DeathManager GetDeathManager() => GameObject.FindObjectOfType(); private static PlayerResources GetPlayerResouces() => GameObject.FindObjectOfType(); + + static InvulnerabilityHandler() + { + // If the scene unloads when Invincible is on it might not get turned off + SceneManager.sceneUnloaded += (_) => Invincible = false; + } } } diff --git a/NewHorizons/Handlers/PlanetCreationHandler.cs b/NewHorizons/Handlers/PlanetCreationHandler.cs index fc8b8ae7..6898382f 100644 --- a/NewHorizons/Handlers/PlanetCreationHandler.cs +++ b/NewHorizons/Handlers/PlanetCreationHandler.cs @@ -514,7 +514,11 @@ namespace NewHorizons.Handlers if (body.Config.Orbit.showOrbitLine && !body.Config.Orbit.isStatic) { - OrbitlineBuilder.Make(body.Object, body.Config.Orbit.isMoon, body.Config); + // No map mode at eye + if (LoadManager.GetCurrentScene() != OWScene.EyeOfTheUniverse) + { + OrbitlineBuilder.Make(body.Object, body.Config.Orbit.isMoon, body.Config); + } } DetectorBuilder.Make(go, owRigidBody, primaryBody, ao, body.Config); @@ -691,6 +695,18 @@ namespace NewHorizons.Handlers atmosphere = AtmosphereBuilder.Make(go, sector, body.Config.Atmosphere, surfaceSize).GetComponentInChildren(); } + if (body.Config.EyeOfTheUniverse != null) + { + if (Main.Instance.CurrentStarSystem == "EyeOfTheUniverse") + { + EyeOfTheUniverseBuilder.Make(go, sector, body.Config.EyeOfTheUniverse, body); + } + else + { + NHLogger.LogWarning($"A mod creator (you?) has defined Eye of the Universe specific settings on a body [{body.Config.name}] that is not in the eye of the universe"); + } + } + if (body.Config.ParticleFields != null) { EffectsBuilder.Make(go, sector, body.Config); @@ -843,7 +859,11 @@ namespace NewHorizons.Handlers var isMoon = newAO.GetAstroObjectType() is AstroObject.Type.Moon or AstroObject.Type.Satellite or AstroObject.Type.SpaceStation; if (body.Config.Orbit.showOrbitLine) { - OrbitlineBuilder.Make(go, isMoon, body.Config); + // No map mode at eye + if (LoadManager.GetCurrentScene() != OWScene.EyeOfTheUniverse) + { + OrbitlineBuilder.Make(go, isMoon, body.Config); + } } DetectorBuilder.SetDetector(primary, newAO, go.GetComponentInChildren()); diff --git a/NewHorizons/Handlers/PlayerSpawnHandler.cs b/NewHorizons/Handlers/PlayerSpawnHandler.cs index 352b4eff..24b6d73c 100644 --- a/NewHorizons/Handlers/PlayerSpawnHandler.cs +++ b/NewHorizons/Handlers/PlayerSpawnHandler.cs @@ -70,6 +70,24 @@ namespace NewHorizons.Handlers // Spawn ship Delay.FireInNUpdates(SpawnShip, 30); + + // Have had bug reports (#1034, #975) where sometimes after spawning via vessel warp or ship warp you die from impact velocity after being flung + // Something weird must be happening with velocity. + // Try to correct it here after the ship is done spawning + Delay.FireInNUpdates(() => FixVelocity(shouldWarpInFromVessel, shouldWarpInFromShip), 31); + } + + private static void FixVelocity(bool shouldWarpInFromVessel, bool shouldWarpInFromShip) + { + var spawnOWRigidBody = GetDefaultSpawn().GetAttachedOWRigidbody(); + if (shouldWarpInFromVessel) spawnOWRigidBody = VesselWarpHandler.VesselSpawnPoint.GetAttachedOWRigidbody(); + if (shouldWarpInFromShip) spawnOWRigidBody = Locator.GetShipBody(); + + var spawnVelocity = spawnOWRigidBody.GetVelocity(); + var spawnAngularVelocity = spawnOWRigidBody.GetPointTangentialVelocity(Locator.GetPlayerBody().GetPosition()); + var velocity = spawnVelocity + spawnAngularVelocity; + + Locator.GetPlayerBody().SetVelocity(velocity); } public static void SpawnShip() diff --git a/NewHorizons/Handlers/VesselWarpHandler.cs b/NewHorizons/Handlers/VesselWarpHandler.cs index 5cf611e5..c5e622eb 100644 --- a/NewHorizons/Handlers/VesselWarpHandler.cs +++ b/NewHorizons/Handlers/VesselWarpHandler.cs @@ -6,6 +6,7 @@ using NewHorizons.Utility; using NewHorizons.Utility.OuterWilds; using NewHorizons.Utility.OWML; using UnityEngine; +using System.Collections; using static NewHorizons.Main; using static NewHorizons.Utility.Files.AssetBundleUtilities; @@ -56,7 +57,9 @@ namespace NewHorizons.Handlers } if (IsVesselPresentAndActive()) + { _vesselSpawnPoint = Instance.CurrentStarSystem == "SolarSystem" ? UpdateVessel() : CreateVessel(); + } else { var vesselDimension = SearchUtilities.Find("DB_VesselDimension_Body/Sector_VesselDimension"); @@ -84,7 +87,12 @@ namespace NewHorizons.Handlers if (_vesselSpawnPoint is VesselSpawnPoint vesselSpawnPoint) { NHLogger.LogVerbose("Relative warping into vessel"); - vesselSpawnPoint.WarpPlayer();//Delay.FireOnNextUpdate(vesselSpawnPoint.WarpPlayer); + vesselSpawnPoint.WarpPlayer(); + + // #1034 Vessel warp sometimes has the player get flung away into space and die + // We do what we do with regular spawns where we keep resetting their position to the right one while invincible until we're relatively certain + // that the spawning sequence is done + Delay.StartCoroutine(FixPlayerSpawning(25, vesselSpawnPoint)); } else { @@ -96,6 +104,24 @@ namespace NewHorizons.Handlers LoadDB(); } + private static IEnumerator FixPlayerSpawning(int frameInterval, VesselSpawnPoint vesselSpawn) + { + InvulnerabilityHandler.MakeInvulnerable(true); + + var frameCount = 0; + while (frameCount <= frameInterval) + { + vesselSpawn.WarpPlayer(); + frameCount++; + yield return null; // Wait for the next frame + } + + InvulnerabilityHandler.MakeInvulnerable(false); + var playerBody = SearchUtilities.Find("Player_Body").GetAttachedOWRigidbody(); + var resources = playerBody.GetComponent(); + resources._currentHealth = 100f; + } + public static void LoadDB() { if (Instance.CurrentStarSystem == "SolarSystem") diff --git a/NewHorizons/Main.cs b/NewHorizons/Main.cs index c964744f..468793aa 100644 --- a/NewHorizons/Main.cs +++ b/NewHorizons/Main.cs @@ -436,6 +436,7 @@ namespace NewHorizons if (isEyeOfTheUniverse) { _playerAwake = true; + EyeSceneHandler.Init(); EyeSceneHandler.OnSceneLoad(); } @@ -535,6 +536,8 @@ namespace NewHorizons IsWarpingFromVessel = false; DidWarpFromVessel = false; DidWarpFromShip = false; + + EyeSceneHandler.SetUpEyeCampfireSequence(); } //Stop starfield from disappearing when there is no lights @@ -598,8 +601,8 @@ namespace NewHorizons { IsSystemReady = true; - // ShipWarpController will handle the invulnerability otherwise - if (!shouldWarpInFromShip) + // ShipWarpController or VesselWarpHandler will handle the invulnerability otherwise + if (!shouldWarpInFromShip && !shouldWarpInFromVessel) { Delay.FireOnNextUpdate(() => InvulnerabilityHandler.MakeInvulnerable(false)); } diff --git a/NewHorizons/Patches/EchoesOfTheEyePatches/RaftControllerPatches.cs b/NewHorizons/Patches/EchoesOfTheEyePatches/RaftControllerPatches.cs index e615c201..48a08f08 100644 --- a/NewHorizons/Patches/EchoesOfTheEyePatches/RaftControllerPatches.cs +++ b/NewHorizons/Patches/EchoesOfTheEyePatches/RaftControllerPatches.cs @@ -1,4 +1,5 @@ using HarmonyLib; +using NewHorizons.Components.Props; using UnityEngine; namespace NewHorizons.Patches.EchoesOfTheEyePatches @@ -73,5 +74,31 @@ namespace NewHorizons.Patches.EchoesOfTheEyePatches return false; } + + [HarmonyPostfix] + [HarmonyPatch(nameof(RaftController.UpdateMoveToTarget))] + public static void UpdateMoveToTarget(RaftController __instance) + { + // If it has a riverFluid volume then its a regular stranger one + if (__instance._movingToTarget && __instance._riverFluid == null) + { + OWRigidbody raftBody = __instance._raftBody; + OWRigidbody origParentBody = __instance._raftBody.GetOrigParentBody(); + Transform transform = origParentBody.transform; + Vector3 vector = transform.TransformPoint(__instance._targetLocalPosition); + + // Base game threshold has this at 1f (after doing smoothstep on it) + // For whatever reason it never hits that for NH planets (probably since they're moving so much compared to the steady velocity of the Stranger) + // Might break for somebody with a wacky spinning planet in which case we can adjust this or add some kind of fallback (i.e., wait x seconds and then just say its there) + // Fixes #1005 + if (__instance.currentDistanceLerp > 0.999f) + { + raftBody.SetPosition(vector); + raftBody.SetRotation(transform.rotation * __instance._targetLocalRotation); + __instance.StopMovingToTarget(); + __instance.OnArriveAtTarget.Invoke(); + } + } + } } } diff --git a/NewHorizons/Patches/EyeScenePatches/CosmicInflationControllerPatches.cs b/NewHorizons/Patches/EyeScenePatches/CosmicInflationControllerPatches.cs new file mode 100644 index 00000000..2363140c --- /dev/null +++ b/NewHorizons/Patches/EyeScenePatches/CosmicInflationControllerPatches.cs @@ -0,0 +1,24 @@ +using HarmonyLib; +using NewHorizons.Handlers; +using NewHorizons.Utility.OWML; +using System.Linq; + +namespace NewHorizons.Patches.EyeScenePatches +{ + [HarmonyPatch(typeof(CosmicInflationController))] + public static class CosmicInflationControllerPatches + { + [HarmonyPostfix] + [HarmonyPatch(nameof(CosmicInflationController.UpdateFormation))] + public static void CosmicInflationController_UpdateFormation(CosmicInflationController __instance) + { + if (__instance._waitForCrossfade && EyeSceneHandler.GetActiveCustomEyeTravelers().Any()) + { + NHLogger.Log($"Hijacking finale cross-fade, NH will handle it"); + __instance._waitForCrossfade = false; + __instance._waitForMusicEnd = true; + EyeSceneHandler.GetMusicController().TransitionToFinale(); + } + } + } +} diff --git a/NewHorizons/Patches/EyeScenePatches/QuantumCampsiteControllerPatches.cs b/NewHorizons/Patches/EyeScenePatches/QuantumCampsiteControllerPatches.cs new file mode 100644 index 00000000..542c310d --- /dev/null +++ b/NewHorizons/Patches/EyeScenePatches/QuantumCampsiteControllerPatches.cs @@ -0,0 +1,88 @@ +using HarmonyLib; +using NewHorizons.Handlers; +using NewHorizons.Utility.OWML; +using System.Linq; + +namespace NewHorizons.Patches.EyeScenePatches +{ + [HarmonyPatch(typeof(QuantumCampsiteController))] + public static class QuantumCampsiteControllerPatches + { + [HarmonyPostfix] + [HarmonyPatch(nameof(QuantumCampsiteController.Start))] + public static void QuantumCampsiteController_Start() + { + EyeSceneHandler.UpdateTravelerPositions(); + } + + [HarmonyPostfix] + [HarmonyPatch(nameof(QuantumCampsiteController.ActivateRemainingInstrumentZones))] + public static void QuantumCampsiteController_ActivateRemainingInstrumentZones(QuantumCampsiteController __instance) + { + // We modify this array when registering a custom instrument zone but the vanilla method only activates the first 6 + for (int i = 6; i < __instance._instrumentZones.Length; i++) + { + __instance._instrumentZones[i].SetActive(true); + } + } + + [HarmonyPrefix] + [HarmonyPatch(nameof(QuantumCampsiteController.AreAllTravelersGathered))] + public static bool QuantumCampsiteController_AreAllTravelersGathered(QuantumCampsiteController __instance, ref bool __result) + { + if (!EyeSceneHandler.GetActiveCustomEyeTravelers().Any()) + { + return true; + } + bool gatheredAllHearthianTravelers = __instance._travelerControllers.Take(4).All(t => t.gameObject.activeInHierarchy); + if (!gatheredAllHearthianTravelers) + { + __result = false; + return false; + } + bool needsSolanum = __instance._hasMetSolanum; + bool gatheredSolanum = __instance._travelerControllers[QuantumCampsiteController.SOLANUM_INDEX].gameObject.activeInHierarchy; + if (needsSolanum && !gatheredSolanum) + { + __result = false; + return false; + } + bool needsPrisoner = __instance._hasMetPrisoner && !__instance._hasErasedPrisoner; + bool gatheredPrisoner = __instance._travelerControllers[QuantumCampsiteController.PRISONER_INDEX].gameObject.activeInHierarchy; + if (needsPrisoner && !gatheredPrisoner) + { + __result = false; + return false; + } + foreach (var traveler in EyeSceneHandler.GetActiveCustomEyeTravelers()) + { + bool needsTraveler = true; + if (!string.IsNullOrEmpty(traveler.info.participatingCondition)) + { + needsTraveler = DialogueConditionManager.SharedInstance.GetConditionState(traveler.info.participatingCondition); + } + bool gatheredTraveler = traveler.controller.gameObject.activeInHierarchy; + if (needsTraveler && !gatheredTraveler) + { + __result = false; + return false; + } + } + __result = true; + return false; + } + + [HarmonyPrefix] + [HarmonyPatch(nameof(QuantumCampsiteController.OnTravelerStartPlaying))] + public static void OnTravelerStartPlaying(QuantumCampsiteController __instance) + { + if (!__instance._hasJamSessionStarted && EyeSceneHandler.GetActiveCustomEyeTravelers().Any()) + { + NHLogger.Log($"NH is handling Eye sequence music"); + // Jam session is starting, start our custom music handler + EyeSceneHandler.GetMusicController().StartPlaying(); + } + // Letting the original method run in case mods have patched TravelerEyeController.OnStartCosmicJamSession() + } + } +} diff --git a/NewHorizons/Patches/EyeScenePatches/TravelerEyeControllerPatches.cs b/NewHorizons/Patches/EyeScenePatches/TravelerEyeControllerPatches.cs new file mode 100644 index 00000000..d31fca50 --- /dev/null +++ b/NewHorizons/Patches/EyeScenePatches/TravelerEyeControllerPatches.cs @@ -0,0 +1,26 @@ +using HarmonyLib; +using NewHorizons.Handlers; +using System.Linq; + +namespace NewHorizons.Patches.EyeScenePatches +{ + [HarmonyPatch(typeof(TravelerEyeController))] + public static class TravelerEyeControllerPatches + { + [HarmonyPrefix] + [HarmonyPatch(nameof(TravelerEyeController.OnStartCosmicJamSession))] + public static bool TravelerEyeController_OnStartCosmicJamSession(TravelerEyeController __instance) + { + if (!EyeSceneHandler.GetActiveCustomEyeTravelers().Any()) + { + return true; + } + // Not starting the loop audio here; EyeMusicController will handle that + if (__instance._signal != null) + { + __instance._signal.GetOWAudioSource().SetLocalVolume(0f); + } + return false; + } + } +} diff --git a/NewHorizons/Patches/PlayerImpactAudioPatches.cs b/NewHorizons/Patches/PlayerImpactAudioPatches.cs new file mode 100644 index 00000000..bf583229 --- /dev/null +++ b/NewHorizons/Patches/PlayerImpactAudioPatches.cs @@ -0,0 +1,21 @@ +using HarmonyLib; +using NewHorizons.Handlers; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NewHorizons.Patches; + +[HarmonyPatch] +public static class PlayerImpactAudioPatches +{ + [HarmonyPrefix] + [HarmonyPatch(typeof(PlayerImpactAudio), nameof(PlayerImpactAudio.OnImpact))] + public static bool PlayerImpactAudio_OnImpact() + { + // DeathManager and PlayerResources _invincible stops player dying but you still hear the impact sounds which is annoying so we disable them + return !InvulnerabilityHandler.Invincible; + } +} diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 7ed834cb..298e2300 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -74,6 +74,10 @@ "description": "Make this planet part of the dream world", "$ref": "#/definitions/DreamModule" }, + "EyeOfTheUniverse": { + "description": "Add features exclusive to the Eye of the Universe scene", + "$ref": "#/definitions/EyeOfTheUniverseModule" + }, "FocalPoint": { "description": "Make this body into a focal point (barycenter)", "$ref": "#/definitions/FocalPointModule" @@ -850,6 +854,874 @@ } } }, + "EyeOfTheUniverseModule": { + "type": "object", + "additionalProperties": false, + "properties": { + "eyeTravelers": { + "type": "array", + "description": "Add custom travelers to the campfire sequence", + "items": { + "$ref": "#/definitions/EyeTravelerInfo" + } + }, + "instrumentZones": { + "type": "array", + "description": "Add instrument zones which contain puzzles to gather a quantum instrument. You can parent other props to these with `parentPath` ", + "items": { + "$ref": "#/definitions/InstrumentZoneInfo" + } + }, + "quantumInstruments": { + "type": "array", + "description": "Add quantum instruments which cause their associated eye traveler to appear and instrument zones to disappear", + "items": { + "$ref": "#/definitions/QuantumInstrumentInfo" + } + } + } + }, + "EyeTravelerInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "assetBundle": { + "type": "string", + "description": "Relative filepath to an asset-bundle to load the prefab defined in `path` from" + }, + "path": { + "type": "string", + "description": "Either the path in the scene hierarchy of the item to copy or the path to the object in the supplied asset bundle. \nIf empty, will make an empty game object. This can be useful for adding other props to it as its children." + }, + "removeChildren": { + "type": "array", + "description": "A list of children to remove from this detail", + "items": { + "type": "string" + } + }, + "removeComponents": { + "type": "boolean", + "description": "Do we reset all the components on this object? Useful for certain props that have dialogue components attached to\nthem." + }, + "scale": { + "type": "number", + "description": "Scale the prop", + "format": "float", + "default": 1.0 + }, + "stretch": { + "description": "Scale each axis of the prop. Overrides `scale`.", + "$ref": "#/definitions/MVector3" + }, + "keepLoaded": { + "type": "boolean", + "description": "Should this detail stay loaded (visible and collideable) even if you're outside the sector (good for very large props)?\nAlso makes this detail visible on the map.\nKeeping many props loaded is bad for performance so use this only when it's actually relevant\nMost logic/behavior scripts will still only work inside the sector, as most of those scripts break if a sector is not provided." + }, + "hasPhysics": { + "type": "boolean", + "description": "Should this object dynamically move around?\nThis tries to make all mesh colliders convex, as well as adding a sphere collider in case the detail has no others." + }, + "physicsMass": { + "type": "number", + "description": "The mass of the physics object.\nMost pushable props use the default value, which matches the player mass.", + "format": "float", + "default": 0.001 + }, + "physicsRadius": { + "type": "number", + "description": "The radius that the added sphere collider will use for physics collision.\nIf there's already good colliders on the detail, you can make this 0.", + "format": "float", + "default": 1.0 + }, + "physicsSuspendUntilImpact": { + "type": "boolean", + "description": "If true, this detail will stay still until it touches something.\nGood for zero-g props.", + "default": false + }, + "ignoreSun": { + "type": "boolean", + "description": "Set to true if this object's lighting should ignore the effects of sunlight" + }, + "activationCondition": { + "type": "string", + "description": "Activates this game object when the dialogue condition is met" + }, + "deactivationCondition": { + "type": "string", + "description": "Deactivates this game object when the dialogue condition is met" + }, + "blinkWhenActiveChanged": { + "type": "boolean", + "description": "Should the player close their eyes while the activation state changes. Only relevant if activationCondition or deactivationCondition are set.", + "default": true + }, + "item": { + "description": "Should this detail be treated as an interactible item", + "$ref": "#/definitions/ItemInfo" + }, + "itemSocket": { + "description": "Should this detail be treated as a socket for an interactible item", + "$ref": "#/definitions/ItemSocketInfo" + }, + "rotation": { + "description": "Rotation of the object", + "$ref": "#/definitions/MVector3" + }, + "alignRadial": { + "type": [ + "boolean", + "null" + ], + "description": "Do we try to automatically align this object to stand upright relative to the body's center? Stacks with rotation.\nDefaults to true for geysers, tornados, and volcanoes, and false for everything else." + }, + "position": { + "description": "Position of the object", + "$ref": "#/definitions/MVector3" + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" + }, + "id": { + "type": "string", + "description": "A unique ID to associate this traveler with their corresponding quantum instruments and instrument zones. Must be unique for each traveler." + }, + "requiredFact": { + "type": "string", + "description": "If set, the player must know this ship log fact for this traveler (and their instrument zones and quantum instruments) to appear. The fact does not need to exist in the current star system; the player's save data will be checked directly." + }, + "requiredPersistentCondition": { + "type": "string", + "description": "If set, the player must have this persistent dialogue condition set for this traveler (and their instrument zones and quantum instruments) to appear." + }, + "startPlayingCondition": { + "type": "string", + "description": "The dialogue condition that will trigger the traveler to start playing their instrument. Must be unique for each traveler." + }, + "participatingCondition": { + "type": "string", + "description": "If specified, this dialogue condition must be set for the traveler to participate in the campfire song. Otherwise, the song will be able to start without them." + }, + "signal": { + "description": "The audio signal to use for the traveler while playing around the campfire (and also for their paired quantum instrument if another is not specified). The audio clip should be 16 measures at 92 BPM (approximately 42 seconds long).", + "$ref": "#/definitions/SignalInfo" + }, + "finaleAudio": { + "type": "string", + "description": "The audio to use for the traveler during the finale of the campfire song. It should be 8 measures of the main loop at 92 BPM followed by 2 measures of fade-out (approximately 26 seconds long in total). Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." + }, + "dialogue": { + "description": "The dialogue to use for this traveler. If omitted, the first CharacterDialogueTree in the object will be used.", + "$ref": "#/definitions/DialogueInfo" + } + } + }, + "ItemInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "The name of the item to be displayed in the UI. Defaults to the name of the detail object." + }, + "itemType": { + "type": "string", + "description": "The type of the item, which determines its orientation when held and what sockets it fits into. This can be a custom string, or a vanilla ItemType (Scroll, WarpCore, SharedStone, ConversationStone, Lantern, SlideReel, DreamLantern, or VisionTorch). Defaults to the item name." + }, + "interactRange": { + "type": "number", + "description": "The furthest distance where the player can interact with this item. Defaults to two meters, same as most vanilla items. Set this to zero to disable all interaction by default.", + "format": "float", + "default": 2.0 + }, + "colliderRadius": { + "type": "number", + "description": "The radius that the added sphere collider will use for collision and hover detection.\nIf there's already a collider on the detail, you can make this 0.", + "format": "float", + "default": 0.5 + }, + "droppable": { + "type": "boolean", + "description": "Whether the item can be dropped. Defaults to true.", + "default": true + }, + "dropOffset": { + "description": "A relative offset to apply to the item's position when dropping it on the ground.", + "$ref": "#/definitions/MVector3" + }, + "dropNormal": { + "description": "The direction the item will be oriented when dropping it on the ground. Defaults to up (0, 1, 0).", + "$ref": "#/definitions/MVector3" + }, + "holdOffset": { + "description": "A relative offset to apply to the item's position when holding it. The initial position varies for vanilla item types.", + "$ref": "#/definitions/MVector3" + }, + "holdRotation": { + "description": "A relative offset to apply to the item's rotation when holding it.", + "$ref": "#/definitions/MVector3" + }, + "socketOffset": { + "description": "A relative offset to apply to the item's position when placing it into a socket.", + "$ref": "#/definitions/MVector3" + }, + "socketRotation": { + "description": "A relative offset to apply to the item's rotation when placing it into a socket.", + "$ref": "#/definitions/MVector3" + }, + "pickupAudio": { + "type": "string", + "description": "The audio to play when this item is picked up. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." + }, + "dropAudio": { + "type": "string", + "description": "The audio to play when this item is dropped. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." + }, + "socketAudio": { + "type": "string", + "description": "The audio to play when this item is inserted into a socket. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." + }, + "unsocketAudio": { + "type": "string", + "description": "The audio to play when this item is removed from a socket. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." + }, + "pickupCondition": { + "type": "string", + "description": "A dialogue condition to set when picking up this item." + }, + "clearPickupConditionOnDrop": { + "type": "boolean", + "description": "Whether the pickup condition should be cleared when dropping the item. Defaults to true.", + "default": true + }, + "pickupFact": { + "type": "string", + "description": "A ship log fact to reveal when picking up this item." + }, + "pathToInitialSocket": { + "type": "string", + "description": "A relative path from the planet to a socket that this item will be automatically inserted into." + } + } + }, + "ItemSocketInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "rotation": { + "description": "Rotation of the object", + "$ref": "#/definitions/MVector3" + }, + "alignRadial": { + "type": [ + "boolean", + "null" + ], + "description": "Do we try to automatically align this object to stand upright relative to the body's center? Stacks with rotation.\nDefaults to true for geysers, tornados, and volcanoes, and false for everything else." + }, + "position": { + "description": "Position of the object", + "$ref": "#/definitions/MVector3" + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" + }, + "socketPath": { + "type": "string", + "description": "The relative path to a child game object of this detail that will act as the socket point for the item. Will be used instead of this socket's positioning info if set." + }, + "itemType": { + "type": "string", + "description": "The type of item allowed in this socket. This can be a custom string, or a vanilla ItemType (Scroll, WarpCode, SharedStone, ConversationStone, Lantern, SlideReel, DreamLantern, or VisionTorch)." + }, + "interactRange": { + "type": "number", + "description": "The furthest distance where the player can interact with this item socket. Defaults to two meters, same as most vanilla item sockets. Set this to zero to disable all interaction by default.", + "format": "float", + "default": 2.0 + }, + "useGiveTakePrompts": { + "type": "boolean", + "description": "Whether to use \"Give Item\" / \"Take Item\" prompts instead of \"Insert Item\" / \"Remove Item\"." + }, + "insertCondition": { + "type": "string", + "description": "A dialogue condition to set when inserting an item into this socket." + }, + "clearInsertConditionOnRemoval": { + "type": "boolean", + "description": "Whether the insert condition should be cleared when removing the socketed item. Defaults to true.", + "default": true + }, + "insertFact": { + "type": "string", + "description": "A ship log fact to reveal when inserting an item into this socket." + }, + "removalCondition": { + "type": "string", + "description": "A dialogue condition to set when removing an item from this socket, or when the socket is empty." + }, + "clearRemovalConditionOnInsert": { + "type": "boolean", + "description": "Whether the removal condition should be cleared when inserting a socketed item. Defaults to true.", + "default": true + }, + "removalFact": { + "type": "string", + "description": "A ship log fact to reveal when removing an item from this socket, or when the socket is empty." + }, + "colliderRadius": { + "type": "number", + "description": "Default collider radius when interacting with the socket", + "format": "float", + "default": 0.0 + } + } + }, + "SignalInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "audio": { + "type": "string", + "description": "The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." + }, + "minDistance": { + "type": "number", + "description": "At this distance the sound is at its loudest.", + "format": "float" + }, + "maxDistance": { + "type": "number", + "description": "The sound will drop off by this distance (Note: for signals, this only effects when it is heard aloud and not via the signalscope).", + "format": "float", + "default": 5.0 + }, + "volume": { + "type": "number", + "description": "How loud the sound will play", + "format": "float", + "default": 0.5 + }, + "position": { + "description": "Position of the object", + "$ref": "#/definitions/MVector3" + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" + }, + "detectionRadius": { + "type": "number", + "description": "How close the player must get to the signal to detect it. This is when you get the \"Unknown Signal Detected\"\nnotification.", + "format": "float", + "minimum": 0.0 + }, + "frequency": { + "type": "string", + "description": "The frequency ID of the signal. The built-in game values are `Default`, `Traveler`, `Quantum`, `EscapePod`,\n`Statue`, `WarpCore`, `HideAndSeek`, and `Radio`. You can also put a custom value." + }, + "identificationRadius": { + "type": "number", + "description": "How close the player must get to the signal to identify it. This is when you learn its name.", + "format": "float", + "default": 10.0, + "minimum": 0.0 + }, + "insideCloak": { + "type": "boolean", + "description": "Only set to `true` if you are putting this signal inside a cloaking field." + }, + "name": { + "type": "string", + "description": "The unique ID of the signal." + }, + "onlyAudibleToScope": { + "type": "boolean", + "description": "`false` if the player can hear the signal without equipping the signal-scope.", + "default": true + }, + "reveals": { + "type": "string", + "description": "A ship log fact to reveal when the signal is identified.", + "default": "" + }, + "sourceRadius": { + "type": "number", + "description": "Radius of the sphere giving off the signal.", + "format": "float", + "default": 1.0 + } + } + }, + "DialogueInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "position": { + "description": "Position of the object", + "$ref": "#/definitions/MVector3" + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" + }, + "blockAfterPersistentCondition": { + "type": "string", + "description": "Prevents the dialogue from being created after a specific persistent condition is set. Useful for remote dialogue\ntriggers that you want to have happen only once." + }, + "lookAtRadius": { + "type": "number", + "description": "If a pathToAnimController is supplied, if you are within this distance the character will look at you. If it is set\nto 0, they will only look at you when spoken to.", + "format": "float" + }, + "pathToAnimController": { + "type": "string", + "description": "If this dialogue is meant for a character, this is the relative path from the planet to that character's\nCharacterAnimController, TravelerController, TravelerEyeController (eye of the universe), FacePlayerWhenTalking, \nHearthianRecorderEffects or SolanumAnimController.\n\nIf it's a Recorder this will also delete the existing dialogue already attached to that prop.\n\nIf none of those components are present it will add a FacePlayerWhenTalking component.\n\n`pathToAnimController` also makes the dialogue into a child of the anim controller. This can be used with `isRelativeToParent`\nto position the dialogue on relative to the speaker. If you also provide `parentPath`, that will instead override which object \nis the parent, but the anim controller will otherwise function as expected." + }, + "pathToExistingDialogue": { + "type": "string", + "description": "If this dialogue is adding to existing character dialogue, put a path to the game object with the dialogue on it here" + }, + "radius": { + "type": "number", + "description": "Radius of the spherical collision volume where you get the \"talk to\" prompt when looking at. If you use a\nremoteTrigger, you can set this to 0 to make the dialogue only trigger remotely.", + "format": "float" + }, + "range": { + "type": "number", + "description": "Distance from radius the prompt appears", + "format": "float", + "default": 2.0 + }, + "attentionPoint": { + "description": "The point that the camera looks at when dialogue advances.", + "$ref": "#/definitions/AttentionPointInfo" + }, + "swappedAttentionPoints": { + "type": "array", + "description": "Additional points that the camera looks at when dialogue advances through specific dialogue nodes and pages.", + "items": { + "$ref": "#/definitions/SwappedAttentionPointInfo" + } + }, + "remoteTrigger": { + "description": "Allows you to trigger dialogue from a distance when you walk into an area.", + "$ref": "#/definitions/RemoteTriggerInfo" + }, + "xmlFile": { + "type": "string", + "description": "Relative path to the xml file defining the dialogue." + }, + "flashlightToggle": { + "description": "What type of flashlight toggle to do when dialogue is interacted with", + "default": "none", + "$ref": "#/definitions/FlashlightToggle" + } + } + }, + "AttentionPointInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "position": { + "description": "Position of the object", + "$ref": "#/definitions/MVector3" + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" + }, + "offset": { + "description": "An additional offset to apply to apply when the camera looks at this attention point.", + "$ref": "#/definitions/MVector3" + } + } + }, + "SwappedAttentionPointInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "offset": { + "description": "An additional offset to apply to apply when the camera looks at this attention point.", + "$ref": "#/definitions/MVector3" + }, + "position": { + "description": "Position of the object", + "$ref": "#/definitions/MVector3" + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" + }, + "dialogueNode": { + "type": "string", + "description": "The name of the dialogue node to activate this attention point for. If null or blank, activates for every node." + }, + "dialoguePage": { + "type": "integer", + "description": "The index of the page in the current dialogue node to activate this attention point for, if the node has multiple pages.", + "format": "int32" + }, + "lookEasing": { + "type": "number", + "description": "The easing factor which determines how 'snappy' the camera is when looking at the attention point.", + "format": "float", + "default": 1 + } + } + }, + "RemoteTriggerInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "position": { + "description": "Position of the object", + "$ref": "#/definitions/MVector3" + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" + }, + "radius": { + "type": "number", + "description": "The radius of the remote trigger volume.", + "format": "float" + }, + "prereqCondition": { + "type": "string", + "description": "This condition must be met for the remote trigger volume to trigger." + } + } + }, + "FlashlightToggle": { + "type": "string", + "description": "", + "x-enumNames": [ + "TurnOff", + "TurnOffThenOn", + "None" + ], + "enum": [ + "turnOff", + "turnOffThenOn", + "none" + ] + }, + "InstrumentZoneInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "assetBundle": { + "type": "string", + "description": "Relative filepath to an asset-bundle to load the prefab defined in `path` from" + }, + "path": { + "type": "string", + "description": "Either the path in the scene hierarchy of the item to copy or the path to the object in the supplied asset bundle. \nIf empty, will make an empty game object. This can be useful for adding other props to it as its children." + }, + "removeChildren": { + "type": "array", + "description": "A list of children to remove from this detail", + "items": { + "type": "string" + } + }, + "removeComponents": { + "type": "boolean", + "description": "Do we reset all the components on this object? Useful for certain props that have dialogue components attached to\nthem." + }, + "scale": { + "type": "number", + "description": "Scale the prop", + "format": "float", + "default": 1.0 + }, + "stretch": { + "description": "Scale each axis of the prop. Overrides `scale`.", + "$ref": "#/definitions/MVector3" + }, + "keepLoaded": { + "type": "boolean", + "description": "Should this detail stay loaded (visible and collideable) even if you're outside the sector (good for very large props)?\nAlso makes this detail visible on the map.\nKeeping many props loaded is bad for performance so use this only when it's actually relevant\nMost logic/behavior scripts will still only work inside the sector, as most of those scripts break if a sector is not provided." + }, + "hasPhysics": { + "type": "boolean", + "description": "Should this object dynamically move around?\nThis tries to make all mesh colliders convex, as well as adding a sphere collider in case the detail has no others." + }, + "physicsMass": { + "type": "number", + "description": "The mass of the physics object.\nMost pushable props use the default value, which matches the player mass.", + "format": "float", + "default": 0.001 + }, + "physicsRadius": { + "type": "number", + "description": "The radius that the added sphere collider will use for physics collision.\nIf there's already good colliders on the detail, you can make this 0.", + "format": "float", + "default": 1.0 + }, + "physicsSuspendUntilImpact": { + "type": "boolean", + "description": "If true, this detail will stay still until it touches something.\nGood for zero-g props.", + "default": false + }, + "ignoreSun": { + "type": "boolean", + "description": "Set to true if this object's lighting should ignore the effects of sunlight" + }, + "activationCondition": { + "type": "string", + "description": "Activates this game object when the dialogue condition is met" + }, + "deactivationCondition": { + "type": "string", + "description": "Deactivates this game object when the dialogue condition is met" + }, + "blinkWhenActiveChanged": { + "type": "boolean", + "description": "Should the player close their eyes while the activation state changes. Only relevant if activationCondition or deactivationCondition are set.", + "default": true + }, + "item": { + "description": "Should this detail be treated as an interactible item", + "$ref": "#/definitions/ItemInfo" + }, + "itemSocket": { + "description": "Should this detail be treated as a socket for an interactible item", + "$ref": "#/definitions/ItemSocketInfo" + }, + "rotation": { + "description": "Rotation of the object", + "$ref": "#/definitions/MVector3" + }, + "alignRadial": { + "type": [ + "boolean", + "null" + ], + "description": "Do we try to automatically align this object to stand upright relative to the body's center? Stacks with rotation.\nDefaults to true for geysers, tornados, and volcanoes, and false for everything else." + }, + "position": { + "description": "Position of the object", + "$ref": "#/definitions/MVector3" + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" + }, + "id": { + "type": "string", + "description": "The unique ID of the Eye Traveler associated with this instrument zone." + } + } + }, + "QuantumInstrumentInfo": { + "type": "object", + "additionalProperties": false, + "properties": { + "assetBundle": { + "type": "string", + "description": "Relative filepath to an asset-bundle to load the prefab defined in `path` from" + }, + "path": { + "type": "string", + "description": "Either the path in the scene hierarchy of the item to copy or the path to the object in the supplied asset bundle. \nIf empty, will make an empty game object. This can be useful for adding other props to it as its children." + }, + "removeChildren": { + "type": "array", + "description": "A list of children to remove from this detail", + "items": { + "type": "string" + } + }, + "removeComponents": { + "type": "boolean", + "description": "Do we reset all the components on this object? Useful for certain props that have dialogue components attached to\nthem." + }, + "scale": { + "type": "number", + "description": "Scale the prop", + "format": "float", + "default": 1.0 + }, + "stretch": { + "description": "Scale each axis of the prop. Overrides `scale`.", + "$ref": "#/definitions/MVector3" + }, + "keepLoaded": { + "type": "boolean", + "description": "Should this detail stay loaded (visible and collideable) even if you're outside the sector (good for very large props)?\nAlso makes this detail visible on the map.\nKeeping many props loaded is bad for performance so use this only when it's actually relevant\nMost logic/behavior scripts will still only work inside the sector, as most of those scripts break if a sector is not provided." + }, + "hasPhysics": { + "type": "boolean", + "description": "Should this object dynamically move around?\nThis tries to make all mesh colliders convex, as well as adding a sphere collider in case the detail has no others." + }, + "physicsMass": { + "type": "number", + "description": "The mass of the physics object.\nMost pushable props use the default value, which matches the player mass.", + "format": "float", + "default": 0.001 + }, + "physicsRadius": { + "type": "number", + "description": "The radius that the added sphere collider will use for physics collision.\nIf there's already good colliders on the detail, you can make this 0.", + "format": "float", + "default": 1.0 + }, + "physicsSuspendUntilImpact": { + "type": "boolean", + "description": "If true, this detail will stay still until it touches something.\nGood for zero-g props.", + "default": false + }, + "ignoreSun": { + "type": "boolean", + "description": "Set to true if this object's lighting should ignore the effects of sunlight" + }, + "activationCondition": { + "type": "string", + "description": "Activates this game object when the dialogue condition is met" + }, + "deactivationCondition": { + "type": "string", + "description": "Deactivates this game object when the dialogue condition is met" + }, + "blinkWhenActiveChanged": { + "type": "boolean", + "description": "Should the player close their eyes while the activation state changes. Only relevant if activationCondition or deactivationCondition are set.", + "default": true + }, + "item": { + "description": "Should this detail be treated as an interactible item", + "$ref": "#/definitions/ItemInfo" + }, + "itemSocket": { + "description": "Should this detail be treated as a socket for an interactible item", + "$ref": "#/definitions/ItemSocketInfo" + }, + "rotation": { + "description": "Rotation of the object", + "$ref": "#/definitions/MVector3" + }, + "alignRadial": { + "type": [ + "boolean", + "null" + ], + "description": "Do we try to automatically align this object to stand upright relative to the body's center? Stacks with rotation.\nDefaults to true for geysers, tornados, and volcanoes, and false for everything else." + }, + "position": { + "description": "Position of the object", + "$ref": "#/definitions/MVector3" + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" + }, + "id": { + "type": "string", + "description": "The unique ID of the Eye Traveler associated with this quantum instrument." + }, + "gatherCondition": { + "type": "string", + "description": "A dialogue condition to set when gathering this quantum instrument. Use it in conjunction with `activationCondition` or `deactivationCondition` on other details." + }, + "gatherWithScope": { + "type": "boolean", + "description": "Allows gathering this quantum instrument using the zoomed-in signalscope, like Chert's bongos." + }, + "signal": { + "description": "The audio signal emitted by this quantum instrument. The fields `name`, `audio`, and `frequency` will be copied from the corresponding Eye Traveler's signal if not specified here.", + "$ref": "#/definitions/SignalInfo" + }, + "interactRadius": { + "type": "number", + "description": "The radius of the added sphere collider that will be used for interaction.", + "format": "float", + "default": 0.5 + }, + "interactRange": { + "type": "number", + "description": "The furthest distance where the player can interact with this quantum instrument.", + "format": "float", + "default": 2.0 + } + } + }, "FocalPointModule": { "type": "object", "additionalProperties": false, @@ -1523,363 +2395,6 @@ } } }, - "ItemInfo": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": "string", - "description": "The name of the item to be displayed in the UI. Defaults to the name of the detail object." - }, - "itemType": { - "type": "string", - "description": "The type of the item, which determines its orientation when held and what sockets it fits into. This can be a custom string, or a vanilla ItemType (Scroll, WarpCore, SharedStone, ConversationStone, Lantern, SlideReel, DreamLantern, or VisionTorch). Defaults to the item name." - }, - "interactRange": { - "type": "number", - "description": "The furthest distance where the player can interact with this item. Defaults to two meters, same as most vanilla items. Set this to zero to disable all interaction by default.", - "format": "float", - "default": 2.0 - }, - "colliderRadius": { - "type": "number", - "description": "The radius that the added sphere collider will use for collision and hover detection.\nIf there's already a collider on the detail, you can make this 0.", - "format": "float", - "default": 0.5 - }, - "droppable": { - "type": "boolean", - "description": "Whether the item can be dropped. Defaults to true.", - "default": true - }, - "dropOffset": { - "description": "A relative offset to apply to the item's position when dropping it on the ground.", - "$ref": "#/definitions/MVector3" - }, - "dropNormal": { - "description": "The direction the item will be oriented when dropping it on the ground. Defaults to up (0, 1, 0).", - "$ref": "#/definitions/MVector3" - }, - "holdOffset": { - "description": "A relative offset to apply to the item's position when holding it. The initial position varies for vanilla item types.", - "$ref": "#/definitions/MVector3" - }, - "holdRotation": { - "description": "A relative offset to apply to the item's rotation when holding it.", - "$ref": "#/definitions/MVector3" - }, - "socketOffset": { - "description": "A relative offset to apply to the item's position when placing it into a socket.", - "$ref": "#/definitions/MVector3" - }, - "socketRotation": { - "description": "A relative offset to apply to the item's rotation when placing it into a socket.", - "$ref": "#/definitions/MVector3" - }, - "pickupAudio": { - "type": "string", - "description": "The audio to play when this item is picked up. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." - }, - "dropAudio": { - "type": "string", - "description": "The audio to play when this item is dropped. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." - }, - "socketAudio": { - "type": "string", - "description": "The audio to play when this item is inserted into a socket. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." - }, - "unsocketAudio": { - "type": "string", - "description": "The audio to play when this item is removed from a socket. Only applies to custom/non-vanilla item types.\nCan be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." - }, - "pickupCondition": { - "type": "string", - "description": "A dialogue condition to set when picking up this item." - }, - "clearPickupConditionOnDrop": { - "type": "boolean", - "description": "Whether the pickup condition should be cleared when dropping the item. Defaults to true.", - "default": true - }, - "pickupFact": { - "type": "string", - "description": "A ship log fact to reveal when picking up this item." - }, - "pathToInitialSocket": { - "type": "string", - "description": "A relative path from the planet to a socket that this item will be automatically inserted into." - } - } - }, - "ItemSocketInfo": { - "type": "object", - "additionalProperties": false, - "properties": { - "rotation": { - "description": "Rotation of the object", - "$ref": "#/definitions/MVector3" - }, - "alignRadial": { - "type": [ - "boolean", - "null" - ], - "description": "Do we try to automatically align this object to stand upright relative to the body's center? Stacks with rotation.\nDefaults to true for geysers, tornados, and volcanoes, and false for everything else." - }, - "position": { - "description": "Position of the object", - "$ref": "#/definitions/MVector3" - }, - "isRelativeToParent": { - "type": "boolean", - "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." - }, - "parentPath": { - "type": "string", - "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." - }, - "rename": { - "type": "string", - "description": "An optional rename of this object" - }, - "socketPath": { - "type": "string", - "description": "The relative path to a child game object of this detail that will act as the socket point for the item. Will be used instead of this socket's positioning info if set." - }, - "itemType": { - "type": "string", - "description": "The type of item allowed in this socket. This can be a custom string, or a vanilla ItemType (Scroll, WarpCode, SharedStone, ConversationStone, Lantern, SlideReel, DreamLantern, or VisionTorch)." - }, - "interactRange": { - "type": "number", - "description": "The furthest distance where the player can interact with this item socket. Defaults to two meters, same as most vanilla item sockets. Set this to zero to disable all interaction by default.", - "format": "float", - "default": 2.0 - }, - "useGiveTakePrompts": { - "type": "boolean", - "description": "Whether to use \"Give Item\" / \"Take Item\" prompts instead of \"Insert Item\" / \"Remove Item\"." - }, - "insertCondition": { - "type": "string", - "description": "A dialogue condition to set when inserting an item into this socket." - }, - "clearInsertConditionOnRemoval": { - "type": "boolean", - "description": "Whether the insert condition should be cleared when removing the socketed item. Defaults to true.", - "default": true - }, - "insertFact": { - "type": "string", - "description": "A ship log fact to reveal when inserting an item into this socket." - }, - "removalCondition": { - "type": "string", - "description": "A dialogue condition to set when removing an item from this socket, or when the socket is empty." - }, - "clearRemovalConditionOnInsert": { - "type": "boolean", - "description": "Whether the removal condition should be cleared when inserting a socketed item. Defaults to true.", - "default": true - }, - "removalFact": { - "type": "string", - "description": "A ship log fact to reveal when removing an item from this socket, or when the socket is empty." - }, - "colliderRadius": { - "type": "number", - "description": "Default collider radius when interacting with the socket", - "format": "float", - "default": 0.0 - } - } - }, - "DialogueInfo": { - "type": "object", - "additionalProperties": false, - "properties": { - "position": { - "description": "Position of the object", - "$ref": "#/definitions/MVector3" - }, - "isRelativeToParent": { - "type": "boolean", - "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." - }, - "parentPath": { - "type": "string", - "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." - }, - "rename": { - "type": "string", - "description": "An optional rename of this object" - }, - "blockAfterPersistentCondition": { - "type": "string", - "description": "Prevents the dialogue from being created after a specific persistent condition is set. Useful for remote dialogue\ntriggers that you want to have happen only once." - }, - "lookAtRadius": { - "type": "number", - "description": "If a pathToAnimController is supplied, if you are within this distance the character will look at you. If it is set\nto 0, they will only look at you when spoken to.", - "format": "float" - }, - "pathToAnimController": { - "type": "string", - "description": "If this dialogue is meant for a character, this is the relative path from the planet to that character's\nCharacterAnimController, TravelerController, TravelerEyeController (eye of the universe), FacePlayerWhenTalking, \nHearthianRecorderEffects or SolanumAnimController.\n\nIf it's a Recorder this will also delete the existing dialogue already attached to that prop.\n\nIf none of those components are present it will add a FacePlayerWhenTalking component.\n\n`pathToAnimController` also makes the dialogue into a child of the anim controller. This can be used with `isRelativeToParent`\nto position the dialogue on relative to the speaker. If you also provide `parentPath`, that will instead override which object \nis the parent, but the anim controller will otherwise function as expected." - }, - "pathToExistingDialogue": { - "type": "string", - "description": "If this dialogue is adding to existing character dialogue, put a path to the game object with the dialogue on it here" - }, - "radius": { - "type": "number", - "description": "Radius of the spherical collision volume where you get the \"talk to\" prompt when looking at. If you use a\nremoteTrigger, you can set this to 0 to make the dialogue only trigger remotely.", - "format": "float" - }, - "range": { - "type": "number", - "description": "Distance from radius the prompt appears", - "format": "float", - "default": 2.0 - }, - "attentionPoint": { - "description": "The point that the camera looks at when dialogue advances.", - "$ref": "#/definitions/AttentionPointInfo" - }, - "swappedAttentionPoints": { - "type": "array", - "description": "Additional points that the camera looks at when dialogue advances through specific dialogue nodes and pages.", - "items": { - "$ref": "#/definitions/SwappedAttentionPointInfo" - } - }, - "remoteTrigger": { - "description": "Allows you to trigger dialogue from a distance when you walk into an area.", - "$ref": "#/definitions/RemoteTriggerInfo" - }, - "xmlFile": { - "type": "string", - "description": "Relative path to the xml file defining the dialogue." - }, - "flashlightToggle": { - "description": "What type of flashlight toggle to do when dialogue is interacted with", - "default": "none", - "$ref": "#/definitions/FlashlightToggle" - } - } - }, - "AttentionPointInfo": { - "type": "object", - "additionalProperties": false, - "properties": { - "position": { - "description": "Position of the object", - "$ref": "#/definitions/MVector3" - }, - "isRelativeToParent": { - "type": "boolean", - "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." - }, - "parentPath": { - "type": "string", - "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." - }, - "rename": { - "type": "string", - "description": "An optional rename of this object" - }, - "offset": { - "description": "An additional offset to apply to apply when the camera looks at this attention point.", - "$ref": "#/definitions/MVector3" - } - } - }, - "SwappedAttentionPointInfo": { - "type": "object", - "additionalProperties": false, - "properties": { - "offset": { - "description": "An additional offset to apply to apply when the camera looks at this attention point.", - "$ref": "#/definitions/MVector3" - }, - "position": { - "description": "Position of the object", - "$ref": "#/definitions/MVector3" - }, - "isRelativeToParent": { - "type": "boolean", - "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." - }, - "parentPath": { - "type": "string", - "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." - }, - "rename": { - "type": "string", - "description": "An optional rename of this object" - }, - "dialogueNode": { - "type": "string", - "description": "The name of the dialogue node to activate this attention point for. If null or blank, activates for every node." - }, - "dialoguePage": { - "type": "integer", - "description": "The index of the page in the current dialogue node to activate this attention point for, if the node has multiple pages.", - "format": "int32" - }, - "lookEasing": { - "type": "number", - "description": "The easing factor which determines how 'snappy' the camera is when looking at the attention point.", - "format": "float", - "default": 1 - } - } - }, - "RemoteTriggerInfo": { - "type": "object", - "additionalProperties": false, - "properties": { - "position": { - "description": "Position of the object", - "$ref": "#/definitions/MVector3" - }, - "isRelativeToParent": { - "type": "boolean", - "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." - }, - "parentPath": { - "type": "string", - "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." - }, - "rename": { - "type": "string", - "description": "An optional rename of this object" - }, - "radius": { - "type": "number", - "description": "The radius of the remote trigger volume.", - "format": "float" - }, - "prereqCondition": { - "type": "string", - "description": "This condition must be met for the remote trigger volume to trigger." - } - } - }, - "FlashlightToggle": { - "type": "string", - "description": "", - "x-enumNames": [ - "TurnOff", - "TurnOffThenOn", - "None" - ], - "enum": [ - "turnOff", - "turnOffThenOn", - "none" - ] - }, "EntryLocationInfo": { "type": "object", "additionalProperties": false, @@ -2800,90 +3315,6 @@ "whiteHole" ] }, - "SignalInfo": { - "type": "object", - "additionalProperties": false, - "properties": { - "audio": { - "type": "string", - "description": "The audio to use. Can be a path to a .wav/.ogg/.mp3 file, or taken from the AudioClip list." - }, - "minDistance": { - "type": "number", - "description": "At this distance the sound is at its loudest.", - "format": "float" - }, - "maxDistance": { - "type": "number", - "description": "The sound will drop off by this distance (Note: for signals, this only effects when it is heard aloud and not via the signalscope).", - "format": "float", - "default": 5.0 - }, - "volume": { - "type": "number", - "description": "How loud the sound will play", - "format": "float", - "default": 0.5 - }, - "position": { - "description": "Position of the object", - "$ref": "#/definitions/MVector3" - }, - "isRelativeToParent": { - "type": "boolean", - "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." - }, - "parentPath": { - "type": "string", - "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." - }, - "rename": { - "type": "string", - "description": "An optional rename of this object" - }, - "detectionRadius": { - "type": "number", - "description": "How close the player must get to the signal to detect it. This is when you get the \"Unknown Signal Detected\"\nnotification.", - "format": "float", - "minimum": 0.0 - }, - "frequency": { - "type": "string", - "description": "The frequency ID of the signal. The built-in game values are `Default`, `Traveler`, `Quantum`, `EscapePod`,\n`Statue`, `WarpCore`, `HideAndSeek`, and `Radio`. You can also put a custom value." - }, - "identificationRadius": { - "type": "number", - "description": "How close the player must get to the signal to identify it. This is when you learn its name.", - "format": "float", - "default": 10.0, - "minimum": 0.0 - }, - "insideCloak": { - "type": "boolean", - "description": "Only set to `true` if you are putting this signal inside a cloaking field." - }, - "name": { - "type": "string", - "description": "The unique ID of the signal." - }, - "onlyAudibleToScope": { - "type": "boolean", - "description": "`false` if the player can hear the signal without equipping the signal-scope.", - "default": true - }, - "reveals": { - "type": "string", - "description": "A ship log fact to reveal when the signal is identified.", - "default": "" - }, - "sourceRadius": { - "type": "number", - "description": "Radius of the sphere giving off the signal.", - "format": "float", - "default": 1.0 - } - } - }, "RemoteInfo": { "type": "object", "additionalProperties": false, diff --git a/NewHorizons/Utility/Geometry/BoundsUtilities.cs b/NewHorizons/Utility/Geometry/BoundsUtilities.cs index b251a6d7..9f60ce0d 100644 --- a/NewHorizons/Utility/Geometry/BoundsUtilities.cs +++ b/NewHorizons/Utility/Geometry/BoundsUtilities.cs @@ -40,6 +40,7 @@ public static class BoundsUtilities } } + // BUG: ignores skinned guys. this coincidentally makes it work without BoxShapeFixer public static Bounds GetBoundsOfSelfAndChildMeshes(GameObject gameObject) { var meshFilters = gameObject.GetComponentsInChildren(); @@ -57,14 +58,14 @@ public static class BoundsUtilities var localCorners = new Vector3[] { - bounds.min, - bounds.max, - new Vector3(bounds.min.x, bounds.min.y, bounds.max.z), - new Vector3(bounds.min.x, bounds.max.y, bounds.min.z), - new Vector3(bounds.max.x, bounds.min.y, bounds.min.z), - new Vector3(bounds.min.x, bounds.max.y, bounds.max.z), - new Vector3(bounds.max.x, bounds.min.y, bounds.max.z), - new Vector3(bounds.max.x, bounds.max.y, bounds.min.z), + bounds.min, + bounds.max, + new Vector3(bounds.min.x, bounds.min.y, bounds.max.z), + new Vector3(bounds.min.x, bounds.max.y, bounds.min.z), + new Vector3(bounds.max.x, bounds.min.y, bounds.min.z), + new Vector3(bounds.min.x, bounds.max.y, bounds.max.z), + new Vector3(bounds.max.x, bounds.min.y, bounds.max.z), + new Vector3(bounds.max.x, bounds.max.y, bounds.min.z), }; var globalCorners = localCorners.Select(meshFilter.transform.TransformPoint).ToArray(); diff --git a/NewHorizons/Utility/Geometry/BoxShapeFinder.cs b/NewHorizons/Utility/Geometry/BoxShapeFinder.cs index ebdfd9e4..1c0173a8 100644 --- a/NewHorizons/Utility/Geometry/BoxShapeFinder.cs +++ b/NewHorizons/Utility/Geometry/BoxShapeFinder.cs @@ -3,7 +3,14 @@ using UnityEngine; namespace NewHorizons.Utility.Geometry; -internal class BoxShapeFixer : MonoBehaviour +/// +/// for some reason mesh bounds are wrong unless we wait a bit +/// so this script contiously checks everything until it is correct +/// +/// this actually only seems to be a problem with skinned renderers. normal ones work fine +/// TODO: at some point narrow this down to just skinned, instead of doing everything and checking every frame +/// +public class BoxShapeFixer : MonoBehaviour { public BoxShape shape; public MeshFilter meshFilter; @@ -13,27 +20,16 @@ internal class BoxShapeFixer : MonoBehaviour { if (meshFilter == null && skinnedMeshRenderer == null) { - NHLogger.LogVerbose("Useless BoxShapeFixer, destroying"); DestroyImmediate(this); + NHLogger.LogVerbose("Useless BoxShapeFixer, destroying"); + DestroyImmediate(this); } Mesh sharedMesh = null; - if (meshFilter != null) - { - sharedMesh = meshFilter.sharedMesh; - } - if (skinnedMeshRenderer != null) - { - sharedMesh = skinnedMeshRenderer.sharedMesh; - } + if (meshFilter != null) sharedMesh = meshFilter.sharedMesh; + if (skinnedMeshRenderer != null) sharedMesh = skinnedMeshRenderer.sharedMesh; - if (sharedMesh == null) - { - return; - } - if (sharedMesh.bounds.size == Vector3.zero) - { - return; - } + if (sharedMesh == null) return; + if (sharedMesh.bounds.size == Vector3.zero) return; shape.size = sharedMesh.bounds.size; shape.center = sharedMesh.bounds.center; diff --git a/NewHorizons/manifest.json b/NewHorizons/manifest.json index b1487c71..3503b410 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.25.1", + "version": "1.26.0", "owmlVersion": "2.12.1", "dependencies": [ "JohnCorby.VanillaFix", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ], "conflicts": [ "PacificEngine.OW_CommonResources" ], diff --git a/README.md b/README.md index cab6d6ce..75307d4f 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ Translation credits: - Spanish: Ciborgm9, Ink, GayCoffee - French: xen - Japanese: TRSasasusu +- Portuguese: avengerx, loco-choco New Horizons was based off [Marshmallow](https://github.com/misternebula/Marshmallow) was made by: diff --git a/docs/src/assets/docs-images/eye_of_the_universe/animController.webp b/docs/src/assets/docs-images/eye_of_the_universe/animController.webp new file mode 100644 index 00000000..5e1e2f8c Binary files /dev/null and b/docs/src/assets/docs-images/eye_of_the_universe/animController.webp differ diff --git a/docs/src/content/docs/guides/eye-of-the-universe.mdx b/docs/src/content/docs/guides/eye-of-the-universe.mdx new file mode 100644 index 00000000..0a02d614 --- /dev/null +++ b/docs/src/content/docs/guides/eye-of-the-universe.mdx @@ -0,0 +1,342 @@ +--- +title: Eye of the Universe +description: A guide to adding additional content to the Eye of the Universe with New Horizons +--- + +import { Aside } from "@astrojs/starlight/components"; + +This guide covers some 'gotchas' and features unique to the Eye of the Universe. + +## Extending the Eye of the Universe + +### Star System + +To define a Star System config for the Eye of the Universe, name your star system config file `EyeOfTheUniverse.json` or specify the `"name"` as `"EyeOfTheUniverse"`. Note that many of the star system features have no effect at the Eye compared to a regular custom star system. + +```json title="systems/EyeOfTheUniverse.json" +{ + "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/star_system_schema.json", + "name": "EyeOfTheUniverse", + // etc. +} +``` + +### Existing Planet + +The existing areas of the Eye of the Universe, such as the "sixth planet" and funnel, the museum/observatory, the forest of galaxies, and the campfire, are all contained within one static "planet" (despite visually being distinct locations). To add to these areas, you'll need to specify a planet config file with a `"name"` of `"EyeOfTheUniverse"` and *also* a `"starSystem"` of `"EyeOfTheUniverse"`, as the star system and "planet" share the same name. + +```json title="planets/EyeOfTheUniverse.json" +{ + "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json", + "name": "EyeOfTheUniverse", + "starSystem": "EyeOfTheUniverse", + "Props": { + "details": [ + // etc. + ] + }, + // etc. +} +``` + +### The Vessel + +You can also add props to the Vessel at the Eye: + +```json title="planets/Vessel.json" +{ + "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json", + "name": "Vessel", + "starSystem": "EyeOfTheUniverse", + "Props": { + "details": [ + // etc. + ] + }, + // etc. +} +``` + +## Eye Travelers + +Eye Travelers are a special kind of detail prop (see [Detailing](/guides/details/)) that get added in as additional characters around the campfire at the end of the Eye sequence, similar to Solanum and the Prisoner in the vanilla game. + +At minimum, you will need a character object to act as the traveler, an audio file for the looping part of the new instrument track, an audio file to layer over the finale, a dialogue XML file with certain dialogue conditions set up, and a [quantum instrument](#quantum-instruments). + +The traveler will only appear once their quantum instrument is gathered. After that, they will appear in the circle around the campfire, and they can be interacted with through dialogue to start playing their instrument. The instrument audio is handled via a signal on the traveler that only becomes audible after talking to them. + +Custom travelers will automatically be included in the inflation animation that pushes everyone away from the campfire at the end of the sequence. + +[Eye Travelers](#eye-travelers), [Quantum Instruments](#quantum-instruments), and [Instrument Zones](#instrument-zones) are all linked by their `"id"` properties. Ensure that your ID matches between those details and is unique enough to not conflict with other mods. + +Here's an example config: +```json title="planets/EyeOfTheUniverse.json" +{ + "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json", + "name": "EyeOfTheUniverse", + "starSystem": "EyeOfTheUniverse", + "EyeOfTheUniverse": { + "eyeTravelers": [ + { + "id": "Slate", + "signal": { + "name": "Slate", + "audio": "planets/MetronomeLoop.wav", + "detectionRadius": 0, + "identificationRadius": 10, + "onlyAudibleToScope": false, + "position": {"x": 0, "y": 0.75, "z": 0}, + "isRelativeToParent": true + }, + "finaleAudio": "planets/MetronomeFinale.wav", + "startPlayingCondition": "EyeSlatePlaying", + "participatingCondition": "EyeSlateParticipating", + "dialogue": { + "xmlFile": "planets/EyeSlate.xml", + "position": {"x": 0.0, "y": 1.5, "z": 0.0}, + "isRelativeToParent": true + }, + "path": "TimberHearth_Body/Sector_TH/Sector_Village/Sector_StartingCamp/Characters_StartingCamp/Villager_HEA_Slate" + } + ] + } +} +``` + +To see the full list of eye traveler properties and descriptions of what each property does, check [the EyeTravelerInfo schema](/schemas/body-schema/defs/eyetravelerinfo/). + + + +### Audio + +The looping audio clip is used for the signals emitted by the traveler and their quantum instrument, and is the audio that gets played when they play their instrument. It should be a WAV file with 16 measures of music at 92 BPM (exactly 2,003,478 samples at 48,000 Hz, or approximately 42 seconds long). It is highly recommended that you use Audacity or another audio editor to trim your audio clip to exactly the same length as one of the vanilla traveler audio clips, or else it will fall gradually out of sync with the other instrument loops. + +The finale audio clip is only played once, after all travelers have started playing. It should be 8 measures of the main loop at 92 BPM followed by 2 measures of fade-out (approximately 26 seconds long in total). Unlike the looping audio clip, it does not need to precisely match the length of the vanilla finale clip; it can end early or continue playing after the other ends. + +The game plays all of the looping audio clips (including your custom one) simultaneously once you tell the first traveler to start playing, and then fades them in one by one as you talk to the others. After all travelers are playing, the game selects a finale audio clip that contains all Hearthian and Nomai/Owlk instruments mixed into one file, and then your custom finale audio clip will be layered over whichever vanilla clip plays. Only include your own instrument in the clip, and ensure it sounds okay alongside Solanum, the Prisoner, and both/neither. + +### Dialogue + +The dialogue XML for your traveler works like other dialogue (see the [Dialogue](/guides/dialogue/) guide) but there are specially named conditions you will need to use for the functionality to work as expected: +- Use `AnyTravelersGathered` to check if any traveler has been gathered yet. This includes Riebeck and Esker, so it should always be true, unless you forcibly enable your traveler to be enabled early. +- Use `AllTravelersGathered` to check if all of the travelers have been gathered and are ready to start playing. +- Use `JamSessionIsOver` to check if the travelers have stopped playing the song and the sphere of possibilities has appeared. +- Use a `` with the condition defined in your eye traveler config's `"startPlayingCondition"` on the node or dialogue option that should make your traveler start playing their instrument. This condition name must be unique and not conflict with other mods. +- If you want your traveler to be present but have an option to not participate in the campfire song (like the Prisoner), use a `` with the condition defined in your eye traveler config's `"participatingCondition"` on the node or dialogue option where your traveler agrees to join in. This condition name must be unique and not conflict with other mods. + +```xml title="planets/dialogue/SlateEyeTraveler.xml" + + Slate, Probably + + WAITING_FOR_OTHERS + DEFAULT + + It's me, definitely Slate and not a dreamstalker in disguise. + + + + ANY_GATHERED + AnyTravelersGathered + + You still have other travelers to gather. + + + + You're going to join in, right? + PARTICIPATING + + + Okay then... + + + + + PARTICIPATING + + Sure. + + EyeSlateParticipating + + + READY_TO_PLAY + AllTravelersGathered + + We're all here. Time to start the music. + + + + Ready to go. + START_PLAYING + + + Not yet. + NOT_YET + + + + + START_PLAYING + + Let's begin. + + EyeSlatePlaying + + + NOT_YET + + Whenever you're ready. + + + + FAREWELL + JamSessionIsOver + + It's rewind time. + + + +``` + +### Custom Animation + +To add custom animations to your Eye Traveler, there is some setup work that has to be done in Unity. You will need to set up your character in Unity and load them via asset bundle, like you would any other detail: + +```json title="planets/EyeOfTheUniverse.json" +{ + "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json", + "name": "EyeOfTheUniverse", + "starSystem": "EyeOfTheUniverse", + "EyeOfTheUniverse": { + "eyeTravelers": [ + { + "id": "MyCoolEyeGuy", + "assetBundle": "planets/bundles/eyeoftheuniverse", + "path": "Assets/EyeOfTheUniverse/Traveler/MyCoolEyeGuy.prefab" + } + ] + } +} +``` + +Next, create an Animator Controller asset in Unity with at least two states, named "Idle" and "PlayingInstrument". You can assign whatever animation clip you like to these states, but the names of the states must match exactly. The default Idle state will play when the traveler is first spawned in, and will transition to the PlayingInstrument state when the right conditions are met to start playing the instrument. Ensure that both animation clips are set to loop in their import settings. + +Add a boolean Parameter in the left panel named "Playing". This will be set to true when the traveler starts playing their instrument. + +Add a transition in both directions between the Idle and PlayingInstrument states. Uncheck "Has Exit Time" for both transitions and adjust the other timing settings as desired. + +Add a Condition on the `Idle -> PlayingInstrument` transition to check for `Playing` = `true`, and the inverse for `PlayingInstrument -> Idle`. + +![animController](@/assets/docs-images/eye_of_the_universe/animController.webp) + +In your character object, find the `Animator` component and set its `Controller` property to the Animator Controller asset you created. If you have a `TravelerEyeController` component in your object, set its `_animator` property to your Animator component. + +If everything was set up correctly, your character should play their animations in-game. + +## Quantum Instruments + +Quantum instruments are the interactible instruments, typically hidden by a short 'puzzle', that cause their corresponding traveler to appear around the campfire. They are just like any other detail prop (see [Detailing](/guides/details/)) but they have additional handling to only activate after gathering and speaking to Riebeck, like the other instrument 'puzzles' in the Eye sequence. + +If not specified, the quantum instrument will inherit some of the properties for its `"signal"` from the corresponding eye traveler config. + +If you want other objects besides the traveler to appear or disappear in response to gathering the instrument, specify a custom dialogue condition name for `"gatherCondition"` and use that same condition as the `"activationCondition"` or `"deactivationCondition"` for the details you want to toggle. + +Quantum instruments will automatically be included in the inflation animation that pushes everyone away from the campfire at the end of the sequence. + +[Eye Travelers](#eye-travelers), [Quantum Instruments](#quantum-instruments), and [Instrument Zones](#instrument-zones) are all linked by their `"id"` properties. Ensure that your ID matches between those details and is unique enough to not conflict with other mods. + +```json title="planets/EyeOfTheUniverse.json" +{ + "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json", + "name": "EyeOfTheUniverse", + "starSystem": "EyeOfTheUniverse", + "EyeOfTheUniverse": { + "eyeTravelers": [ + { + "id": "Slate", + "signal": { + "name": "Slate", + "audio": "planets/MetronomeLoop.wav" + // etc. + }, + // etc. + } + ], + "quantumInstruments": [ + { + "id": "Slate", + "gatherWithScope": false, + "gatherCondition": "EyeSlateGather", + "path": "TimberHearth_Body/Sector_TH/Sector_Village/Sector_StartingCamp/Props_StartingCamp/OtherComponentsGroup/Props_HEA_CampsiteLogAssets/Props_HEA_MarshmallowCanOpened", + "position": {"x": -43.94369, "y": 0, "z": 7506.436}, + "signal": { + "detectionRadius": 0, + "identificationRadius": 10, + "position": {"x": 0, "y": 0.1, "z": 0}, + "isRelativeToParent": true + } + } + ] + } +} +``` + +To see the full list of quantum instrument properties and descriptions of what each property does, check [the QuantumInstrumentInfo schema](/schemas/body-schema/defs/quantuminstrumentinfo/). + +## Instrument Zones + +Instrument zones are just like any other detail prop (see [Detailing](/guides/details/)) but they have additional handling to only activate after gathering and speaking to Riebeck, like the other instrument 'puzzles' in the Eye sequence. + +Custom instrument zones will automatically be included in the inflation animation that pushes everyone away from the campfire at the end of the sequence. + +[Eye Travelers](#eye-travelers), [Quantum Instruments](#quantum-instruments), and [Instrument Zones](#instrument-zones) are all linked by their `"id"` properties. Ensure that your ID matches between those details and is unique enough to not conflict with other mods. + +```json title="planets/EyeOfTheUniverse.json" +{ + "$schema": "https://raw.githubusercontent.com/Outer-Wilds-New-Horizons/new-horizons/main/NewHorizons/Schemas/body_schema.json", + "name": "EyeOfTheUniverse", + "starSystem": "EyeOfTheUniverse", + "EyeOfTheUniverse": { + "eyeTravelers": [ + { + "id": "Slate", + // etc. + } + ], + "instrumentZones": [ + { + "id": "Slate", + "deactivationCondition": "EyeSlateGather", + "path": "TimberHearth_Body/Sector_TH/Sector_Village/Sector_StartingCamp/Props_StartingCamp/OtherComponentsGroup/Props_HEA_CampsiteLogAssets", + "removeChildren": [ + "Props_HEA_MarshmallowCanOpened" + ], + "position": {"x": -43.30302, "y": 0, "z": 7507.822} + } + ] + } +} +``` + +To see the full list of instrument zone properties and descriptions of what each property does, check [the InstrumentZoneInfo schema](/schemas/body-schema/defs/instrumentzoneinfo/). + +## Eye-Specific Considerations + +#### Cross-System Details + +Specifying details with a `"path"` pointing to an object in the regular solar system normally wouldn't work, as the Eye of the Universe lives in a completely separate scene from the rest of the game and those objects don't exist at the Eye. New Horizons works around this by force-loading the regular solar system, grabbing any objects referenced in Eye of the Universe config files, and then attempting to preserve these objects when loading the Eye of the Universe scene. This can cause issues with many different kinds of props, especially interactive ones that depend on some other part of the solar system existing. + +Because the objects are not available outside of this workaround, objects from the regular solar system cannot be spawned in via the New Horizons API. + +#### Custom Planets + +While you *can* define completely custom planets the same as you would in a regular custom solar system, they may exhibit weird orbital behaviors or pass through the existing static Eye of the Universe objects. Prefer adding onto the existing bodies or setting a `"staticPosition"` on your planet configs to lock them in place. + +#### The Player Ship and Ship Logs + +The player's ship does not exist in the Eye of the Universe scene. In addition to the obvious issues this causes (no access to the ship's warp functionality, ship spawn points being non-functional, etc.), the ship log computer not existing causes some methods of checking and learning ship log facts to not function at all while at the Eye. If you need to track whether the player has met certain conditions elsewhere in the game (for example, if they've previously met a character that you now want to appear at the campfire), consider using a Persistent Dialogue Condition, which does not have these issues. + +#### Mod Compatibility + +Other existing and future story mods will want to add additional content to the Eye of the Universe, and unlike entirely custom planets and star systems, there is a high probability that objects placed at the Eye may overlap with those placed by other mods. When testing, try installing as many of these other mods as possible and seeing if the objects they add overlap with yours. If so, consider moving your objects to a different position. When possible, use New Horizons features that preserve compatibility between mods. \ No newline at end of file