diff --git a/NewHorizons/Builder/Atmosphere/AirBuilder.cs b/NewHorizons/Builder/Atmosphere/AirBuilder.cs index 209a2b26..e4518e4c 100644 --- a/NewHorizons/Builder/Atmosphere/AirBuilder.cs +++ b/NewHorizons/Builder/Atmosphere/AirBuilder.cs @@ -9,7 +9,7 @@ namespace NewHorizons.Builder.Atmosphere var airGO = new GameObject("Air"); airGO.SetActive(false); airGO.layer = 17; - airGO.transform.parent = sector?.transform ? sector.transform : planetGO.transform; + airGO.transform.parent = sector?.transform ?? planetGO.transform; var sc = airGO.AddComponent(); sc.isTrigger = true; diff --git a/NewHorizons/Builder/Body/SingularityBuilder.cs b/NewHorizons/Builder/Body/SingularityBuilder.cs index 0c4d12f1..432c57f0 100644 --- a/NewHorizons/Builder/Body/SingularityBuilder.cs +++ b/NewHorizons/Builder/Body/SingularityBuilder.cs @@ -88,9 +88,8 @@ namespace NewHorizons.Builder.Body Vector3 localPosition = singularity?.position == null ? Vector3.zero : singularity.position; Vector3 localRotation = singularity?.rotation == null ? Vector3.zero : singularity.rotation; - GameObject newSingularity = null; - newSingularity = MakeSingularity(go, sector, localPosition, localRotation, polarity, horizonRadius, distortRadius, - hasHazardVolume, singularity.targetStarSystem, singularity.curve, singularity.hasWarpEffects, singularity.renderQueueOverride); + GameObject newSingularity = MakeSingularity(go, sector, localPosition, localRotation, polarity, horizonRadius, distortRadius, + hasHazardVolume, singularity.targetStarSystem, singularity.curve, singularity.hasWarpEffects, singularity.renderQueueOverride, singularity.rename, singularity.parentPath, singularity.isRelativeToParent); var uniqueID = string.IsNullOrEmpty(singularity.uniqueID) ? config.name : singularity.uniqueID; _singularitiesByID.Add(uniqueID, newSingularity); @@ -134,15 +133,32 @@ namespace NewHorizons.Builder.Body } public static GameObject MakeSingularity(GameObject planetGO, Sector sector, Vector3 position, Vector3 rotation, bool polarity, float horizon, float distort, - bool hasDestructionVolume, string targetStarSystem = null, TimeValuePair[] curve = null, bool warpEffects = true, int renderQueue = 2985) + bool hasDestructionVolume, string targetStarSystem = null, TimeValuePair[] curve = null, bool warpEffects = true, int renderQueue = 2985, string rename = null, string parentPath = null, bool isRelativeToParent = false) { InitPrefabs(); // polarity true = black, false = white - var singularity = new GameObject(polarity ? "BlackHole" : "WhiteHole"); + var singularity = new GameObject(!string.IsNullOrEmpty(rename) ? rename : (polarity ? "BlackHole" : "WhiteHole")); singularity.transform.parent = sector?.transform ?? planetGO.transform; - singularity.transform.position = planetGO.transform.TransformPoint(position); + + if (!string.IsNullOrEmpty(parentPath)) + { + var newParent = planetGO.transform.Find(parentPath); + if (newParent != null) + { + singularity.transform.parent = newParent; + } + else + { + Logger.LogWarning($"Cannot find parent object at path: {planetGO.name}/{parentPath}"); + } + } + + if (isRelativeToParent) + singularity.transform.localPosition = position; + else + singularity.transform.position = planetGO.transform.TransformPoint(position); var singularityRenderer = MakeSingularityGraphics(singularity, polarity, horizon, distort, renderQueue); @@ -257,7 +273,11 @@ namespace NewHorizons.Builder.Body whiteHoleFluidVolume.enabled = true; } - singularity.transform.rotation = planetGO.transform.TransformRotation(Quaternion.Euler(rotation)); + var rot = Quaternion.Euler(rotation); + if (isRelativeToParent) + singularity.transform.localRotation = rot; + else + singularity.transform.rotation = planetGO.transform.TransformRotation(rot); singularity.SetActive(true); return singularity; diff --git a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs index 48bfc824..6acfd8c1 100644 --- a/NewHorizons/Builder/Props/BrambleNodeBuilder.cs +++ b/NewHorizons/Builder/Props/BrambleNodeBuilder.cs @@ -192,7 +192,7 @@ namespace NewHorizons.Builder.Props var outerFogWarpVolume = GetOuterFogWarpVolumeFromAstroObject(go); var fogLight = brambleNode.GetComponent(); - brambleNode.transform.parent = sector.transform; + brambleNode.transform.parent = sector?.transform ?? go.transform; brambleNode.transform.position = go.transform.TransformPoint(config.position ?? Vector3.zero); brambleNode.transform.rotation = go.transform.TransformRotation(Quaternion.Euler(config.rotation ?? Vector3.zero)); brambleNode.name = config.name ?? "Bramble Node to " + config.linksTo; diff --git a/NewHorizons/Builder/Props/GeyserBuilder.cs b/NewHorizons/Builder/Props/GeyserBuilder.cs index 2ef988d8..dd6a12ce 100644 --- a/NewHorizons/Builder/Props/GeyserBuilder.cs +++ b/NewHorizons/Builder/Props/GeyserBuilder.cs @@ -1,6 +1,8 @@ using NewHorizons.External.Modules; using NewHorizons.Utility; using UnityEngine; +using Logger = NewHorizons.Utility.Logger; + namespace NewHorizons.Builder.Props { public static class GeyserBuilder @@ -17,8 +19,21 @@ namespace NewHorizons.Builder.Props InitPrefab(); var geyserGO = _geyserPrefab.InstantiateInactive(); + geyserGO.name = !string.IsNullOrEmpty(info.rename) ? info.rename : "Geyser"; geyserGO.transform.parent = sector?.transform ?? planetGO.transform; - geyserGO.name = "Geyser"; + + if (!string.IsNullOrEmpty(info.parentPath)) + { + var newParent = planetGO.transform.Find(info.parentPath); + if (newParent != null) + { + geyserGO.transform.parent = newParent; + } + else + { + Logger.LogWarning($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}"); + } + } var pos = (Vector3)info.position; diff --git a/NewHorizons/Builder/Props/ProjectionBuilder.cs b/NewHorizons/Builder/Props/ProjectionBuilder.cs index 09e086c4..2c912aff 100644 --- a/NewHorizons/Builder/Props/ProjectionBuilder.cs +++ b/NewHorizons/Builder/Props/ProjectionBuilder.cs @@ -94,7 +94,7 @@ namespace NewHorizons.Builder.Props if (_slideReelPrefab == null) return null; var slideReelObj = _slideReelPrefab.InstantiateInactive(); - slideReelObj.name = $"Prefab_IP_Reel_{mod.ModHelper.Manifest.Name}"; + slideReelObj.name = !string.IsNullOrEmpty(info.rename) ? info.rename : $"Prefab_IP_Reel_{mod.ModHelper.Manifest.Name}"; var slideReel = slideReelObj.GetComponent(); slideReel.SetSector(sector); @@ -196,7 +196,7 @@ namespace NewHorizons.Builder.Props if (_autoPrefab == null) return null; var projectorObj = _autoPrefab.InstantiateInactive(); - projectorObj.name = $"Prefab_IP_AutoProjector_{mod.ModHelper.Manifest.Name}"; + projectorObj.name = !string.IsNullOrEmpty(info.rename) ? info.rename : $"Prefab_IP_AutoProjector_{mod.ModHelper.Manifest.Name}"; var autoProjector = projectorObj.GetComponent(); autoProjector._sector = sector; @@ -276,7 +276,7 @@ namespace NewHorizons.Builder.Props return null; } - g.name = "VisionStaffDetector"; + g.name = !string.IsNullOrEmpty(info.rename) ? info.rename : "VisionStaffDetector"; // The number of slides is unlimited, 15 is only for texturing the actual slide reel item. This is not a slide reel item var slides = info.slides; @@ -312,7 +312,8 @@ namespace NewHorizons.Builder.Props position = info.position, rotation = info.rotation, parentPath = info.parentPath, - isRelativeToParent = info.isRelativeToParent + isRelativeToParent = info.isRelativeToParent, + rename = info.rename }; var standingTorch = DetailBuilder.Make(planetGO, sector, _standingVisionTorchPrefab, detailInfo); diff --git a/NewHorizons/Builder/Props/QuantumBuilder.cs b/NewHorizons/Builder/Props/QuantumBuilder.cs index 3dd81c3b..8a5a383b 100644 --- a/NewHorizons/Builder/Props/QuantumBuilder.cs +++ b/NewHorizons/Builder/Props/QuantumBuilder.cs @@ -41,7 +41,7 @@ namespace NewHorizons.Builder.Props public static void MakeSocketGroup(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, PropModule.QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) { var groupRoot = new GameObject("Quantum Sockets - " + quantumGroup.id); - groupRoot.transform.parent = sector.transform; + groupRoot.transform.parent = sector?.transform ?? go.transform; groupRoot.transform.localPosition = Vector3.zero; groupRoot.transform.localEulerAngles = Vector3.zero; @@ -79,7 +79,7 @@ namespace NewHorizons.Builder.Props public static void MakeStateGroup(GameObject go, Sector sector, PlanetConfig config, IModBehaviour mod, PropModule.QuantumGroupInfo quantumGroup, GameObject[] propsInGroup) { var groupRoot = new GameObject("Quantum States - " + quantumGroup.id); - groupRoot.transform.parent = sector.transform; + groupRoot.transform.parent = sector?.transform ?? go.transform; groupRoot.transform.localPosition = Vector3.zero; var states = new List(); @@ -128,7 +128,7 @@ namespace NewHorizons.Builder.Props //var averagePosition = propsInGroup.Aggregate(Vector3.zero, (avg, prop) => avg + prop.transform.position) / propsInGroup.Count(); GameObject shuffleParent = new GameObject("Quantum Shuffle - " + quantumGroup.id); shuffleParent.SetActive(false); - shuffleParent.transform.parent = sector.transform; + shuffleParent.transform.parent = sector?.transform ?? go.transform; shuffleParent.transform.localPosition = Vector3.zero; propsInGroup.ToList().ForEach(p => p.transform.parent = shuffleParent.transform); diff --git a/NewHorizons/Builder/Props/RaftBuilder.cs b/NewHorizons/Builder/Props/RaftBuilder.cs index ae27cea2..77295611 100644 --- a/NewHorizons/Builder/Props/RaftBuilder.cs +++ b/NewHorizons/Builder/Props/RaftBuilder.cs @@ -53,10 +53,34 @@ namespace NewHorizons.Builder.Props if (_prefab == null || sector == null) return null; GameObject raftObject = _prefab.InstantiateInactive(); - raftObject.name = "Raft_Body"; + raftObject.name = !string.IsNullOrEmpty(info.rename) ? info.rename : "Raft_Body"; raftObject.transform.parent = sector?.transform ?? planetGO.transform; - raftObject.transform.position = planetGO.transform.TransformPoint(info?.position ?? Vector3.zero); - raftObject.transform.rotation = planetGO.transform.TransformRotation(Quaternion.identity); + + if (!string.IsNullOrEmpty(info.parentPath)) + { + var newParent = planetGO.transform.Find(info.parentPath); + if (newParent != null) + { + raftObject.transform.parent = newParent; + } + else + { + Logger.LogWarning($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}"); + } + } + + var pos = (Vector3)(info.position ?? Vector3.zero); + var rot = Quaternion.identity; + if (info.isRelativeToParent) + { + raftObject.transform.localPosition = pos; + raftObject.transform.localRotation = rot; + } + else + { + raftObject.transform.position = planetGO.transform.TransformPoint(pos); + raftObject.transform.rotation = planetGO.transform.TransformRotation(rot); + } StreamingHandler.SetUpStreaming(raftObject, sector); diff --git a/NewHorizons/Builder/Props/RemoteBuilder.cs b/NewHorizons/Builder/Props/RemoteBuilder.cs index 83c66158..bfe446d4 100644 --- a/NewHorizons/Builder/Props/RemoteBuilder.cs +++ b/NewHorizons/Builder/Props/RemoteBuilder.cs @@ -252,14 +252,7 @@ namespace NewHorizons.Builder.Props { var shareStone = _shareStonePrefab.InstantiateInactive(); - if (!string.IsNullOrEmpty(info.rename)) - { - shareStone.name = info.rename; - } - else - { - shareStone.name = "ShareStone_" + id.ToString(); - } + shareStone.name = !string.IsNullOrEmpty(info.rename) ? info.rename : ("ShareStone_" + id.ToString()); shareStone.transform.parent = sector?.transform ?? go.transform; diff --git a/NewHorizons/Builder/Props/TornadoBuilder.cs b/NewHorizons/Builder/Props/TornadoBuilder.cs index d7fef963..2b63bd52 100644 --- a/NewHorizons/Builder/Props/TornadoBuilder.cs +++ b/NewHorizons/Builder/Props/TornadoBuilder.cs @@ -99,10 +99,10 @@ namespace NewHorizons.Builder.Props private static void MakeTornado(GameObject planetGO, Sector sector, PropModule.TornadoInfo info, Vector3 position, bool downwards) { var tornadoGO = downwards ? _downPrefab.InstantiateInactive() : _upPrefab.InstantiateInactive(); - tornadoGO.name = downwards ? "Tornado_Down" : "Tornado_Up"; - tornadoGO.transform.parent = sector.transform; + tornadoGO.name = !string.IsNullOrEmpty(info.rename) ? info.rename : (downwards ? "Tornado_Down" : "Tornado_Up"); + tornadoGO.transform.parent = sector?.transform ?? planetGO.transform; tornadoGO.transform.position = planetGO.transform.TransformPoint(position); - tornadoGO.transform.rotation = Quaternion.FromToRotation(Vector3.up, sector.transform.TransformDirection(position.normalized)); + tornadoGO.transform.rotation = Quaternion.FromToRotation(Vector3.up, planetGO.transform.TransformDirection(position.normalized)); // Add the sound thing before changing the scale var soundGO = _soundPrefab.InstantiateInactive(); @@ -168,7 +168,7 @@ namespace NewHorizons.Builder.Props if (info.wanderRate != 0) { - ApplyWanderer(tornadoGO, sector, info); + ApplyWanderer(tornadoGO, planetGO, info); } soundGO.SetActive(true); @@ -179,9 +179,9 @@ namespace NewHorizons.Builder.Props { var hurricaneGO = _hurricanePrefab.InstantiateInactive(); hurricaneGO.name = "Hurricane"; - hurricaneGO.transform.parent = sector.transform; + hurricaneGO.transform.parent = sector?.transform ?? planetGO.transform; hurricaneGO.transform.position = planetGO.transform.TransformPoint(position); - hurricaneGO.transform.rotation = Quaternion.FromToRotation(Vector3.up, sector.transform.TransformDirection(position.normalized)); + hurricaneGO.transform.rotation = Quaternion.FromToRotation(Vector3.up, planetGO.transform.TransformDirection(position.normalized)); var fluidVolume = hurricaneGO.GetComponentInChildren(); fluidVolume._fluidType = info.fluidType.ConvertToOW(FluidVolume.Type.CLOUD); @@ -227,7 +227,7 @@ namespace NewHorizons.Builder.Props if (info.wanderRate != 0) { - ApplyWanderer(hurricaneGO, sector, info); + ApplyWanderer(hurricaneGO, planetGO, info); } hurricaneGO.SetActive(true); @@ -263,13 +263,13 @@ namespace NewHorizons.Builder.Props } } - private static void ApplyWanderer(GameObject go, Sector sector, PropModule.TornadoInfo info) + private static void ApplyWanderer(GameObject go, GameObject planetGO, PropModule.TornadoInfo info) { var wanderer = go.AddComponent(); wanderer.wanderRate = info.wanderRate; wanderer.wanderDegreesX = info.wanderDegreesX; wanderer.wanderDegreesZ = info.wanderDegreesZ; - wanderer.sector = sector; + wanderer.planetGO = planetGO; } } } diff --git a/NewHorizons/Builder/Props/VolcanoBuilder.cs b/NewHorizons/Builder/Props/VolcanoBuilder.cs index df8e549b..478213cf 100644 --- a/NewHorizons/Builder/Props/VolcanoBuilder.cs +++ b/NewHorizons/Builder/Props/VolcanoBuilder.cs @@ -1,6 +1,8 @@ using NewHorizons.External.Modules; using NewHorizons.Utility; using UnityEngine; +using Logger = NewHorizons.Utility.Logger; + namespace NewHorizons.Builder.Props { public static class VolcanoBuilder @@ -44,10 +46,30 @@ namespace NewHorizons.Builder.Props InitPrefab(); var launcherGO = _meteorLauncherPrefab.InstantiateInactive(); - launcherGO.transform.parent = sector.transform; + launcherGO.name = !string.IsNullOrEmpty(info.rename) ? info.rename : "MeteorLauncher"; + launcherGO.transform.parent = sector?.transform ?? planetGO.transform; launcherGO.transform.position = planetGO.transform.TransformPoint(info.position == null ? Vector3.zero : (Vector3)info.position); - launcherGO.transform.rotation = Quaternion.FromToRotation(launcherGO.transform.TransformDirection(Vector3.up), ((Vector3)info.position).normalized).normalized; - launcherGO.name = "MeteorLauncher"; + + if (!string.IsNullOrEmpty(info.parentPath)) + { + var newParent = planetGO.transform.Find(info.parentPath); + if (newParent != null) + { + launcherGO.transform.parent = newParent; + } + else + { + Logger.LogWarning($"Cannot find parent object at path: {planetGO.name}/{info.parentPath}"); + } + } + + var pos = (Vector3)(info.position ?? Vector3.zero); + if (info.isRelativeToParent) + launcherGO.transform.localPosition = pos; + else + launcherGO.transform.position = planetGO.transform.TransformPoint(pos); + + launcherGO.transform.rotation = Quaternion.FromToRotation(launcherGO.transform.TransformDirection(Vector3.up), pos.normalized).normalized; var meteorLauncher = launcherGO.GetComponent(); meteorLauncher._audioSector = sector; diff --git a/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs b/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs index b35ec450..4218e400 100644 --- a/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs +++ b/NewHorizons/Builder/ShipLog/EntryLocationBuilder.cs @@ -2,6 +2,8 @@ using NewHorizons.External.Modules; using OWML.Common; using System.Collections.Generic; using UnityEngine; +using Logger = NewHorizons.Utility.Logger; + namespace NewHorizons.Builder.ShipLog { public static class EntryLocationBuilder @@ -9,10 +11,29 @@ namespace NewHorizons.Builder.ShipLog private static readonly List _locationsToInitialize = new List(); public static void Make(GameObject go, Sector sector, PropModule.EntryLocationInfo info, IModBehaviour mod) { - GameObject entryLocationGameObject = new GameObject("Entry Location (" + info.id + ")"); + GameObject entryLocationGameObject = new GameObject(!string.IsNullOrEmpty(info.rename) ? info.rename : ("Entry Location (" + info.id + ")")); entryLocationGameObject.SetActive(false); entryLocationGameObject.transform.parent = sector?.transform ?? go.transform; - entryLocationGameObject.transform.position = go.transform.TransformPoint(info.position ?? Vector3.zero); + + if (!string.IsNullOrEmpty(info.parentPath)) + { + var newParent = go.transform.Find(info.parentPath); + if (newParent != null) + { + entryLocationGameObject.transform.parent = newParent; + } + else + { + Logger.LogWarning($"Cannot find parent object at path: {go.name}/{info.parentPath}"); + } + } + + var pos = (Vector3)(info.position ?? Vector3.zero); + if (info.isRelativeToParent) + entryLocationGameObject.transform.localPosition = pos; + else + entryLocationGameObject.transform.position = go.transform.TransformPoint(pos); + ShipLogEntryLocation newLocation = entryLocationGameObject.AddComponent(); newLocation._entryID = info.id; newLocation._outerFogWarpVolume = go.GetComponentInChildren(); diff --git a/NewHorizons/Components/NHTornadoWanderController.cs b/NewHorizons/Components/NHTornadoWanderController.cs index ea65be11..6d8dcd0e 100644 --- a/NewHorizons/Components/NHTornadoWanderController.cs +++ b/NewHorizons/Components/NHTornadoWanderController.cs @@ -7,7 +7,7 @@ namespace NewHorizons.Components public float wanderRate; public float wanderDegreesX; public float wanderDegreesZ; - public Sector sector; + public GameObject planetGO; private float noiseOffset; private float startDegreesX; @@ -47,7 +47,7 @@ namespace NewHorizons.Components var newPos = new Vector3(newX, newY, newZ); transform.localPosition = newPos; - transform.rotation = Quaternion.FromToRotation(Vector3.up, sector.transform.TransformDirection(newPos.normalized)); + transform.rotation = Quaternion.FromToRotation(Vector3.up, planetGO.transform.TransformDirection(newPos.normalized)); } } } diff --git a/NewHorizons/External/Modules/PropModule.cs b/NewHorizons/External/Modules/PropModule.cs index 4e0a3a1e..a6058299 100644 --- a/NewHorizons/External/Modules/PropModule.cs +++ b/NewHorizons/External/Modules/PropModule.cs @@ -243,6 +243,21 @@ namespace NewHorizons.External.Modules /// Acceleration of the raft. Default acceleration is 5. /// [DefaultValue(5f)] public float acceleration = 5f; + + /// + /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). + /// + public string parentPath; + + /// + /// Whether the positional and rotational coordinates are relative to parent instead of the root planet object. + /// + public bool isRelativeToParent; + + /// + /// An optional rename of this object + /// + public string rename; } [JsonObject] @@ -287,6 +302,16 @@ namespace NewHorizons.External.Modules /// Loudness of the geyser /// [DefaultValue(0.7f)] public float volume = 0.7f; + + /// + /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). + /// + public string parentPath; + + /// + /// An optional rename of this object + /// + public string rename; } [JsonObject] @@ -354,6 +379,21 @@ namespace NewHorizons.External.Modules /// Fluid type for sounds/effects when colliding with this tornado. /// [DefaultValue("cloud")] public FluidType fluidType = FluidType.Cloud; + + /// + /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). + /// + public string parentPath; + + /// + /// Whether the positional and rotational coordinates are relative to parent instead of the root planet object. + /// + public bool isRelativeToParent; + + /// + /// An optional rename of this object + /// + public string rename; } [JsonObject] @@ -402,6 +442,21 @@ namespace NewHorizons.External.Modules /// The colour of the meteor's stone. /// public MColor stoneTint; + + /// + /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). + /// + public string parentPath; + + /// + /// Whether the positional and rotational coordinates are relative to parent instead of the root planet object. + /// + public bool isRelativeToParent; + + /// + /// An optional rename of this object + /// + public string rename; } [JsonObject] @@ -489,6 +544,21 @@ namespace NewHorizons.External.Modules /// The position of this entry location /// public MVector3 position; + + /// + /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). + /// + public string parentPath; + + /// + /// Whether the positional and rotational coordinates are relative to parent instead of the root planet object. + /// + public bool isRelativeToParent; + + /// + /// An optional rename of this object + /// + public string rename; } [JsonObject] @@ -680,6 +750,11 @@ namespace NewHorizons.External.Modules /// Whether the positional and rotational coordinates are relative to parent instead of the root planet object. /// public bool isRelativeToParent; + + /// + /// An optional rename of this object + /// + public string rename; } [JsonObject] diff --git a/NewHorizons/External/Modules/VariableSize/SingularityModule.cs b/NewHorizons/External/Modules/VariableSize/SingularityModule.cs index 448c3cdb..e0c1041d 100644 --- a/NewHorizons/External/Modules/VariableSize/SingularityModule.cs +++ b/NewHorizons/External/Modules/VariableSize/SingularityModule.cs @@ -75,5 +75,20 @@ namespace NewHorizons.External.Modules.VariableSize /// Optional override for the render queue. If the singularity is rendering oddly, increasing this to 3000 can help /// [Range(2501f, 3500f)] public int renderQueueOverride = 2985; + + /// + /// The relative path from the planet to the parent of this object. Optional (will default to the root sector). + /// + public string parentPath; + + /// + /// Whether the positional and rotational coordinates are relative to parent instead of the root planet object. + /// + public bool isRelativeToParent; + + /// + /// An optional rename of this object + /// + public string rename; } } \ No newline at end of file diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 03fedb7f..8da78e60 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -1162,6 +1162,18 @@ "position": { "description": "The position of this entry location", "$ref": "#/definitions/MVector3" + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" } } }, @@ -1218,6 +1230,14 @@ "description": "Loudness of the geyser", "format": "float", "default": 0.7 + }, + "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" } } }, @@ -1390,6 +1410,18 @@ "description": "Acceleration of the raft. Default acceleration is 5.", "format": "float", "default": 5.0 + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" } } }, @@ -1505,6 +1537,10 @@ "isRelativeToParent": { "type": "boolean", "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" } } }, @@ -1707,6 +1743,18 @@ "description": "Fluid type for sounds/effects when colliding with this tornado.", "default": "cloud", "$ref": "#/definitions/FluidType" + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" } } }, @@ -1768,6 +1816,18 @@ "stoneTint": { "description": "The colour of the meteor's stone.", "$ref": "#/definitions/MColor" + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" } } }, @@ -1828,6 +1888,18 @@ "format": "int32", "maximum": 3500.0, "minimum": 2501.0 + }, + "parentPath": { + "type": "string", + "description": "The relative path from the planet to the parent of this object. Optional (will default to the root sector)." + }, + "isRelativeToParent": { + "type": "boolean", + "description": "Whether the positional and rotational coordinates are relative to parent instead of the root planet object." + }, + "rename": { + "type": "string", + "description": "An optional rename of this object" } } }, diff --git a/NewHorizons/packages.config b/NewHorizons/packages.config deleted file mode 100644 index 29df5b05..00000000 --- a/NewHorizons/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file